Skip to main content

Overview

Subagent-Driven Development executes implementation plans by dispatching a fresh subagent for each task, followed by two-stage review: spec compliance first, then code quality.
Core principle: Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration

When to Use

Use when:
  • You have an implementation plan from Writing Plans
  • Tasks are mostly independent
  • You want to stay in the current session (not switch to parallel session)
vs. Executing Plans (parallel session):
  • Same session (no context switch)
  • Fresh subagent per task (no context pollution)
  • Two-stage review after each task
  • Faster iteration (no human-in-loop between tasks)

The Process

1

Read Plan and Create Todos

  1. Read plan file once: docs/plans/YYYY-MM-DD-feature.md
  2. Extract all tasks with full text and context
  3. Create TodoWrite with all tasks
Read the plan file once upfront. Extract all task details so you can provide them to subagents without making them read the file.
2

Dispatch Implementer Subagent

Use ./implementer-prompt.md template to dispatch subagent with:
  • Full task text (already extracted)
  • Context about where task fits
  • Scene-setting (what’s already built, what this adds)
Implementer subagent workflow:
  1. May ask questions before starting
  2. Implements following TDD
  3. Tests the implementation
  4. Commits the changes
  5. Self-reviews the code
If subagent asks questions:
  • Answer clearly and completely
  • Provide additional context if needed
  • Let them proceed once answered
3

Dispatch Spec Compliance Reviewer

Use ./spec-reviewer-prompt.md template to dispatch reviewer:
  • Provide task spec
  • Provide what was implemented
Spec reviewer confirms:
  • ✅ All spec requirements met
  • ✅ Nothing extra added (no YAGNI violations)
  • ❌ Lists any missing requirements
  • ❌ Lists any extra features
Do NOT proceed to code quality review until spec compliance is ✅Wrong order wastes effort reviewing code that doesn’t match spec.
If reviewer finds issues:
  1. Implementer (same subagent) fixes them
  2. Spec reviewer reviews again
  3. Repeat until ✅
4

Dispatch Code Quality Reviewer

Use ./code-quality-reviewer-prompt.md template:
  • Provide git SHAs for the changes
  • Ask for code quality assessment
Code reviewer assesses:
  • Strengths of implementation
  • Issues (Important / Minor / Nitpick)
  • Approval or required changes
If reviewer finds issues:
  1. Implementer fixes them
  2. Code reviewer reviews again
  3. Repeat until approved
5

Mark Task Complete

Once both reviews approved:
  • Mark task completed in TodoWrite
  • Move to next task
6

After All Tasks

  1. Dispatch final code reviewer for entire implementation
  2. Use superpowers:finishing-a-development-branch skill

Visual Workflow

Prompt Templates

The skill includes three prompt templates:

Implementer

./implementer-prompt.mdDispatch to implement task with TDD

Spec Reviewer

./spec-reviewer-prompt.mdVerify implementation matches spec

Code Quality Reviewer

./code-quality-reviewer-prompt.mdAssess code quality and suggest improvements

Example Workflow

You: I'm using Subagent-Driven Development to execute this plan.

[Read plan file once: docs/plans/2026-03-09-metrics.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/superpowers/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: abc123f

[Dispatch spec compliance reviewer]

Spec reviewer: ✅ Spec compliant
  - All requirements met
  - Nothing extra added

[Get git SHAs, dispatch code quality reviewer]

Code reviewer:
  Strengths: Good test coverage, clean implementation
  Issues: None
  ✅ Approved

[Mark Task 1 complete]

---

Task 2: Recovery modes

[Get Task 2 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]

Implementer: [No questions, proceeds]

Implementer:
  - Added verify/repair modes
  - 8/8 tests passing
  - Self-review: All good
  - Committed: def456a

[Dispatch spec compliance reviewer]

Spec reviewer: ❌ Issues:
  - Missing: Progress reporting (spec says "report every 100 items")
  - Extra: Added --json flag (not requested)

[Implementer fixes issues]

Implementer: 
  - Removed --json flag
  - Added progress reporting
  - Committed: ghi789b

[Spec reviewer reviews again]

Spec reviewer: ✅ Spec compliant now

[Dispatch code quality reviewer]

Code reviewer:
  Strengths: Solid implementation
  Issues (Important): Magic number (100) should be constant

[Implementer fixes]

Implementer:
  - Extracted PROGRESS_INTERVAL constant
  - Committed: jkl012c

[Code reviewer reviews again]

Code reviewer: ✅ Approved

[Mark Task 2 complete]

---

[Tasks 3-5 similar...]

---

All tasks complete!

[Dispatch final code reviewer]

Final reviewer: All requirements met, ready to merge

Using finishing-a-development-branch skill...

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)

vs. Executing Plans

  • Same session (no handoff)
  • Continuous progress (no waiting)
  • Review checkpoints automatic

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

Cost

Higher invocation cost:
  • More subagent invocations (implementer + 2 reviewers per task)
  • Controller does more prep work (extracting all tasks upfront)
  • Review loops add iterations
But catches issues early (cheaper than debugging later)

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
Critical: Review OrderSpec compliance MUST be ✅ before code quality review starts.Reviewing code quality for code that doesn’t match spec wastes effort.

Handling Issues

If Subagent Asks Questions

  • Answer clearly and completely
  • Provide additional context if needed
  • Don’t rush them into implementation
  • Questions are good - they prevent wrong work

If Reviewer Finds Issues

  1. Implementer (same subagent) fixes them
  2. Reviewer reviews again
  3. Repeat until approved
  4. Don’t skip the re-review

If Subagent Fails Task

  • Dispatch fix subagent with specific instructions
  • Don’t try to fix manually (context pollution)
  • Provide clear context about what failed and why

Checklist

Per task:
  • Extracted task text and context upfront
  • Dispatched implementer with complete information
  • Answered any questions before proceeding
  • Implementer completed (implemented, tested, committed, self-reviewed)
  • Dispatched spec compliance reviewer
  • Spec reviewer approved (or issues fixed and re-reviewed)
  • Dispatched code quality reviewer (only after spec ✅)
  • Code reviewer approved (or issues fixed and re-reviewed)
  • Marked task complete in TodoWrite
After all tasks:
  • Dispatched final code reviewer
  • Used finishing-a-development-branch skill
Two-stage review (spec then quality) catches different types of issues. Spec compliance ensures you built the right thing. Code quality ensures you built it right.

Build docs developers (and LLMs) love