بنقرة واحدة
subagent-driven-development
Use when executing implementation plans with independent tasks in the current session
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when executing implementation plans with independent tasks in the current session
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions
Use when you have a spec or requirements for a multi-step task, before touching code
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
| name | subagent-driven-development |
| description | Use when executing implementation plans with independent tasks in the current session |
Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
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.
Core principle: Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
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.
digraph when_to_use {
"Have implementation plan?" [shape=diamond];
"Tasks mostly independent?" [shape=diamond];
"subagent-driven-development" [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?" -> "subagent-driven-development" [label="yes"];
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
}
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
"invoke_subagent TypeName: implementer" [shape=box];
"Implementer subagent asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
"invoke_subagent TypeName: spec-reviewer" [shape=box];
"Spec reviewer subagent confirms code matches spec?" [shape=diamond];
"Implementer subagent fixes spec gaps" [shape=box];
"invoke_subagent TypeName: code-reviewer" [shape=box];
"Code quality reviewer subagent approves?" [shape=diamond];
"Implementer subagent fixes quality issues" [shape=box];
"Update task.md artifact" [shape=box];
}
"Read plan, extract all tasks, define subagent types, create task.md artifact" [shape=box];
"More tasks remain?" [shape=diamond];
"Dispatch final code reviewer subagent for entire implementation" [shape=box];
"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks, define subagent types, create task.md artifact" -> "invoke_subagent TypeName: implementer";
"invoke_subagent TypeName: implementer" -> "Implementer subagent asks questions?";
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "invoke_subagent TypeName: implementer";
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
"Implementer subagent implements, tests, commits, self-reviews" -> "invoke_subagent TypeName: spec-reviewer";
"invoke_subagent TypeName: spec-reviewer" -> "Spec reviewer subagent confirms code matches spec?";
"Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
"Implementer subagent fixes spec gaps" -> "invoke_subagent TypeName: spec-reviewer" [label="re-review"];
"Spec reviewer subagent confirms code matches spec?" -> "invoke_subagent TypeName: code-reviewer" [label="yes"];
"invoke_subagent TypeName: code-reviewer" -> "Code quality reviewer subagent approves?";
"Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
"Implementer subagent fixes quality issues" -> "invoke_subagent TypeName: code-reviewer" [label="re-review"];
"Code quality reviewer subagent approves?" -> "Update task.md artifact" [label="yes"];
"Update task.md artifact" -> "More tasks remain?";
"More tasks remain?" -> "invoke_subagent TypeName: implementer" [label="yes"];
"More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
"Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
}
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.
At the start of plan execution, before dispatching any tasks, locate the absolute paths of the subagent-driven-development and requesting-code-review skill directories from the <skills> section of your prompt. Then, define all three subagent types:
define_subagent with name "implementer" — read implementer-prompt.md from the subagent-driven-development directory.define_subagent with name "spec-reviewer" — read spec-reviewer-prompt.md from the subagent-driven-development directory.define_subagent with name "code-reviewer" — read code-reviewer.md from the requesting-code-review directory.This pays the prompt cost once. Every subsequent invoke_subagent with these types reuses the cached definition.
Workspace isolation per role:
| Role | Workspace Mode | Why |
|---|---|---|
| Implementer | Workspace: "branch" | Needs isolated write access |
| Spec reviewer | Workspace: "inherit" | Read-only — only inspects code |
| Code reviewer | Workspace: "inherit" | Read-only — only inspects code |
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, 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.
Per-task reviews are task-scoped gates. The broad review happens once, at the final whole-branch review. When you fill a reviewer template:
When implementers run long-running operations (builds, test suites, deployments), use manage_task instead of blocking:
For operations expected to take >30 seconds:
run_command with a short WaitMsBeforeAsync (e.g., 500ms) to background itmanage_task with status to check on completion when notifiedmanage_task with kill to terminate stuck processesWhen to background vs. wait:
digraph background_decision {
"Operation expected >30s?" [shape=diamond];
"Background with manage_task" [shape=box];
"Wait synchronously" [shape=box];
"Operation expected >30s?" -> "Background with manage_task" [label="yes"];
"Operation expected >30s?" -> "Wait synchronously" [label="no"];
}
Use send_message to communicate with running subagents:
Answering questions mid-flight:
send_message with the implementer's conversation IDProviding additional context:
send_message to send itWhen to use send_message vs. re-dispatch:
send_messageUse schedule as a safety net for complex tasks:
digraph timeout {
"Dispatch implementer" [shape=box];
"Set one-shot timer" [shape=box];
"Timer fires?" [shape=diamond];
"Check subagent status" [shape=box];
"Subagent completes normally" [shape=box];
"Timer cancelled automatically" [shape=box];
"Dispatch implementer" -> "Set one-shot timer";
"Set one-shot timer" -> "Timer fires?" [label="wait"];
"Timer fires?" -> "Check subagent status" [label="yes - no response yet"];
"Timer fires?" -> "Subagent completes normally" [label="no - response received"];
"Subagent completes normally" -> "Timer cancelled automatically";
}
For test suites expected to take 5+ minutes, use a recurring schedule instead of a one-shot timer:
schedule(CronExpression: "*/2 * * * *", MaxIterations: "5", Prompt: "Check implementer status for Task N")
Use manage_subagents to track running subagents:
Action: "list" — check which subagents are still running before dispatching the next taskAction: "kill" — terminate stuck subagents that haven't responded after timeoutDon't poll in a loop — the system notifies you when subagents complete. Use manage_subagents only when you need an explicit status check (e.g., before cleanup or when a timer fires).
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.
.superpowers/sdd/progress.md
from the repository root. 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).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.implementer-prompt.md (located in the subagent-driven-development skill directory) — define_subagent definition (static system prompt + dynamic prompt template)spec-reviewer-prompt.md (located in the subagent-driven-development skill directory) — define_subagent definition (static system prompt + dynamic prompt template)code-quality-reviewer-prompt.md (located in the subagent-driven-development skill directory) — Delegates to code-reviewer type with extra review criteriacode-reviewer.md (located in the requesting-code-review skill directory) — define_subagent definition (static system prompt + dynamic prompt template)You: 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]
[define_subagent "implementer" — static system prompt from implementer-prompt.md]
[define_subagent "spec-reviewer" — static system prompt from spec-reviewer-prompt.md]
[define_subagent "code-reviewer" — static system prompt from code-reviewer.md]
[Create task.md artifact with all tasks]
Task 1: Hook installation script
[Get Task 1 text and context (already extracted)]
[invoke_subagent TypeName: "implementer" with task text + context in Prompt]
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
[invoke_subagent TypeName: "spec-reviewer"]
Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
[invoke_subagent TypeName: "code-reviewer"]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Update task.md: mark Task 1 complete]
Task 2: Recovery modes
[Get Task 2 text and context (already extracted)]
[invoke_subagent TypeName: "implementer" with task text + context in Prompt]
Implementer: [No questions, proceeds]
Implementer:
- Added verify/repair modes
- 8/8 tests passing
- Self-review: All good
- Committed
[invoke_subagent TypeName: "spec-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
[invoke_subagent TypeName: "code-reviewer"]
Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
[Implementer fixes]
Implementer: Extracted PROGRESS_INTERVAL constant
[Code reviewer reviews again]
Code reviewer: ✅ Approved
[Update task.md: mark Task 2 complete]
...
[After all tasks]
[Dispatch final code-reviewer]
Final reviewer: All requirements met, ready to merge
Done!
vs. Manual execution:
Efficiency gains:
Quality gates:
Cost:
Never:
If subagent asks questions:
If reviewer finds issues:
If subagent fails task:
Required workflow skills:
Subagents should use: