From claude-skills
Orchestrates implementation plans with worktree isolation, TDD discipline, and two-stage review. Referenced by execute-plan, fixit, and bugbash.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-skills:agent-driven-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A reusable orchestration loop for agent-driven implementation. Skills like `execute-plan`, `fixit`, and `bugbash` reference this pattern rather than defining their own execution mechanics. It combines worktree isolation, TDD discipline, and two-stage review (spec compliance then code quality). Fresh agent per task to prevent context pollution.
A reusable orchestration loop for agent-driven implementation. Skills like execute-plan, fixit, and bugbash reference this pattern rather than defining their own execution mechanics. It combines worktree isolation, TDD discipline, and two-stage review (spec compliance then code quality). Fresh agent per task to prevent context pollution.
Delegating implementation to fresh agents with isolated context produces better results than accumulating work in one long session. The controller curates exactly what each agent needs -- no more, no less. This preserves the controller's own context for coordination while keeping each agent focused.
The two-stage review (spec compliance, then code quality) catches different failure modes: building the wrong thing vs. building the right thing poorly. Both reviews are mandatory, and spec compliance must pass before code quality review begins.
For each task in the plan:
.claude/worktree/<task-slug>/skills/test-driven-development/SKILL.md), self-reviews per verification-before-completion (skills/verification-before-completion/SKILL.md)DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKEDUse TaskCreate with addBlockedBy to build dependency graphs. The controller creates all tasks upfront from the plan. Tasks become eligible for execution when all their blockers complete.
TaskCreate("Update specs", ...)
TaskCreate("Write failing tests", ..., addBlockedBy: [spec-task-id])
TaskCreate("Implement auth module", ..., addBlockedBy: [test-task-id])
TaskCreate("Implement API routes", ..., addBlockedBy: [test-task-id]) <- parallel with above
TaskCreate("Integration tests", ..., addBlockedBy: [auth-id, api-id])
This naturally expresses the dependency graph. Independent tasks (auth module and API routes above) become eligible simultaneously and can run in parallel worktrees.
Every task gets its own worktree at .claude/worktree/<task-slug>/. This provides:
If .claude/worktree/ does not exist in the project:
.claude/worktree/ to the project's .gitignore (append if not already present)After an agent completes a task and passes both reviews:
Once execution starts, the controller never asks the user anything. Handle all statuses internally:
One summary at the end. No mid-execution interruptions.
Use the least powerful model that can handle each role. This conserves cost and increases speed.
model: "haiku"model: "sonnet"| Signal | Model |
|---|---|
| Touches 1-2 files with complete spec | haiku |
| Touches multiple files with integration concerns | sonnet |
| Requires design judgment or broad codebase understanding | default (most capable) |
| Review roles (spec compliance, code quality) | default (most capable) |
When multiple tasks are unblocked simultaneously (no dependency between them), dispatch them in parallel:
The Task system handles this naturally -- when a blocking task completes, all tasks it was blocking become eligible. The controller dispatches all eligible tasks at once.
For bug-fix tasks, the implementer agent should also read:
skills/debug/root-cause-tracing.md -- systematic hypothesis-driven debuggingskills/debug/defense-in-depth.md -- making fixes robust against related failuresInclude these references in the implementer's dispatch prompt when the task involves diagnosing or fixing bugs (as opposed to greenfield implementation).
The following prompt templates define agent behavior. The controller provides task-specific context when dispatching each agent.
./implementer-prompt.md -- implementation agent instructions./spec-reviewer-prompt.md -- spec compliance reviewer instructions./code-quality-reviewer-prompt.md -- code quality reviewer instructionsWhen the calling session runs from inside a sandboxed worktree (cannot write to MAIN_REPO at the OS layer), the normal git worktree add + git merge flow fails. ./sandbox-mode.md defines a graceful degradation that auto-detects sandbox mode via ~/.claude/bin/repo-writable-check.sh and falls back to host task-spawning, staged-command, or async verify-then-archive paths. Skills like /fixit and /bugbash reference it from their dispatch and on-completion sections.
Never:
If a reviewer finds issues:
If an agent fails a task:
npx claudepluginhub anutron/aiGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.