From superpowers
Use when executing implementation plans with a task DAG. Default flow dispatches one backgrounded subagent per ready task into its own git worktree (parallel-by-default). Falls back to sequential for plans without `depends_on`.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers:subagent-driven-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute a plan by dispatching one backgrounded subagent per ready task into its own git worktree, with full per-task review pipeline (implementer → spec review → code-quality review) running autonomously inside each worktree. Controller merges results as they arrive.
Execute a plan by dispatching one backgrounded subagent per ready task into its own git worktree, with full per-task review pipeline (implementer → spec review → code-quality review) running autonomously inside each worktree. Controller merges results as they arrive.
Why parallel-by-default: plans expose their structure as a DAG via depends_on. The controller computes the ready set each round and dispatches every parallel-safe ready task concurrently. Sequential is the fallback for chain DAGs and parallel_safe: false tasks, not the default.
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 never inherit your session's context — you construct exactly what they need. This preserves your own context for coordination.
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.
Default execution path for any plan with task depends_on metadata. For plans without depends_on declared on any task, see the Sequential Mode subsection below.
digraph parallel_process {
rankdir=TB;
"Read plan, build DAG, create TodoWrite" [shape=box];
"More tasks pending?" [shape=diamond];
"Compute ready set" [shape=box];
"Ready set has 1 task or only sequential tasks?" [shape=diamond];
"Dispatch foreground (no worktree)" [shape=box];
"Dispatch all parallel_safe ready tasks (background + worktree)" [shape=box];
"Wait for next agent completion (notification)" [shape=box];
"Merge result" [shape=box];
"Merge clean?" [shape=diamond];
"Run tests" [shape=box];
"Tests pass?" [shape=diamond];
"Push branch, open draft PR, mark BLOCKED-on-human" [shape=box];
"Dispatch fix subagent in fresh worktree" [shape=box];
"Mark DONE in TodoWrite" [shape=box];
"Dispatch final code-quality reviewer on merged branch" [shape=box];
"superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, build DAG, create TodoWrite" -> "More tasks pending?";
"More tasks pending?" -> "Compute ready set" [label="yes"];
"Compute ready set" -> "Ready set has 1 task or only sequential tasks?";
"Ready set has 1 task or only sequential tasks?" -> "Dispatch foreground (no worktree)" [label="yes"];
"Ready set has 1 task or only sequential tasks?" -> "Dispatch all parallel_safe ready tasks (background + worktree)" [label="no"];
"Dispatch foreground (no worktree)" -> "Merge result";
"Dispatch all parallel_safe ready tasks (background + worktree)" -> "Wait for next agent completion (notification)";
"Wait for next agent completion (notification)" -> "Merge result";
"Merge result" -> "Merge clean?";
"Merge clean?" -> "Run tests" [label="yes"];
"Merge clean?" -> "Push branch, open draft PR, mark BLOCKED-on-human" [label="no"];
"Run tests" -> "Tests pass?";
"Tests pass?" -> "Mark DONE in TodoWrite" [label="yes"];
"Tests pass?" -> "Dispatch fix subagent in fresh worktree" [label="no"];
"Dispatch fix subagent in fresh worktree" -> "Wait for next agent completion (notification)";
"Push branch, open draft PR, mark BLOCKED-on-human" -> "More tasks pending?";
"Mark DONE in TodoWrite" -> "More tasks pending?";
"More tasks pending?" -> "Dispatch final code-quality reviewer on merged branch" [label="no"];
"Dispatch final code-quality reviewer on merged branch" -> "superpowers:finishing-a-development-branch";
}
build DAG from plan
done = {}
blocked = {}
in_flight = {}
while (done | blocked | in_flight) != all_tasks:
ready = {t for t in tasks
if t not in done and t not in blocked and t not in in_flight
and all(d in done for d in t.depends_on)}
parallel_batch = [t for t in ready if t.parallel_safe]
sequential = [t for t in ready if not t.parallel_safe]
for t in parallel_batch:
Agent(isolation="worktree", run_in_background=true,
prompt=per_task_pipeline_prompt(t))
in_flight.add(t)
for t in sequential:
Agent(prompt=per_task_pipeline_prompt(t)) # foreground
merge_result(t) # see merge step
on each background completion:
merge_result(t) # may mark DONE or BLOCKED
in_flight.remove(t)
dispatch final code-quality reviewer on merged branch
hand off to superpowers:finishing-a-development-branch
The dispatch + merge mechanics live in superpowers:dispatching-parallel-agents. Read that skill for the worktree, background, and conflict-PR details. Do not duplicate them here.
The implementer prompt instructs the worktree subagent to run the full review pipeline itself before returning:
The controller never sees per-task review status — only the final pipeline status. Reviewer subagents are explicitly forbidden from escalating to the human (see reviewer prompts).
When the plan declares no depends_on on any task, run the original sequential flow: one task at a time, foreground, with per-task spec review and code-quality review surfaced to the controller. Use this for plans written before the DAG format existed and for any plan whose author chose pure sequential.
Backgrounded subagents cannot answer interactive permission prompts. If a dispatched subagent needs a tool not in the allowlist, it returns BLOCKED on permissions.
When this happens (or you anticipate it before dispatch), invoke the update-config skill to add the missing permission to .claude/settings.local.json. Always ask the human before adding any permission.
Allowlist scope is restricted by policy:
Edit, Write, Read, Bash(git *), Bash(gh *), narrow path-scoped variants like Edit(skills/**)Bash(python *), Bash(node *), Bash(npm *), Bash(*), or any rule that lets a subagent run arbitrary user code without reviewIf a task genuinely needs forbidden permissions, reschedule it to non-parallel sequential execution.
parallel_safe: false — degrades gracefully to foreground sequentialUse 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, design, and review tasks: use the most capable available model.
Task complexity signals:
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:
Never ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
./implementer-prompt.md - Dispatch implementer subagent./spec-reviewer-prompt.md - Dispatch spec compliance reviewer subagent./code-quality-reviewer-prompt.md - Dispatch code quality reviewer subagentYou: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/superpowers/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/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
[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
[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
[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
[Spec reviewer reviews again]
Spec reviewer: ✅ Spec compliant now
[Dispatch code quality reviewer]
Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
[Implementer fixes]
Implementer: Extracted PROGRESS_INTERVAL constant
[Code reviewer reviews again]
Code reviewer: ✅ Approved
[Mark Task 2 complete]
...
[After all tasks]
[Dispatch final code-reviewer]
Final reviewer: All requirements met, ready to merge
Done!
vs. Manual execution:
vs. Executing Plans:
Efficiency gains:
Quality gates:
Cost:
Never:
parallel_safe: false without justifying why in the plan's Parallelism analysisIf subagent asks questions:
If reviewer finds issues:
If subagent fails task:
Required workflow skills:
Subagents should use:
Alternative workflow:
npx claudepluginhub ryanpeach/skills --plugin superpowersGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.