一键导入
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 职业分类
| name | subagent-driven-development |
| description | Use when executing implementation plans with independent tasks in the current session |
Execute plan by dispatching a fresh delegate per task, with two-stage review after each: spec compliance review first, then code quality review.
Why delegates: 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 delegate per task + two-stage review (spec then quality) = high quality, fast iteration
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];
"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";
"Dispatch implementer delegate" [shape=box];
"Implementer asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer implements, tests, self-reviews" [shape=box];
"Dispatch spec reviewer delegate" [shape=box];
"Spec reviewer confirms code matches spec?" [shape=diamond];
"Implementer fixes spec gaps" [shape=box];
"Dispatch code quality reviewer delegate" [shape=box];
"Code quality reviewer approves?" [shape=diamond];
"Implementer fixes quality issues" [shape=box];
"Mark task complete" [shape=box];
}
"Read plan, extract all tasks with full text, note context" [shape=box];
"More tasks remain?" [shape=diamond];
"Dispatch final code reviewer delegate for entire implementation" [shape=box];
"Implementation complete" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks with full text, note context" -> "Dispatch implementer delegate";
"Dispatch implementer delegate" -> "Implementer asks questions?";
"Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer delegate";
"Implementer asks questions?" -> "Implementer implements, tests, self-reviews" [label="no"];
"Implementer implements, tests, self-reviews" -> "Dispatch spec reviewer delegate";
"Dispatch spec reviewer delegate" -> "Spec reviewer confirms code matches spec?";
"Spec reviewer confirms code matches spec?" -> "Implementer fixes spec gaps" [label="no"];
"Implementer fixes spec gaps" -> "Dispatch spec reviewer delegate" [label="re-review"];
"Spec reviewer confirms code matches spec?" -> "Dispatch code quality reviewer delegate" [label="yes"];
"Dispatch code quality reviewer delegate" -> "Code quality reviewer approves?";
"Code quality reviewer approves?" -> "Implementer fixes quality issues" [label="no"];
"Implementer fixes quality issues" -> "Dispatch code quality reviewer delegate" [label="re-review"];
"Code quality reviewer approves?" -> "Mark task complete" [label="yes"];
"Mark task complete" -> "More tasks remain?";
"More tasks remain?" -> "Dispatch implementer delegate" [label="yes"];
"More tasks remain?" -> "Dispatch final code reviewer delegate for entire implementation" [label="no"];
"Dispatch final code reviewer delegate for entire implementation" -> "Implementation complete";
}
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 delegates 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.
You: I'm using Delegate-Driven Development to execute this plan.
[Read plan file once: docs/specs/<feature>/plan.md]
[Extract all 5 tasks with full text and context]
Task 1: Hook installation script
[Dispatch implementer delegate with full task text + context]
Implementer: "Before I begin - should the hook be installed at user or system level?"
You: "User level (~/.config/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
- Reported DONE
[Dispatch spec compliance reviewer delegate]
Spec reviewer: Spec compliant - all requirements met, nothing extra
[Get git SHAs, dispatch code quality reviewer delegate]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Mark Task 1 complete]
Task 2: Recovery modes
[Dispatch implementer delegate with full task text + context]
Implementer: [No questions, proceeds]
Implementer:
- Added verify/repair modes
- 8/8 tests passing
- Self-review: All good
- Reported DONE
[Dispatch spec compliance reviewer delegate]
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 delegate]
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 devops-reviewer delegate]
Final reviewer: All requirements met, ready to merge
Done!
vs. Manual execution:
Efficiency gains:
Quality gates:
Cost:
Never:
If delegate asks questions:
If reviewer finds issues:
If delegate fails task:
Before dispatching each task, enrich the task description with context accumulated from earlier tasks:
The goal: a subagent reading only the enriched task description should be able to execute it mechanically.
After each task completes (reaches "Mark task complete"):
- [ ] → - [x] for the completed taskActual: note to the task entry explaining what actually happenedThe plan file is the single source of truth for "what happened." Someone reading it after implementation should understand both the intent and the reality.
Audits agents, prompts, skills, knowledge, and documentation for gaps, inconsistencies, and improvement opportunities. Proposes changes for user approval. Triggers on "agent-audit", "audit agents", "review config", "what can we improve".
Use before any creative work or spec creation. Explores intent, challenges assumptions, and produces specs. Triggers on "brainstorm", "let's design", "spec out", "define requirements", "write a spec", "challenge this", "poke holes", "what am I missing".
Detects documentation drift after structural changes. Dispatches parallel specialist reviewers and auto-fixes. Triggers on "check my docs", "audit docs", "doc drift", "check doc drift", or auto from post-implementation when tracked categories change.
Automated post-implementation workflow. Triggers when the orchestrator receives DONE from an implementation subagent. Runs quality gate, doc staleness check, auto-review, and improvement capture.
Periodic codebase health check. Use when the user says "health check", "technical debt", "what needs attention", "codebase audit", "codebase health".
Takes a spec phase and generates an execution plan with parallel stages, agent routing, review gates, and verification criteria. Use before dispatching implementation work. Triggers on "plan execution", "generate execution plan", "how should we execute this", or internally when the orchestrator is about to implement a spec phase.