| name | subagent-driven-development |
| source | adapted from obra/superpowers (MIT License) |
| trigger | auto+manual |
| version | 1.0.0 |
| description | Use when executing implementation plans with independent tasks in the current session. Chat triggers: 'subagent development', 'spawn agents', 'delegate tasks', 'assign work', 'multiple agents working', 'task delegation', 'fan out work', 'parallel implementation', 'subagent-driven', 'divide and conquer', 'split implementation', 'agent team', 'multi-agent execution', 'distribute tasks'. |
Subagent-Driven Development
Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
Why subagents: Delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, ensure they stay focused and succeed at their task. They should never inherit the session's context or history — construct exactly what they need. This also preserves context for coordination work.
Core principle: Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
When to Use
vs. Inline execution (same session):
- Same session (no context switch)
- Fresh subagent per task (no context pollution)
- Two-stage review after each task: spec compliance first, then code quality
- Faster iteration (no human-in-loop between tasks)
vs. Parallel session (executing-plans):
- Different session (context switch)
- Human-in-loop between batches
- Review checkpoints for review
- Better for large, risky changes
The Process
- Read plan file once — extract all tasks with full text and context
- Create TodoWrite with all tasks — one per task from plan
- For each task:
- Dispatch implementer subagent (using
./implementer-prompt.md)
- Answer any questions they have
- Implementer implements, tests, commits, self-reviews
- Dispatch spec reviewer subagent (using
./spec-reviewer-prompt.md)
- Spec reviewer confirms code matches spec
- If not spec compliant → implementer fixes spec gaps → re-review
- Dispatch code quality reviewer subagent (using
./code-quality-reviewer-prompt.md)
- Code quality reviewer approves or flags issues
- If issues → implementer fixes → re-review
- Mark task complete in TodoWrite
- After all tasks: Dispatch final code reviewer for entire implementation
- Use finishing-a-development-branch to complete the workflow
Handling Implementer Status
Implementer subagents report one of four statuses. Handle each appropriately:
DONE: Proceed to spec compliance review.
DONE_WITH_CONCERNS: The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.
NEEDS_CONTEXT: The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
BLOCKED: The implementer cannot complete the task. Assess the blocker:
- If it's a context problem, provide more context and re-dispatch with the same model
- If the task requires more reasoning, re-dispatch with a more capable model
- If the task is too large, break it into smaller pieces
- If the plan itself is wrong, escalate to the user
Never ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
Prompt Templates
./implementer-prompt.md - Dispatch implementer subagent
./spec-reviewer-prompt.md - Dispatch spec compliance reviewer subagent
./code-quality-reviewer-prompt.md - Dispatch code quality reviewer subagent
Example Workflow
You: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/plans/feature-plan.md]
[Extract all 5 tasks with full text and context]
[Create TodoWrite with all tasks]
Task 1: Hook installation script
[Get Task 1 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
Implementer: "Before I begin - should the hook be installed at user or system level?"
You: "User level (~/.config/hooks/)"
Implementer: "Got it. Implementing now..."
[Later] Implementer:
- Implemented install-hook command
- Added tests, 5/5 passing
- Self-review: Found I missed --force flag, added it
- Committed
[Dispatch spec compliance reviewer]
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
[Get git SHAs, dispatch code quality reviewer]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Mark Task 1 complete]
Task 2: Recovery modes
...
[After all tasks]
[Dispatch final code reviewer]
Final reviewer: All requirements met, ready to merge
Done!
Advantages
vs. Manual execution:
- Subagents follow TDD naturally
- Fresh context per task (no confusion)
- Parallel-safe (subagents don't interfere)
- Subagent can ask questions (before AND during work)
Efficiency gains:
- No file reading overhead (controller provides full text)
- Controller curates exactly what context is needed
- Subagent gets complete information upfront
- Questions surfaced before work begins (not after)
Quality gates:
- Self-review catches issues before handoff
- Two-stage review: spec compliance, then code quality
- Review loops ensure fixes actually work
- Spec compliance prevents over/under-building
- Code quality ensures implementation is well-built
Red Flags
Never:
- Start implementation on main/master branch without explicit user consent
- Skip reviews (spec compliance OR code quality)
- Proceed with unfixed issues
- Dispatch multiple implementation subagents in parallel (conflicts)
- Make subagent read plan file (provide full text instead)
- Skip scene-setting context (subagent needs to understand where task fits)
- Ignore subagent questions (answer before letting them proceed)
- Accept "close enough" on spec compliance (spec reviewer found issues = not done)
- Skip review loops (reviewer found issues = implementer fixes = review again)
- Let implementer self-review replace actual review (both are needed)
- Start code quality review before spec compliance is ✅ (wrong order)
- Move to next task while either review has open issues
If subagent asks questions:
- Answer clearly and completely
- Provide additional context if needed
- Don't rush them into implementation
If reviewer finds issues:
- Implementer (same subagent) fixes them
- Reviewer reviews again
- Repeat until approved
- Don't skip the re-review
If subagent fails task:
- Dispatch fix subagent with specific instructions
- Don't try to fix manually (context pollution)
Integration
Required workflow skills:
- using-git-worktrees - REQUIRED: Set up isolated workspace before starting
- writing-plans - Creates the plan this skill executes
- requesting-code-review - Code review template for reviewer subagents
- finishing-a-development-branch - Complete development after all tasks
Subagents should use:
- test-driven-development - Subagents follow TDD for each task