/superpowers:subagent-driven-developmentfrom superpowers
Use when executing implementation plans with independent tasks in the current session
Ships in superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Execute the plan by dispatching a fresh subagent per role per task: a tester writes failing e2e/integration tests, an implementer makes them GREEN plus its own unit tests, a task review (spec compliance + code quality) and a tester GREEN-verification gate each task, a broad whole-branch review at the end, and a demo gate (present + review) before the branch ships.
Why subagents: You delegate to specialized agents with isolated context. By precisely crafting their instructions and context, you keep them focused and successful. They never inherit your session's context or history — you construct exactly what each one needs. This also preserves your own context for coordination work.
Core principle: Fresh subagent per role per task + adversarial tester (independent RED tests, GREEN re-verified) + task review (spec + quality) + broad final review + demo gate = high quality that structurally cannot be faked. Nobody grades their own work: the implementer does not author the e2e tests, and the demo reviewer never sees the code.
Narration: between tool calls, narrate at most one short line — the ledger and the tool results carry the record.
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: a BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, a demo/spec gate that needs a human decision, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
digraph when_to_use {
"Have implementation plan?" [shape=diamond];
"Tasks mostly independent?" [shape=diamond];
"Stay in this session?" [shape=diamond];
"subagent-driven-development" [shape=box];
"executing-plans" [shape=box];
"Manual execution or brainstorm first" [shape=box];
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}
vs. Executing Plans (parallel session):
Each role is a fresh subagent dispatched with exactly the context it needs — no persistent team, no shared history. The implementer and every reviewer are separate agents so no one grades their own work.
| Role | subagent_type | Purpose | Prompt |
|---|---|---|---|
| implementer | general-purpose | Makes the tester's e2e tests GREEN, writes unit tests, commits, self-reviews | implementer-prompt.md |
| tester | general-purpose | Writes adversarial e2e/integration RED tests before impl; re-verifies GREEN is genuine | tester-prompt.md |
| task reviewer | general-purpose | One task's spec compliance + code quality from the diff | task-reviewer-prompt.md |
| demo presenter | general-purpose | Demos the finished feature manually as a real user; no mocks/shims | demo-presenter-prompt.md |
| demo reviewer | general-purpose | Judges the demo as a strict client CEO; spec + demo artifacts only, no code | demo-reviewer-prompt.md |
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
"Run task-brief; dispatch tester (write failing e2e tests)" [shape=box];
"Tester RED confirmed?" [shape=diamond];
"Dispatch implementer (make GREEN + unit tests)" [shape=box];
"Implementer asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer implements, tests, commits, self-reviews" [shape=box];
"Write diff; dispatch task reviewer + tester GREEN-verify (both on frozen diff)" [shape=box];
"Both approve (spec + quality + tests genuine)?" [shape=diamond];
"Dispatch fix subagent for consolidated Critical/Important + weak/new-RED findings" [shape=box];
"Mark task complete in todo list and progress ledger" [shape=box];
}
"Read plan, note context and global constraints, create todos" [shape=box];
"More tasks remain?" [shape=diamond];
"Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" [shape=box];
subgraph cluster_demo_gate {
label="Demo Gate";
"Dispatch demo presenter (manual, no mocks/shims)" [shape=box];
"Demoable + data via real user flows?" [shape=diamond];
"Resolve: implementer shim or escalate to user" [shape=box];
"Dispatch demo reviewer (spec + artifacts, no code)" [shape=box];
"Demo approved?" [shape=diamond];
"Route failure: re-demo / back to implementer / escalate spec" [shape=box];
}
"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, note context and global constraints, create todos" -> "Run task-brief; dispatch tester (write failing e2e tests)";
"Run task-brief; dispatch tester (write failing e2e tests)" -> "Tester RED confirmed?";
"Tester RED confirmed?" -> "Run task-brief; dispatch tester (write failing e2e tests)" [label="no / no real trigger — resolve"];
"Tester RED confirmed?" -> "Dispatch implementer (make GREEN + unit tests)" [label="yes"];
"Dispatch implementer (make GREEN + unit tests)" -> "Implementer asks questions?";
"Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer (make GREEN + unit tests)";
"Implementer asks questions?" -> "Implementer implements, tests, commits, self-reviews" [label="no"];
"Implementer implements, tests, commits, self-reviews" -> "Write diff; dispatch task reviewer + tester GREEN-verify (both on frozen diff)";
"Write diff; dispatch task reviewer + tester GREEN-verify (both on frozen diff)" -> "Both approve (spec + quality + tests genuine)?";
"Both approve (spec + quality + tests genuine)?" -> "Dispatch fix subagent for consolidated Critical/Important + weak/new-RED findings" [label="no"];
"Dispatch fix subagent for consolidated Critical/Important + weak/new-RED findings" -> "Write diff; dispatch task reviewer + tester GREEN-verify (both on frozen diff)" [label="re-review (any change invalidates both)"];
"Both approve (spec + quality + tests genuine)?" -> "Mark task complete in todo list and progress ledger" [label="yes"];
"Mark task complete in todo list and progress ledger" -> "More tasks remain?";
"More tasks remain?" -> "Run task-brief; dispatch tester (write failing e2e tests)" [label="yes"];
"More tasks remain?" -> "Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" [label="no"];
"Dispatch final code reviewer (../requesting-code-review/code-reviewer.md)" -> "Dispatch demo presenter (manual, no mocks/shims)";
"Dispatch demo presenter (manual, no mocks/shims)" -> "Demoable + data via real user flows?";
"Demoable + data via real user flows?" -> "Resolve: implementer shim or escalate to user" [label="no"];
"Resolve: implementer shim or escalate to user" -> "Dispatch demo presenter (manual, no mocks/shims)" [label="after resolution"];
"Demoable + data via real user flows?" -> "Dispatch demo reviewer (spec + artifacts, no code)" [label="yes"];
"Dispatch demo reviewer (spec + artifacts, no code)" -> "Demo approved?";
"Demo approved?" -> "Route failure: re-demo / back to implementer / escalate spec" [label="no"];
"Route failure: re-demo / back to implementer / escalate spec" -> "Dispatch demo presenter (manual, no mocks/shims)" [label="demo problem"];
"Route failure: re-demo / back to implementer / escalate spec" -> "Run task-brief; dispatch tester (write failing e2e tests)" [label="impl / no-trigger problem"];
"Demo approved?" -> "Use superpowers:finishing-a-development-branch" [label="yes"];
}
Before dispatching Task 1, scan the plan once for conflicts:
Present everything you find to your human partner as one batched question — each finding beside the plan text that mandates it, asking which governs — before execution begins, not one interrupt per discovery mid-plan. If the scan is clean, proceed without comment. The review loop remains the net for conflicts that only emerge from implementation.
Record the current HEAD as this task's BASE before dispatching anything. The task moves through four dispatches; every artifact is a file, never pasted prose (see File Handoffs).
scripts/task-brief PLAN N, then
dispatch the tester (tester-prompt.md, Mode 1) with the
brief and the global constraints. It writes e2e/integration tests grounded
only in the spec and public APIs, confirms RED, commits them, and reports
the test paths. If the tester can only trigger the behavior through a
test-only backdoor — a forced-state flag, a window.* hook — that is a
likely missing production trigger: resolve it before implementing, do not
let it paper over the gap.scripts/review-package BASE HEAD, then dispatch both — they operate on the
same frozen diff, so run them together (the tester may add new failing tests;
the task reviewer is read-only):
Safety valve: cap at 3 full review cycles per task. If after 3 either gate is still unsatisfied, escalate to your human partner.
Use the least powerful model that can handle each role to conserve cost and increase speed.
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.
Integration and judgment tasks (multi-file coordination, pattern matching, debugging): use a standard model.
Architecture and design tasks: use the most capable available model. The final whole-branch review is one of these — dispatch it on the most capable available model, not the session default.
Review, tester, and demo tasks: choose the model with the same judgment, scaled to the diff's size, complexity, and risk. A small mechanical diff does not need the most capable model; a subtle concurrency change does. Adversarial test authoring and demo judgment are judgment work — use a mid-tier model as the floor, never the cheapest tier.
Always specify the model explicitly when dispatching a subagent. An omitted model inherits your session's model — often the most capable and most expensive — which silently defeats this section.
Turn count beats token price. Wall-clock and context cost scale with how many turns a subagent takes, and the cheapest models routinely take 2-3× the turns on multi-step work — costing more overall. Use a mid-tier model as the floor for reviewers and for implementers working from prose descriptions. When the task's plan text contains the complete code to write, the implementation is transcription plus testing: use the cheapest tier for that implementer. Single-file mechanical fixes also take the cheapest tier.
Task complexity signals (implementation tasks):
Implementer subagents report one of four statuses. Handle each appropriately:
DONE: Generate the review package (scripts/review-package BASE HEAD, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never HEAD~1, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer and the tester GREEN-verify with the printed path.
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. A reported spec bug is a concern — decide whether to escalate to your human partner or authorize a spec patch before continuing.
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:
Never ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
The task reviewer may report "⚠️ Cannot verify from diff" items — requirements that live in unchanged code or span tasks. These do not block the rest of the review, but you must resolve each one yourself before marking the task complete: you hold the plan and cross-task context the reviewer lacks. If you confirm an item is a real gap, treat it as a failed spec review — send it back to the implementer and re-review.
Per-task reviews are task-scoped gates. The broad review happens once, at the final whole-branch review. When you fill a reviewer template:
scripts/review-package BASE HEAD and pass the reviewer the file path
it prints (or, without bash: git log --oneline, git diff --stat,
and git diff -U10 for the range, redirected to one uniquely named
file). The output never enters your own context, and the reviewer sees
the commit list, stat summary, and full diff with context in one Read
call. Use the BASE you recorded before dispatching the implementer —
never HEAD~1, which silently truncates multi-commit tasks.scripts/review-package MERGE_BASE HEAD (MERGE_BASE = the commit the
branch started from, e.g. git merge-base main HEAD) and include the
printed path in the final review dispatch, so the final reviewer reads
one file instead of re-deriving the branch diff with git commands.After the final whole-branch review is clean, the feature passes one last gate that no test suite can fake: a human-style demo. It is the backstop that catches a feature the tests only reached through a backdoor.
spec/demo/…, commits them, and reports.DEMO_DATA_BLOCKED (cannot create data through user flows),
UNDEMOABLE (no user-facing surface), or NEEDS_DEMO_PLAN, you decide: have
the implementer build a testing shim (a lightweight temporary feature kept
until the real one lands), pull UI forward, record a demo plan into the spec,
or escalate to your human partner. Then re-dispatch the presenter.Only after the demo reviewer approves do you run
superpowers:finishing-a-development-branch.
Everything you paste into a dispatch prompt — and everything a subagent prints back — stays resident in your context for the rest of the session and is re-read on every later turn. Hand artifacts over as files:
scripts/task-brief PLAN_FILE N — it extracts the task's full text
to a uniquely named file and prints the path. Both the tester and the
implementer read the same brief; it is the single source of requirements.
Your dispatch should contain: (1) one line on where this task fits in the
project; (2) the brief path, introduced as "read this first — it is your
requirements, with the exact values to use verbatim"; (3) interfaces and
decisions from earlier tasks that the brief cannot know; (4) your resolution
of any ambiguity you noticed in the brief; (5) the report-file path and
report contract. Exact values (numbers, magic strings, signatures, test
cases) appear only in the brief.…/task-N-brief.md → implementer report …/task-N-report.md, tester report
…/task-N-tester-report.md, GREEN-verify …/task-N-verify.md). The subagent
writes the full report there and returns only status, commits/paths, a
one-line summary, and concerns.Conversation memory does not survive compaction. In real sessions, controllers that lost their place have re-dispatched entire completed task sequences — the single most expensive failure observed. Track progress in a ledger file, not only in todos.
cat "$(git rev-parse --show-toplevel)/.superpowers/sdd/progress.md". Tasks listed there
as complete are DONE — do not re-dispatch them; resume at the first task
not marked complete.Task N: complete (commits <base7>..<head7>, review clean, GREEN verified).git log over your own recollection.git clean -fdx will destroy the ledger (it's git-ignored scratch); if
that happens, recover from git log.You: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/superpowers/plans/feature-plan.md]
[Create todos for all tasks]
Task 1: User registration form
[Record BASE = HEAD]
[Run task-brief for Task 1]
[Dispatch tester (Mode 1) with brief + global constraints]
Tester: DONE (RED). tests/e2e/test_registration.py — happy path, duplicate
email, weak password, empty fields. 4/4 FAIL. Committed. report path: …
[Dispatch implementer with brief + tester's test paths + context]
Implementer: DONE. Registration form + validation + persistence. Tester's 4
e2e GREEN, 6 unit tests GREEN, output pristine. Committed. report path: …
[Run review-package BASE HEAD]
[Dispatch task reviewer + tester GREEN-verify together on the diff]
Task reviewer: Spec compliant. Quality: Important — password validation
duplicated in frontend and backend; extract shared validation. Else Approved.
Tester (verify): assertions intact, but implementer passed first try, so added
test_registration_sql_injection + test_registration_xss_in_name. Both FAIL
(NEW_RED).
[Dispatch ONE fix subagent: extract shared validation + make SQLi/XSS tests GREEN]
Fixer: Extracted validation module, added input sanitization. All 8 e2e + 6
unit GREEN. Committed.
[Regenerate review-package; re-dispatch both]
Task reviewer: Spec compliant. Quality approved — duplication resolved.
Tester (verify): GREEN_VERIFIED. Assertions intact, adversarial cases covered.
[Mark Task 1 complete in ledger]
Task 2: Login flow [similar cycle]
Task 3: Password reset [similar cycle]
[After all tasks — final whole-branch review]
[Run review-package MERGE_BASE HEAD; dispatch final code-reviewer, most capable model]
Final reviewer: Consistent patterns, good coverage, ready to merge.
[Demo gate]
[Dispatch demo presenter with spec + ledger]
Demo presenter: DONE. Devised demo plan (register → logout → login → reset →
login with new password → duplicate-email error). Drove it via Playwright as
a real user, screenshots in spec/demo/auth-system/. Committed. Observation:
reset email link takes ~3s to appear.
[Dispatch demo reviewer with spec + artifacts dir (no code)]
Demo reviewer: REJECTED. Password-reset demo clicks the link but never shows
the 'set new password' form the spec requires; no login error cases shown.
Root cause: demo problem (incomplete walkthrough).
[Re-dispatch demo presenter: show full reset form + login error cases]
Demo presenter: DONE. Updated artifacts.
[Re-dispatch demo reviewer with updated artifacts]
Demo reviewer: APPROVED. All requirements demonstrated.
[Use superpowers:finishing-a-development-branch]
Done!
vs. Manual execution:
vs. Executing Plans:
Efficiency gains:
Quality gates:
Cost:
Never:
scripts/task-brief — instead)connected:true, a window.* hook) instead of a real user action or real adapter event — the backdoor is itself evidence the production trigger may be missingscripts/review-package BASE HEAD) and name the printed path in the promptgit log) after any compaction or resumeIf subagent asks questions:
If a reviewer or the tester finds issues:
If subagent fails task:
If the demo reviewer rejects:
Required workflow skills:
Subagents should use:
Alternative workflow:
demo-presenter-prompt.md (opens in a new tab)demo-reviewer-prompt.md (opens in a new tab)implementer-prompt.md (opens in a new tab)scripts/review-package (opens in a new tab)scripts/sdd-workspace (opens in a new tab)scripts/task-brief (opens in a new tab)task-reviewer-prompt.md (opens in a new tab)tester-prompt.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub pedropaulovc/agent-plugins --plugin superpowers14 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/executing-plansUse when you have a written implementation plan to execute in a separate session with review checkpoints/finishing-a-development-branchUse when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup/receiving-code-reviewUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation/requesting-code-reviewUse when completing tasks, implementing major features, or before merging to verify work meets requirements