Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Executes implementation plans by dispatching isolated subagents per task with two-stage spec and code quality review.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: subagent-driven-development3description: Use when executing implementation plans with independent tasks in the current session4---56# Subagent-Driven Development78Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.910**Why subagents:** You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.1112**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration1314**Continuous execution:** Do not pause to check in with your human partner between tasks. Execute all tasks from the plan without stopping. The only reasons to stop are: BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.1516## When to Use1718```dot19digraph when_to_use {20"Have implementation plan?" [shape=diamond];21"Tasks mostly independent?" [shape=diamond];22"Stay in this session?" [shape=diamond];23"subagent-driven-development" [shape=box];24"executing-plans" [shape=box];25"Manual execution or brainstorm first" [shape=box];2627"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];28"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];29"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];30"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];31"Stay in this session?" -> "subagent-driven-development" [label="yes"];32"Stay in this session?" -> "executing-plans" [label="no - parallel session"];33}34```3536**vs. Executing Plans (parallel session):**37- Same session (no context switch)38- Fresh subagent per task (no context pollution)39- Two-stage review after each task: spec compliance first, then code quality40- Faster iteration (no human-in-loop between tasks)4142## The Process4344```dot45digraph process {46rankdir=TB;4748subgraph cluster_per_task {49label="Per Task";50"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];51"Implementer subagent asks questions?" [shape=diamond];52"Answer questions, provide context" [shape=box];53"Implementer subagent implements, tests, commits, self-reviews" [shape=box];54"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];55"Spec reviewer subagent confirms code matches spec?" [shape=diamond];56"Implementer subagent fixes spec gaps" [shape=box];57"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];58"Code quality reviewer subagent approves?" [shape=diamond];59"Implementer subagent fixes quality issues" [shape=box];60"Mark task complete in TodoWrite" [shape=box];61}6263"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];64"More tasks remain?" [shape=diamond];65"Dispatch final code reviewer subagent for entire implementation" [shape=box];66"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];6768"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";69"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";70"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];71"Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";72"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];73"Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";74"Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";75"Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];76"Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];77"Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];78"Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";79"Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];80"Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];81"Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];82"Mark task complete in TodoWrite" -> "More tasks remain?";83"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];84"More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];85"Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";86}87```8889## Model Selection9091Use the least powerful model that can handle each role to conserve cost and increase speed.9293**Mechanical implementation tasks** (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.9495**Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.9697**Architecture, design, and review tasks**: use the most capable available model.9899**Task complexity signals:**100- Touches 1-2 files with a complete spec → cheap model101- Touches multiple files with integration concerns → standard model102- Requires design judgment or broad codebase understanding → most capable model103104## Handling Implementer Status105106Implementer subagents report one of four statuses. Handle each appropriately:107108**DONE:** Proceed to spec compliance review.109110**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.111112**NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.113114**BLOCKED:** The implementer cannot complete the task. Assess the blocker:1151. If it's a context problem, provide more context and re-dispatch with the same model1162. If the task requires more reasoning, re-dispatch with a more capable model1173. If the task is too large, break it into smaller pieces1184. If the plan itself is wrong, escalate to the human119120**Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.121122## Prompt Templates123124- `./implementer-prompt.md` - Dispatch implementer subagent125- `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent126- `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent127128## Example Workflow129130```131You: I'm using Subagent-Driven Development to execute this plan.132133[Read plan file once: docs/superpowers/plans/feature-plan.md]134[Extract all 5 tasks with full text and context]135[Create TodoWrite with all tasks]136137Task 1: Hook installation script138139[Get Task 1 text and context (already extracted)]140[Dispatch implementation subagent with full task text + context]141142Implementer: "Before I begin - should the hook be installed at user or system level?"143144You: "User level (~/.config/superpowers/hooks/)"145146Implementer: "Got it. Implementing now..."147[Later] Implementer:148- Implemented install-hook command149- Added tests, 5/5 passing150- Self-review: Found I missed --force flag, added it151- Committed152153[Dispatch spec compliance reviewer]154Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra155156[Get git SHAs, dispatch code quality reviewer]157Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.158159[Mark Task 1 complete]160161Task 2: Recovery modes162163[Get Task 2 text and context (already extracted)]164[Dispatch implementation subagent with full task text + context]165166Implementer: [No questions, proceeds]167Implementer:168- Added verify/repair modes169- 8/8 tests passing170- Self-review: All good171- Committed172173[Dispatch spec compliance reviewer]174Spec reviewer: ❌ Issues:175- Missing: Progress reporting (spec says "report every 100 items")176- Extra: Added --json flag (not requested)177178[Implementer fixes issues]179Implementer: Removed --json flag, added progress reporting180181[Spec reviewer reviews again]182Spec reviewer: ✅ Spec compliant now183184[Dispatch code quality reviewer]185Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)186187[Implementer fixes]188Implementer: Extracted PROGRESS_INTERVAL constant189190[Code reviewer reviews again]191Code reviewer: ✅ Approved192193[Mark Task 2 complete]194195...196197[After all tasks]198[Dispatch final code-reviewer]199Final reviewer: All requirements met, ready to merge200201Done!202```203204## Advantages205206**vs. Manual execution:**207- Subagents follow TDD naturally208- Fresh context per task (no confusion)209- Parallel-safe (subagents don't interfere)210- Subagent can ask questions (before AND during work)211212**vs. Executing Plans:**213- Same session (no handoff)214- Continuous progress (no waiting)215- Review checkpoints automatic216217**Efficiency gains:**218- No file reading overhead (controller provides full text)219- Controller curates exactly what context is needed220- Subagent gets complete information upfront221- Questions surfaced before work begins (not after)222223**Quality gates:**224- Self-review catches issues before handoff225- Two-stage review: spec compliance, then code quality226- Review loops ensure fixes actually work227- Spec compliance prevents over/under-building228- Code quality ensures implementation is well-built229230**Cost:**231- More subagent invocations (implementer + 2 reviewers per task)232- Controller does more prep work (extracting all tasks upfront)233- Review loops add iterations234- But catches issues early (cheaper than debugging later)235236## Red Flags237238**Never:**239- Start implementation on main/master branch without explicit user consent240- Skip reviews (spec compliance OR code quality)241- Proceed with unfixed issues242- Dispatch multiple implementation subagents in parallel (conflicts)243- Make subagent read plan file (provide full text instead)244- Skip scene-setting context (subagent needs to understand where task fits)245- Ignore subagent questions (answer before letting them proceed)246- Accept "close enough" on spec compliance (spec reviewer found issues = not done)247- Skip review loops (reviewer found issues = implementer fixes = review again)248- Let implementer self-review replace actual review (both are needed)249- **Start code quality review before spec compliance is ✅** (wrong order)250- Move to next task while either review has open issues251252**If subagent asks questions:**253- Answer clearly and completely254- Provide additional context if needed255- Don't rush them into implementation256257**If reviewer finds issues:**258- Implementer (same subagent) fixes them259- Reviewer reviews again260- Repeat until approved261- Don't skip the re-review262263**If subagent fails task:**264- Dispatch fix subagent with specific instructions265- Don't try to fix manually (context pollution)266267## Integration268269**Required workflow skills:**270- **superpowers:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)271- **superpowers:writing-plans** - Creates the plan this skill executes272- **superpowers:requesting-code-review** - Code review template for reviewer subagents273- **superpowers:finishing-a-development-branch** - Complete development after all tasks274275**Subagents should use:**276- **superpowers:test-driven-development** - Subagents follow TDD for each task277278**Alternative workflow:**279- **superpowers:executing-plans** - Use for parallel session instead of same-session execution280