subagent-driven-development について
実装計画の各タスクを新しいサブエージェントに割り当て、仕様適合性とコード品質の二段階レビューを経て進めるスキルです。同一セッション内で、主に独立したタスクに取り組むコーディングエージェント向けです。
主な機能
- 01タスクごとに新しいサブエージェント
- 02仕様と品質の二段階レビュー
- 03修正と再レビュー後に続行
- 04コントローラーによるタスク文脈の準備
- 05競合を避ける逐次実装
活用シーン
- 01複数タスクの開発計画の実行
- 02タスクの仕様適合性の確認
- 03次のタスクに進む前のコード品質レビュー
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ makerjackie/ jackie-skills-starter --skill subagent-driven-developmentインストール後、Claude Code で/subagent-driven-developmentを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
code-quality-reviewer-prompt.mdimplementer-prompt.mdspec-reviewer-prompt.md詳細
(中国語)サブエージェント駆動開発
タスクごとに新しいサブエージェントを割り当てて計画を実行し、各タスクの後に仕様適合性レビュー、続いてコード品質レビューの2段階レビューを行います。
基本原則: タスクごとに新しいサブエージェントを割り当て、仕様レビュー、次に品質レビューの2段階レビューを行うことで、高品質かつ迅速に反復できます。
使用する場面
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"];
}
「計画の実行」(並列セッション)との比較:
- 同じセッション内で実行できます(コンテキストの切り替えがありません)
- タスクごとに新しいサブエージェントを使用します(コンテキストが汚染されません)
- 各タスクの後に2段階レビューを行います。最初に仕様適合性、次にコード品質を確認します
- タスク間に人間が介入しないため、反復が速くなります
プロセス
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
"Dispatch implementer subagent (./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 (./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 (./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-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
"Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
"Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer subagent (./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 (./spec-reviewer-prompt.md)";
"Dispatch spec reviewer subagent (./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 (./spec-reviewer-prompt.md)" [label="re-review"];
"Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
"Dispatch code quality reviewer subagent (./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 (./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 (./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 superpowers:finishing-a-development-branch";
}
プロンプトテンプレート
./implementer-prompt.md- 実装サブエージェントを割り当てます./spec-reviewer-prompt.md- 仕様適合性レビュアーのサブエージェントを割り当てます./code-quality-reviewer-prompt.md- コード品質レビュアーのサブエージェントを割り当てます
ワークフローの例
You: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/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!
メリット
手動実行との比較:
- サブエージェントは自然にTDDに従います
- タスクごとに新しいコンテキストを使用します(混乱がありません)
- 並列実行に安全です(サブエージェント同士が干渉しません)
- サブエージェントは作業の前でも途中でも質問できます
「計画の実行」との比較:
- 同じセッション内で実行できます(引き継ぎがありません)
- 継続的に進捗します(待ち時間がありません)
- レビューチェックポイントが自動的に設けられます
効率の向上:
- ファイルを読むオーバーヘッドがありません(コントローラーが全文を提供します)
- コントローラーが必要なコンテキストだけを正確に選別します
- サブエージェントには最初に必要な情報がすべて渡されます
- 作業開始前に質問が明らかになります(作業後ではありません)
品質ゲート:
- セルフレビューにより、引き継ぎ前に問題を発見できます
- 仕様適合性、続いてコード品質の2段階レビューを行います
- レビューの反復により、修正が実際に機能することを確認できます
- 仕様適合性の確認により、過剰な実装や不足を防げます
- コード品質の確認により、実装が適切に構築されていることを保証します
コスト:
- サブエージェントの呼び出し回数が増えます(タスクごとに実装担当1つとレビュアー2つ)
- コントローラーの準備作業が増えます(タスクをすべて事前に抽出します)
- レビューの反復が増えます
- ただし、問題を早期に発見できます(後でデバッグするより低コストです)
注意すべき兆候
次のことは絶対にしないでください:
- ユーザーの明示的な許可なく、main/master ブランチで実装を開始する
- レビューを省略する(仕様適合性またはコード品質のいずれか)
- 修正されていない問題を残したまま進める
- 複数の実装サブエージェントを並列に割り当てる(競合が発生します)
- サブエージェントに計画ファイルを読ませる(代わりに全文を提供してください)
- 前後関係を説明するコンテキストの設定を省く(サブエージェントはタスクの位置づけを理解する必要があります)
- サブエージェントの質問を無視する(先へ進ませる前に回答してください)
- 仕様適合性が「だいたい合っている」状態を受け入れる(仕様レビュアーが問題を見つけた場合、完了ではありません)
- レビューの反復を省略する(レビュアーが問題を見つけた場合、実装担当が修正し、再度レビューします)
- 実装担当のセルフレビューで実際のレビューを代替する(どちらも必要です)
- 仕様適合性が✅になる前にコード品質レビューを開始する(順序が誤っています)
- いずれかのレビューで未解決の問題がある状態で次のタスクに進む
サブエージェントが質問した場合:
- 明確かつ十分に回答します
- 必要に応じて追加のコンテキストを提供します
- 実装を急がせないでください
レビュアーが問題を見つけた場合:
- 実装担当(同じサブエージェント)が修正します
- レビュアーが再度レビューします
- 承認されるまで繰り返します
- 再レビューを省略しないでください
サブエージェントがタスクに失敗した場合:
- 具体的な指示を添えて、修正担当のサブエージェントを割り当てます
- 手動で修正しようとしないでください(コンテキストが汚染されます)
統合
必須のワークフロースキル:
- superpowers:using-git-worktrees - 必須:開始前に分離されたワークスペースを設定します
- superpowers:writing-plans - このスキルが実行する計画を作成します
- superpowers:requesting-code-review - レビュアーのサブエージェント用コードレビューテンプレートです
- superpowers:finishing-a-development-branch - すべてのタスク完了後に開発を完了します
サブエージェントが使用するスキル:
- superpowers:test-driven-development - サブエージェントはタスクごとにTDDに従います
代替ワークフロー:
- superpowers:executing-plans - 同じセッション内での実行ではなく、並列セッションの場合に使用します
コメント
Markdown 対応