--- allowed-tools: Bash, Task, Read description: Spawn parallel background agents to address PR review feedback argument-hint: [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 ```bash 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 ```bash # List open PRs tea pulls --state open # For each PR, check if it has review comments requesting changes tea pulls --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 ` 2. Spawn background agent using Task tool: ``` Task tool with: - subagent_type: "general-purpose" - 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 # autonomously. Context: - Repository path: - Repository name: - PR number: Instructions from @agents/pr-fixer/agent.md: 1. Get PR details and review comments: cd git fetch origin tea pulls --comments 2. Setup worktree from PR branch: git worktree add ../-pr- origin/ cd ../-pr- git checkout 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 " 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 && git worktree remove ../-pr- --force 9. Output concise summary (5-10 lines max): PR #: 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 ```