subagent-driven-development
子智能体驱动开发
通过为每个任务派发新的子智能体来执行计划,每个任务后进行两阶段审查:先规格符合性审查,再代码质量审查。
核心原则: 每任务一个新子智能体 + 两阶段审查(先规格后质量)= 高质量、快速迭代
开始时宣布:「我正在使用 subagent-driven-development 技能按计划派发子智能体并执行两阶段审查。」
何时使用
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"];
}
与 Executing Plans(并行会话)相比:
- 同一会话(无上下文切换)
- 每任务一个新子智能体(无上下文污染)
- 每任务后两阶段审查:先规格符合性,再代码质量
- 更快迭代(任务间无人为介入)
流程
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
"Dispatch implementer subagent (./references/implementer-prompt.md)" [shape=box];
"Implementer subagent asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
"Dispatch spec reviewer subagent (./references/spec-reviewer-prompt.md)" [shape=box];
"Spec reviewer subagent confirms code matches spec?" [shape=diamond];
"Implementer subagent fixes spec gaps" [shape=box];
"Dispatch code quality reviewer subagent (./references/code-quality-reviewer-prompt.md)" [shape=box];
"Code quality reviewer subagent approves?" [shape=diamond];
"Implementer subagent fixes quality issues" [shape=box];
"Mark task complete in TodoWrite" [shape=box];
}
"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
"More tasks remain?" [shape=diamond];
"Dispatch final code reviewer subagent for entire implementation" [shape=box];
"Use superpowers:finishing-development" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./references/implementer-prompt.md)";
"Dispatch implementer subagent (./references/implementer-prompt.md)" -> "Implementer subagent asks questions?";
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer subagent (./references/implementer-prompt.md)";
"Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
"Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./references/spec-reviewer-prompt.md)";
"Dispatch spec reviewer subagent (./references/spec-reviewer-prompt.md)" -> "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" -> "Dispatch spec reviewer subagent (./references/spec-reviewer-prompt.md)" [label="re-review"];
"Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./references/code-quality-reviewer-prompt.md)" [label="yes"];
"Dispatch code quality reviewer subagent (./references/code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
"Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
"Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./references/code-quality-reviewer-prompt.md)" [label="re-review"];
"Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
"Mark task complete in TodoWrite" -> "More tasks remain?";
"More tasks remain?" -> "Dispatch implementer subagent (./references/implementer-prompt.md)" [label="yes"];
"More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
"Dispatch final code reviewer subagent for entire implementation" -> "Use finishing-development";
}
提示模板
references/implementer-prompt.md- 派发实施者子智能体references/spec-reviewer-prompt.md- 派发规格符合性审查者子智能体references/code-quality-reviewer-prompt.md- 派发代码质量审查者子智能体
优势
与手动执行相比:
- 子智能体自然遵循 TDD
- 每任务新上下文(无混淆)
- 并行安全(子智能体互不干扰)
- 子智能体可提问(工作前后及期间)
与 Executing Plans 相比:
- 同一会话(无交接)
- 连续进展(无等待)
- 自动审查检查点
效率提升:
- 无文件读取开销(控制器提供全文)
- 控制器只提供所需上下文
- 子智能体预先获得完整信息
- 工作开始前暴露问题(而非之后)
质量门槛:
- 自审在交接前发现问题
- 两阶段审查:规格符合性,再代码质量
- 审查循环确保修复有效
- 规格符合性防止过度/不足实现
- 代码质量确保实现良好
红旗
绝不:
- 未经用户明确同意在 main/master 分支上开始实施
- 跳过审查(规格符合性或代码质量)
- 带着未修复问题继续
- 并行派发多个实施子智能体(会冲突)
- 让子智能体读取计划文件(改为提供全文)
- 跳过背景设定(子智能体需理解任务所处位置)
- 忽视子智能体问题(在让其继续前回答)
- 在规格符合性上接受「差不多」(规格审查发现问题 = 未完成)
- 跳过审查循环(审查者发现问题 = 实施者修复 = 再次审查)
- 用实施者自审替代实际审查(二者都需要)
- 在规格符合性 ✅ 之前开始代码质量审查(顺序错误)
- 任一审查有未解决问题时进入下一任务
若子智能体提问:
- 清晰完整地回答
- 必要时提供额外上下文
- 不要催促其进入实施
若审查者发现问题:
- 实施者(同一子智能体)修复
- 审查者再次审查
- 重复直至通过
- 不要跳过再次审查
若子智能体任务失败:
- 派发修复子智能体并给出具体指令
- 不要手动修复(会导致上下文污染)
集成
必需工作流技能:
- spec-init - 必需:开始前设置隔离工作区
- spec-plan - 创建本技能所执行的计划
- requesting-code-review - 审查者子智能体的代码审查模板
- finishing-development - 所有任务完成后做开发收尾确认
子智能体应使用:
- test-driven-development - 子智能体对每任务遵循 TDD
替代工作流:
- spec-execute - 用于并行会话而非同会话执行
More from zixun-github/aisdlc
spec-product-prd
Use when 需要在 sdlc-dev 的产品需求 Spec 流程执行 R2,将 requirements/solution.md 转写为可交付、可验收、可测试的 requirements/prd.md,且需要避免猜路径、在缺少 solution.md 时仍继续生成、或用“待确认问题/Open Questions”替代验证清单。
126spec-product-prototype
Use when 需要在 sdlc-dev 的产品需求 Spec 流程执行 R3(原型生成),基于 requirements/prd.md 产出 requirements/prototype.md(任务流+页面结构+ASCII线框+AC映射+走查脚本),并避免缺少上下文/缺少 PRD 仍继续生成、用 Open Questions 代替验证清单、或用非 ASCII 方式导致原型不可追溯与不可评审。
121spec-product-demo
Use when 需要在 sdlc-dev 的产品需求 Spec 流程执行 R4(基于 requirements/prototype.md 生成可交互 Demo 工程),并需要避免跳过 spec-context、在缺少 prototype.md 或缺少可运行 Demo 工程根目录时仍继续、或自创页面/目录导致不可追溯与无法回流闭环。
109spec-receiving-code-review
Use 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
108using-aisdlc
Use when 需要在 sdlc-dev 仓库执行 AI SDLC(Spec Pack)流程、选择/串联需求侧(raw/solution/prd/prototype/demo)与实现侧(plan/execute/finishing)技能,并用门禁避免上下文漂移、写错目录或在压力下跳过关键步骤。
107spec-context
Use when 需要在 sdlc-dev 的 Spec 流程中定位当前 spec pack(FEATURE_DIR)、避免在错误目录读写 requirements/*.md,或出现"看错上下文/写错文件/分支不符合规范"的问题。
104