Commit Graph

9 Commits

Author SHA1 Message Date
81c2a90ce1 Spawn agents with cwd set to their worktree
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>
2026-01-11 00:12:14 +01:00
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
e1c19c12c3 Fix spawn-issues to use correct subagent_type for each agent
- Issue worker: "general-purpose" → "issue-worker"
- Code reviewer: Added explicit subagent_type: "code-reviewer"
- PR fixer: Added explicit subagent_type: "pr-fixer"

Using the wrong agent type caused permission loops when spawning
background agents.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 16:13:09 +01:00
73caf4e4cf Fix spawn-issues: use worktrees for code reviewers
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>
2026-01-10 01:14:16 +01:00
c27659f1dd Update spawn-issues to event-driven pattern
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>
2026-01-10 01:03:17 +01:00
22962c22cf Update spawn-issues to concurrent pipeline with status updates
- 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>
2026-01-09 18:11:05 +01:00
3afe930a27 Refactor spawn-issues as orchestrator
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>
2026-01-09 17:33:22 +01:00
7dffdc4e77 Add review loop to spawn-issues agent prompt
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>
2026-01-09 17:26:21 +01:00
a7d7d60440 Add /spawn-issues command for parallel issue work
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>
2026-01-09 16:50:34 +01:00