Files
architecture/commands/spawn-pr-fixes.md
Hugo Nijhuis bbd7870483 Configure model settings for commands, agents, and skills
Set explicit model preferences to optimize for speed vs capability:

- haiku: 11 commands, 2 agents (issue-worker, pr-fixer), 10 skills
  Fast execution for straightforward tasks

- sonnet: 4 commands (groom, improve, plan-issues, review-pr),
  1 agent (code-reviewer)
  Better judgment for analysis and review tasks

- opus: 2 commands (arch-refine-issue, arch-review-repo),
  1 agent (software-architect)
  Deep reasoning for architectural analysis

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 00:06:53 +01:00

3.0 KiB

allowed-tools, model, description, argument-hint
allowed-tools model description argument-hint
Bash, Task, Read haiku Spawn parallel background agents to address PR review feedback
pr-number...

Spawn PR Fixes

Spawn background agents to address review feedback on multiple PRs in parallel. Each agent works in an isolated git worktree.

Arguments

Optional PR numbers separated by spaces: $ARGUMENTS

  • With arguments: /spawn-pr-fixes 12 15 18 - fix specific PRs
  • Without arguments: /spawn-pr-fixes - find and fix all PRs with requested changes

Process

Step 1: Get Repository Info

REPO_PATH=$(pwd)
REPO_NAME=$(basename $REPO_PATH)

Step 2: Determine PRs to Fix

If PR numbers provided: Use those directly

If no arguments: Find PRs needing work

# List open PRs
tea pulls --state open

# For each PR, check if it has review comments requesting changes
tea pulls <number> --comments

Look for PRs where:

  • Review comments exist that haven't been addressed
  • PR is not approved yet
  • PR is open (not merged/closed)

Step 3: For Each PR

  1. Fetch PR title using tea pulls <number>

  2. Spawn background agent using Task tool:

    Task tool with:
      - subagent_type: "pr-fixer"
      - run_in_background: true
      - prompt: See agent prompt below
    

Agent Prompt

For each PR, use this prompt:

You are a pr-fixer agent. Address review feedback on PR #<NUMBER> autonomously.

Context:
- Repository path: <REPO_PATH>
- Repository name: <REPO_NAME>
- PR number: <NUMBER>

Instructions from @agents/pr-fixer/agent.md:

1. Get PR details and review comments:
   cd <REPO_PATH>
   git fetch origin
   tea pulls <NUMBER> --comments

2. Setup worktree from PR branch:
   git worktree add ../<REPO_NAME>-pr-<NUMBER> origin/<branch-name>
   cd ../<REPO_NAME>-pr-<NUMBER>
   git checkout <branch-name>

3. Analyze feedback, create todos with TodoWrite

4. Address each piece of feedback

5. Commit and push:
   git add -A && git commit with message "Address review feedback\n\n...\n\nCo-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
   git push

6. Spawn code-reviewer synchronously (NOT in background) to re-review

7. If needs more work, fix and re-review (max 3 iterations)

8. Cleanup (ALWAYS do this):
   cd <REPO_PATH> && git worktree remove ../<REPO_NAME>-pr-<NUMBER> --force

9. Output concise summary (5-10 lines max):
   PR #<NUMBER>: <title>
   Status: <fixed|partial|blocked>
   Feedback addressed: <count> items
   Review: <approved|needs-work|skipped>

Work autonomously. Make judgment calls on ambiguous feedback. If blocked, note it in a commit message.

Step 4: Report

After spawning all agents, display:

Spawned <N> pr-fixer agents:

| PR  | Title                    | Status     |
|-----|--------------------------|------------|
| #12 | Add /commit command      | spawned    |
| #15 | Add /pr command          | spawned    |
| #18 | Add CI status            | spawned    |

Agents working in background. Monitor with:
- Check PR list: tea pulls
- Check worktrees: git worktree list