ワンクリックで
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 職業分類に基づく
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.
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Extract learned patterns from session - invoked automatically by finishing-a-development-branch or manually anytime
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for review, delivery, or cleanup
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
| 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 multi-stage review after each: spec compliance, code quality, security, and conditional verification gate.
Core principle: Fresh subagent per task + multi-stage review = high quality, fast iteration
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"];
}
The pipeline state file is the backbone of enforcement and context resilience.
Location: docs/plans/YYYY-MM-DD-<feature-name>-pipeline-state.md
Matches naming of design doc (-design.md) and plan doc (-plan.md). Each pipeline gets its own state file.
Lifecycle:
Gate enforcement: Before dispatching any reviewer, read the checklist. If the previous required stage isn't checked, do not proceed. Before sp-ecc:finishing-a-development-branch presents options, it reads the file and refuses if any required items are unchecked.
Example file:
# Pipeline State: auth-system
Created: 2026-03-14
Phase: executing (task 3 of 5)
## Config
Workspace: worktree at .worktrees/auth-system
Design: docs/plans/2026-03-14-auth-system-design.md
Plan: docs/plans/2026-03-14-auth-system-plan.md
## Tasks
### Task 1: Create schema [COMPLETE] [tier: light]
- [x] Implementer: done
- [x] Spec review: PASS
### Task 2: Auth middleware [COMPLETE] [tier: thorough]
- [x] Implementer: done
- [x] Spec review: PASS
- [x] Quality review: PASS
- [x] Security review: PASS — no issues
### Task 3: API routes [IN PROGRESS] [tier: standard]
- [x] Implementer: done
- [ ] Spec review: PENDING
- [ ] Quality review: PENDING
### Task 4: Client components [PENDING] [tier: standard]
### Task 5: Tests [PENDING] [tier: light]
## After All Tasks [highest tier: thorough]
- [ ] E2E runner
- [ ] Doc-updater
- [ ] Verification-loop
- [ ] Refactor-cleaner
- [ ] Final code review
After each implementer completes, analyze the actual diff to determine tier. NOT from plan text — from real code changes.
Detection heuristics:
THOROUGH if ANY of:
- Diff touches: auth, session, token, password, secret, crypto,
payment, billing, charge (filenames or content)
- Diff touches migration files or schema definitions
- Diff adds/modifies SQL queries or ORM query builders
- Diff touches user input handling (forms, request params, API body)
- Diff adds new public API endpoints
- Lines changed > 300
LIGHT if ALL of:
- Lines changed < 50
- Files touched <= 2
- None of THOROUGH triggers matched
- No new test files created
STANDARD: everything else
Per-task review stages by tier:
| Stage | Light | Standard | Thorough |
|---|---|---|---|
| Spec review | Yes | Yes | Yes |
| Quality review | Skip | Yes | Yes |
| Security review | Skip | Skip | Yes |
| Logging review | Skip | Skip | If logging touched |
| Database review | Skip | Skip | If SQL touched |
After-all-tasks by HIGHEST tier across all tasks:
| Stage | Light | Standard | Thorough |
|---|---|---|---|
| E2E runner | Skip | If UI changes | Yes |
| Doc-updater | Skip | If public API | Yes |
| Verification-loop | Yes | Yes | Yes |
| Refactor-cleaner | Skip | Yes | Yes |
| Final code review | Skip | Yes | Yes |
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 with TDD, 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];
"Dispatch security reviewer (agents/security-reviewer)" [shape=box];
"Security reviewer approves?" [shape=diamond];
"Implementer subagent fixes security issues" [shape=box];
"Verification gate" [shape=diamond];
"Dispatch logging reviewer (conditional)" [shape=box];
"Dispatch database reviewer (conditional)" [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];
subgraph cluster_after_all {
label="After All Tasks";
"Dispatch e2e-runner (if UI changes)" [shape=box];
"Dispatch doc-updater" [shape=box];
"Run verification-loop (build, lint, test, security scan)" [shape=box];
"Dispatch refactor-cleaner" [shape=box];
"Dispatch final code reviewer for entire implementation" [shape=box];
}
"Use sp-ecc: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 with TDD, tests, commits, self-reviews" [label="no"];
"Implementer subagent implements with TDD, 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?" -> "Dispatch security reviewer (agents/security-reviewer)" [label="yes"];
"Dispatch security reviewer (agents/security-reviewer)" -> "Security reviewer approves?";
"Security reviewer approves?" -> "Implementer subagent fixes security issues" [label="no"];
"Implementer subagent fixes security issues" -> "Dispatch security reviewer (agents/security-reviewer)" [label="re-review"];
"Security reviewer approves?" -> "Verification gate" [label="yes"];
"Verification gate" -> "Dispatch logging reviewer (conditional)" [label="logging code touched"];
"Verification gate" -> "Dispatch database reviewer (conditional)" [label="SQL/migrations touched"];
"Verification gate" -> "Mark task complete in TodoWrite" [label="no conditional reviewers needed"];
"Dispatch logging reviewer (conditional)" -> "Mark task complete in TodoWrite";
"Dispatch database reviewer (conditional)" -> "Mark task complete in TodoWrite";
"Mark task complete in TodoWrite" -> "More tasks remain?";
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
"More tasks remain?" -> "Dispatch e2e-runner (if UI changes)" [label="no"];
"Dispatch e2e-runner (if UI changes)" -> "Dispatch doc-updater";
"Dispatch doc-updater" -> "Run verification-loop (build, lint, test, security scan)";
"Run verification-loop (build, lint, test, security scan)" -> "Dispatch refactor-cleaner";
"Dispatch refactor-cleaner" -> "Dispatch final code reviewer for entire implementation";
"Dispatch final code reviewer for entire implementation" -> "Use sp-ecc:finishing-a-development-branch";
}
Note: The diagram above shows the full (Thorough) path. Stages are skipped per the tier tables below.
./spec-reviewer-prompt.md./code-quality-reviewer-prompt.mdA task is NOT complete until all applicable stages pass.
Before running after-all-tasks stages, compute the highest tier across all completed tasks and record it in the pipeline-state.md ## After All Tasks [highest tier: X] header. This determines which after-all-tasks stages run.
Run these stages in order before finishing:
If verification-loop fails:
If reviewer rejects (any stage):
The pipeline state file is the primary mechanism for surviving context loss.
Before dispatching any subagent:
docs/plans/*-pipeline-state.md to know current stateWhat survives on disk (not in conversation):
docs/plans/YYYY-MM-DD-<feature>-design.mddocs/plans/YYYY-MM-DD-<feature>-plan.mddocs/plans/YYYY-MM-DD-<feature>-pipeline-state.mdAdvisory: Consider /compact between tasks as a natural boundary. Pipeline state file ensures nothing is lost.
./implementer-prompt.md - Dispatch implementer subagent (TDD enforced)./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/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/sp-ecc/hooks/)"
Implementer: "Got it. Writing failing test first..."
[Later] Implementer:
- Wrote failing test for install-hook
- Implemented install-hook command (test green)
- Added edge case 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
[Dispatch code quality reviewer]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Dispatch security reviewer]
Security reviewer: ✅ N/A - no security-relevant code in this task
[Verification gate: no logging or DB code touched — skip conditional reviewers]
[Mark Task 1 complete]
Task 2: Auth middleware
[Dispatch implementation subagent]
Implementer: Implemented auth middleware with TDD, 8/8 tests passing
[Spec reviewer] ✅ Spec compliant
[Code quality reviewer] ✅ Approved
[Security reviewer] ❌ Issues:
- Session token stored in plain text cookie
- Missing CSRF protection
[Implementer fixes security issues]
[Security reviewer re-reviews] ✅ Approved
[Verification gate: no logging or DB code — skip]
[Mark Task 2 complete]
...
[After all tasks]
[E2E runner: UI changes detected, running e2e tests — ✅ pass]
[Doc-updater: Updated README and codemaps]
[Verification-loop: build ✅, lint ✅, tests ✅, security scan ✅]
[Refactor-cleaner: Removed 3 unused imports, 1 dead helper function]
[Final code reviewer: All requirements met, clean integration — LAST stage, no changes after this]
[sp-ecc:finishing-a-development-branch]
Done!
vs. Manual execution:
Quality gates:
After-all-tasks stages:
Efficiency:
Never:
If subagent asks questions:
If reviewer finds issues:
If subagent fails task:
Required workflow skills:
Required agents (per task):
Required agents (after all tasks):
Subagents must follow:
Optional workspace: