Resolves issue #86 by having the spawn-issues orchestrator create worktrees
upfront and pass the worktree paths to agents, instead of having agents
create their own worktrees in sibling directories outside the sandbox.
Changes:
- spawn-issues orchestrator creates all worktrees before spawning agents
- issue-worker, pr-fixer, code-reviewer accept optional WORKTREE_PATH
- When WORKTREE_PATH is provided, agents work directly in that directory
- Backward compatible: agents still support creating their own worktrees
if WORKTREE_PATH is not provided
- Orchestrator handles all worktree cleanup after agents complete
- Eliminates permission denied errors from agents trying to access
sibling worktree directories
This ensures agents operate within their sandbox while still being able to
work with isolated git worktrees for parallel implementation.
Closes#86
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
The code reviewer prompt was minimal and didn't specify worktree setup,
causing parallel reviewers to interfere with each other by checking out
different branches in the same directory.
Changes:
- Add worktree setup/cleanup to code reviewer prompt (like issue-worker/fixer)
- Add branch tracking to issue state
- Add note about passing branch name to reviewers
- Expand reviewer prompt with full review process
This ensures each reviewer works in isolation at:
../<repo>-review-<pr-number>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace polling loop with task-notification based orchestration.
Background tasks send notifications when complete - no need to poll.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Each issue flows independently through: implement → review → fix → review
- Don't wait for all workers before starting reviews
- Print status update as each step completes
- Poll loop checks all tasks, advances each issue independently
- State machine: implementing → reviewing → fixing → approved/failed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
spawn-issues now orchestrates the full workflow:
- Phase 1: Spawn issue-workers in parallel, wait for completion
- Phase 2: Review loop - spawn code-reviewer, if needs work spawn pr-fixer
- Phase 3: Report final status
issue-worker simplified:
- Removed Task tool and review loop
- Just implements, creates PR, cleans up
- Returns structured result for orchestrator to parse
Benefits:
- Better visibility into progress
- Reuses pr-fixer agent
- Clean separation of concerns
- Orchestrator controls review cycle
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The inline prompt in spawn-issues.md was missing the review loop
that was added to issue-worker/agent.md. Now includes:
- Step 7: Spawn code-reviewer synchronously, fix and re-review if needed
- Step 9: Concise final summary output
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New command that spawns background agents to work on multiple
issues simultaneously, each in an isolated git worktree.
- commands/spawn-issues.md: Entry point, parses args, spawns agents
- agents/issue-worker/agent.md: Autonomous agent that implements
a single issue (worktree setup, implement, PR, cleanup)
Worktrees are automatically cleaned up after PR creation.
Branch remains on remote for follow-up work if needed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>