跳到正文
DEV Community· developerz.ai·· 2 小時前AI 評分58

Claude Task Master 如何自動化 PR 完整生命週期

Automating the Full PR Lifecycle with Claude Task Master

AI 導讀

Claude Task Master 的 `claudetm merge-pr` 可處理 PR 從等待 CI、分析並修復失敗、處理審查意見,到獲批後合併及核實成功條件的流程。

正文

developerz.ai

The Problem: PRs Don't Merge Themselves

You open a pull request. CI runs. Something fails. You fix it, push again. A reviewer leaves comments. You address them, push again. CI passes. You wait for approval. You merge. Repeat for every PR.

This loop is mechanical. It doesn't require creativity - it requires persistence. And that's exactly what Claude Task Master handles.

What claudetm merge-pr Does

claudetm merge-pr 147

That command owns the entire merge loop:

  • Waits for CI checks to complete
  • If they fail, analyzes the failure and fixes the code
  • Pushes the fix, waits for CI again
  • Addresses review comments as they arrive
  • Merges when approved (configurable auto-merge)
  • Verifies success criteria are actually met

The tool doesn't just retry - it understands the codebase, runs tests, and makes targeted fixes.

Real Usage

This repository's own PRs #147 through #150 were merged using claudetm merge-pr. The maintainer didn't babysit any of them.

How It Fits the Broader Workflow

merge-pr is one entry point. The full autonomous workflow starts with:

claudetm start "Add user authentication with tests"

That command:

  1. Reads the codebase and creates a task list organized by PRs
  2. Defines success criteria up front
  3. Works through each task: changes, tests, commits, pushes
  4. Opens PRs for each logical unit
  5. Hands off to the merge loop
  6. Accepts dynamic plan updates via its mailbox system while working

Profiles for Parallel Work

If you run multiple Claude subscriptions, profiles keep them isolated:

# OAuth profile - isolated config home
claudetm --profile team-a start "..."

# API-key profile - direct Anthropic-compatible endpoint
claudetm --profile ci-bot --api-key $KEY start "..."

Each profile gets its own ~/.claudetm/profiles/<name>/ directory so credentials never clobber each other.

Building on Top

The REST API, MCP server, and HMAC-signed webhooks expose the same lifecycle programmatically. A dashboard, a bot, or a CI pipeline can dispatch tasks and react to progress without running the CLI interactively.

Getting Started

uv tool install claude-task-master
claude
/login
cd your-project
claudetm start "Your goal here"

Requires Python >= 3.10, authenticated Claude CLI, and authenticated GitHub CLI.

Open source, MIT licensed. https://github.com/developerz-ai/claude-task-master

ClaudeCode #AIAgents #DevTools #Automation #OpenSource

來源:DEV Community · dev.to