ワンクリックで
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 to implement a multi-step task sequentially in one session when subagents aren't available — plans in context, then executes
Use when the user wants to deeply research a topic OR brainstorm/explore ideas WITHOUT building anything yet — produces a cited briefing or idea-landscape (an exploration doc), never a spec, plan, or implementation. Triggers on "do deep research on X", "research X", "let's brainstorm ideas around X", "explore X", "what are some ideas for X". NOT for "build/implement/add/fix X" — that is the brainstorming skill. Set wildness with `--wild 0.1–1.0`.
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
The planning rubric the execution skills run in-context at the start of a run — turns the tech spec (tech.md) when present, else the logic spec / requirements, into a task breakdown (contracts, acceptance, parallelism) before code
The rubric the execution skills run in-context — only when the work warrants it — to author the code-anchored tech spec from the approved logic spec, before planning.
| 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 a three-pass review after each: spec compliance, then code quality, then Codex adversarial gap-finding.
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 + three-pass review (spec, then quality, then Codex adversarial) = high quality, fast iteration
digraph when_to_use {
"Have a spec / requirements?" [shape=diamond];
"Tasks mostly independent?" [shape=diamond];
"Stay in this session?" [shape=diamond];
"subagent-driven-development" [shape=box];
"executing-plans" [shape=box];
"Brainstorm first" [shape=box];
"Have a spec / requirements?" -> "Tasks mostly independent?" [label="yes"];
"Have a spec / requirements?" -> "Brainstorm first" [label="no"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "executing-plans" [label="no - tightly coupled"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}
You do not need a written plan to start — this skill authors a tech spec when warranted,
then plans in context as its first phase (an optional Step 0a-pre, then Step 0a). You
need the tech spec (tech.md) when present, else the logic spec / requirements, to plan from;
if you don't have one, brainstorm first. Even when you do, a tech spec may still be authored
during execution (Step 0a-pre) if the work clears the complexity tier.
Parallel by default: when the chosen path is subagent-driven-development, the orchestrator computes waves from declared task independence and selects per-wave between SEQUENTIAL, IN_PLACE_PARALLEL, WORKTREE_PARALLEL, and TEAM mode. Sequential is reserved for tasks with hard declared dependencies. See The Process → Step 0b.
vs. Executing Plans (parallel session):
This skill supports two agent runtimes. Before reading the plan, ask the user
which to use via AskUserQuestion:
Which agent runtime for this plan?
- Claude subagents (default) —
Tasktool with general-purpose / quirk:code-reviewer agents- Pi agents —
pi -pheadless dispatch with codex implementer + gemini reviewer
The choice is locked once and applies uniformly to per-task implementer + per-task spec reviewer + per-task code-quality reviewer for the rest of the run.
The final whole-branch reviewer always uses the Claude quirk:code-reviewer
agent, regardless of choice — cross-task synthesis benefits from Claude's agent
context, and pi has no equivalent role.
| Role | Claude path | Pi path |
|---|---|---|
| Implementer | Task (general-purpose) + assets/implementer-prompt.md | pi -p codex (openai-codex/gpt-5.3-codex:xhigh) + assets/pi-implementer-prompt.md |
| Spec reviewer | Task (general-purpose) + assets/spec-reviewer-prompt.md | pi -p gemini (google/gemini-3.1-pro-preview:high) + assets/pi-spec-reviewer-prompt.md |
| Code-quality reviewer | Task (quirk:code-reviewer) + assets/code-quality-reviewer-prompt.md | pi -p gemini (google/gemini-3.1-pro-preview:high) + assets/pi-code-quality-reviewer-prompt.md |
| Codex adversarial reviewer | mcp__pal__clink (cli_name=codex, role=codereviewer) + assets/codex-adversarial-prompt.md | pi -p codex (openai-codex/gpt-5.3-codex:xhigh, --tools read,bash) + assets/pi-codex-adversarial-prompt.md |
| Merge resolver (worktree mode only) | Task (general-purpose) + assets/merge-resolver-prompt.md | pi -p codex (openai-codex/gpt-5.3-codex:xhigh, --tools read,bash,edit,write) + assets/pi-merge-resolver-prompt.md |
| Final whole-branch reviewer | Task (quirk:code-reviewer) | Task (quirk:code-reviewer) — always Claude |
When the pi path is selected, REQUIRED: consult quirk:pi-dev for the
canonical hardened dispatch recipe, failure-detection rules, and reviewer JSON
parse fallback.
digraph process {
rankdir=TB;
"Ask: pi or Claude runtime?" [shape=diamond];
"author tech spec (if tier)" [shape=box];
"Read plan, extract tasks, compute waves" [shape=box];
"More waves remain?" [shape=diamond];
"Pick mode for next wave" [shape=box];
"Mode = SEQUENTIAL?" [shape=diamond];
"Mode = TEAM?" [shape=diamond];
"Mode = IN_PLACE_PARALLEL?" [shape=diamond];
"Run wave (one task, existing per-task loop)" [shape=box];
"Run wave (TeamCreate + parallel implementers + TaskList)" [shape=box];
"Run wave (multi Task calls in 1 turn, current branch)" [shape=box];
"Run wave (worktree per task, parallel implementers, rolling auto-merge)" [shape=box];
"Per-task: implementer -> spec -> quality -> Codex (NEW)" [shape=box];
"All waves complete?" [shape=diamond];
"Dispatch final whole-branch reviewer (Claude quirk:code-reviewer)" [shape=box];
"Use quirk:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Ask: pi or Claude runtime?" -> "author tech spec (if tier)";
"author tech spec (if tier)" -> "Read plan, extract tasks, compute waves";
"Read plan, extract tasks, compute waves" -> "More waves remain?";
"More waves remain?" -> "Pick mode for next wave" [label="yes"];
"More waves remain?" -> "Dispatch final whole-branch reviewer (Claude quirk:code-reviewer)" [label="no"];
"Pick mode for next wave" -> "Mode = SEQUENTIAL?";
"Mode = SEQUENTIAL?" -> "Run wave (one task, existing per-task loop)" [label="yes"];
"Mode = SEQUENTIAL?" -> "Mode = TEAM?" [label="no"];
"Mode = TEAM?" -> "Run wave (TeamCreate + parallel implementers + TaskList)" [label="yes"];
"Mode = TEAM?" -> "Mode = IN_PLACE_PARALLEL?" [label="no"];
"Mode = IN_PLACE_PARALLEL?" -> "Run wave (multi Task calls in 1 turn, current branch)" [label="yes"];
"Mode = IN_PLACE_PARALLEL?" -> "Run wave (worktree per task, parallel implementers, rolling auto-merge)" [label="no (default: WORKTREE_PARALLEL)"];
"Run wave (one task, existing per-task loop)" -> "Per-task: implementer -> spec -> quality -> Codex (NEW)";
"Run wave (TeamCreate + parallel implementers + TaskList)" -> "Per-task: implementer -> spec -> quality -> Codex (NEW)";
"Run wave (multi Task calls in 1 turn, current branch)" -> "Per-task: implementer -> spec -> quality -> Codex (NEW)";
"Run wave (worktree per task, parallel implementers, rolling auto-merge)" -> "Per-task: implementer -> spec -> quality -> Codex (NEW)";
"Per-task: implementer -> spec -> quality -> Codex (NEW)" -> "All waves complete?";
"All waves complete?" -> "More waves remain?" [label="no, more"];
"All waves complete?" -> "Dispatch final whole-branch reviewer (Claude quirk:code-reviewer)" [label="yes"];
"Dispatch final whole-branch reviewer (Claude quirk:code-reviewer)" -> "Use quirk:finishing-a-development-branch";
}
<runtime> in asset paths is `` (empty) for the Claude path and pi- for the
pi path. So the implementer template is assets/implementer-prompt.md (Claude)
or assets/pi-implementer-prompt.md (pi); the Codex adversarial template is
assets/codex-adversarial-prompt.md (Claude) or assets/pi-codex-adversarial-prompt.md (pi);
and so on for spec reviewer, code-quality reviewer, and merge resolver.
Before building the plan, apply the complexity-tier gate (from
quirk:writing-tech-spec): author tech.md if execution spans more than one session, crosses
a subsystem boundary, touches ≳3 source files, or the user asked for a tech spec. This is a
direct instruction — author or skip, not a suggestion to weigh. Record the ruling as
one line (which criterion fired, or "skipped — none met") — and in logic.md Status when a
tech spec is authored — before continuing.
If the gate is met:
tech.md already exists as the sibling of the actual
logic.md (wherever it was saved — by default docs/quirk/specs/YYYY-MM-DD-<topic>/tech.md,
handed off from another session), load it instead of re-authoring — re-author only if it's
absent or the user asks for a rewrite.tech.md next to the
logic spec, in the same directory the approved logic.md was actually saved to (the path
above is the default example, not a hard-coded location).../writing-tech-spec/tech-spec-reviewer-prompt.md)
against the in-context tech.md (paste inline — the reviewer reads no file); apply its fixes.logic.md
Decisions-Locked entry, STOP, present it to the user, and record the resolution in
logic.md's Amendments log before proceeding — never resolve it silently in tech.md.If the gate is not met: skip — proceed straight to Step 0a and plan from logic.md.
This skill authors a tech spec when warranted, then plans in context: tech.md (when
authored) becomes writing-plans' input for Step 0a, alongside — or instead of — logic.md.
Unless a plan already exists (in this conversation, or as a persisted file handed to you), build it now — planning is the first phase of execution, not a prior step:
tech.md when Step 0a-pre
authored or loaded one, else from logic.md / requirements. Draft the task breakdown — each
task with its Contract, Acceptance, and optional independent / dependencies /
scope.files / cooperative fields — directly in this conversation and into a TodoWrite
list (one item per task). TodoWrite is the durable home for the breakdown; it survives
context compaction.tech.md late (Step 0a-pre's steps 1-5) and re-plan the affected tasks before continuing.docs/quirk/plans/ only if the user asks
or the plan must outlive this session.Dispatch the plan-document reviewer (../writing-plans/plan-document-reviewer-prompt.md) on the
in-context plan (paste the plan text inline — the reviewer does not read a file). Apply its
fixes inline. This is automatic and replaces any human approval gate; only stop for the user if
the reviewer surfaces a genuine ambiguity you cannot resolve.
independent: true — task can run alongside any other task in its eligible wavedependencies: [task-id, ...] — task must wait for all listed tasks to completescope.files: [path, ...] — files this task is expected to touchcooperative: true — task needs live negotiation with other tasks in its wave (TEAM mode)dependencies.if |wave| == 1:
mode = SEQUENTIAL
elif any task in wave has cooperative: true:
mode = TEAM
elif |wave| <= N_INPLACE_THRESHOLD AND scopes are provably disjoint at file level:
mode = IN_PLACE_PARALLEL
else:
mode = WORKTREE_PARALLEL # default for 2+ independent tasks
N_INPLACE_THRESHOLD = 2 by default. "Scopes provably disjoint at file level"
means every task in the wave declared scope.files AND no two tasks share
any file path.
If a task declared neither independent: true, dependencies, nor
scope.files, place it in its own singleton wave (= SEQUENTIAL). This is
the safe fallback for plans that haven't adopted the new format.
Single Task call; existing per-task pipeline: implementer -> spec compliance -> code quality -> Codex adversarial -> mark complete.
Task calls (or multiple pi -p invocations on the Pi path).git conflict during
commit, abort the wave and escalate to the user (this is a gate bug,
not a normal flow).<parent-branch>/sdd/<task-id>.git merge --no-ff <branch> from the parent branch. Merges are
sequential (one at a time) as tasks finish; there is no wave-level
barrier.assets/merge-resolver-prompt.md for Claude, assets/pi-merge-resolver-prompt.md for pi). Worktree is
preserved until resolution.
Status: SUCCESS: continue with the next branch in the rolling
merge sequence.Status: UNRESOLVABLE: escalate to the user; preserve the worktree
and the conflicted state.cooperative: true)Adopts the persistent-team pattern: TeamCreate -> spawn all wave implementers in one message turn -> TaskList coordination -> SendMessage for cross-component negotiation -> TeamDelete after wave completes.
Per-task review chain fires per implementer as each completes. This is the only mode where the "fresh subagent per task" guarantee is relaxed within a wave; the relaxation is justified only when tasks need live negotiation that the orchestrator cannot mediate after the fact.
Every task — regardless of mode — proceeds through:
implementer
-> spec compliance reviewer (existing — Task general-purpose / pi gemini)
-> code quality reviewer (existing — Task quirk:code-reviewer / pi gemini)
-> Codex adversarial reviewer (NEW — PAL clink codex / pi codex; gap-finder, severity-tagged)
-> mark task complete
The Codex adversarial reviewer:
absolute_file_paths (Claude path) or via the worktree
filesystem (pi path with --tools read,bash).CRITICAL | HIGH | MEDIUM | LOW) with
file:line citations and a final VERDICT: PASS | NEEDS_FIXES | CRITICAL_ISSUES.Existing spec-compliance and code-quality fix loops remain unbounded (unchanged).
You: I'm using Subagent-Driven Development to execute this plan.
[Read plan; extract 3 tasks]
[Plan declares: T1 independent, T2 independent, T3 depends: [T1]]
[Wave 1 = {T1, T2} (size 2, both independent, scopes overlap on README.md)]
-> mode = WORKTREE_PARALLEL (overlap forbids IN_PLACE)
[Create worktrees: main/sdd/T1, main/sdd/T2]
[Dispatch implementers for T1 and T2 in one message turn]
T1 implementer finishes -> spec review (PASS) -> quality review (PASS) -> Codex review (PASS)
-> rolling merge: git merge --no-ff main/sdd/T1 -> clean -> teardown worktree
T2 implementer finishes -> spec review (NEEDS_FIX) -> implementer fixes
-> spec review (PASS) -> quality review (PASS) -> Codex review (CRITICAL_ISSUES)
-> implementer fixes -> Codex review (PASS) [cycle 2 of 2]
-> rolling merge: conflict on README.md -> dispatch merge resolver
-> resolver: SUCCESS -> teardown worktree
[Wave 1 complete; T3's deps satisfied]
[Wave 2 = {T3} (singleton -> SEQUENTIAL)]
[Run T3 normally]
[All waves done]
[Dispatch final quirk:code-reviewer over the whole branch]
[Use quirk:finishing-a-development-branch]
Pi path: Models are fixed by role — codex (openai-codex/gpt-5.3-codex:xhigh) for the
implementer, gemini (google/gemini-3.1-pro-preview:high) for both reviewers. Skip the
rest of this section.
Claude path: 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:
logic.md Decisions-Locked entry, record the resolution as a dated entry in the logic spec's Amendments log before continuing, never a silent plan edit.Never ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
All templates live in assets/. The dispatch path is selected by the runtime
chosen in Runtime Selection.
Claude path:
assets/implementer-prompt.md — dispatch implementer via Task (general-purpose)assets/spec-reviewer-prompt.md — dispatch spec compliance reviewer via Task (general-purpose)assets/code-quality-reviewer-prompt.md — dispatch code quality reviewer via Task (quirk:code-reviewer)assets/codex-adversarial-prompt.md — dispatch Codex adversarial reviewer via mcp__pal__clink (cli_name=codex, role=codereviewer)assets/merge-resolver-prompt.md — dispatch merge resolver via Task (general-purpose) — only used in WORKTREE_PARALLEL modePi path:
assets/pi-implementer-prompt.md — pi -p codex with --tools read,bash,edit,writeassets/pi-spec-reviewer-prompt.md — pi -p gemini with --tools read,bash (read-only review)assets/pi-code-quality-reviewer-prompt.md — pi -p gemini with --tools read,bash (read-only review)assets/pi-codex-adversarial-prompt.md — pi -p codex with --tools read,bash (read-only review)assets/pi-merge-resolver-prompt.md — pi -p codex with --tools read,bash,edit,write — only used in WORKTREE_PARALLEL modeThe pi templates reference quirk:pi-dev for the canonical hardened dispatch recipe (timeout wrapper, exit-code capture, JSONL events file) and failure-detection rules. Use that recipe verbatim when scripting; the pi templates show the minimum interactive form.
You: I'm using Subagent-Driven Development. First I'll check whether a tech spec is warranted,
then build the plan in context.
[Step 0a-pre: complexity-tier gate checked — "skipped, none met" — proceed straight to Step 0a]
[Step 0a: invoke writing-plans rubric → draft 5 tasks (contracts, acceptance, parallelism)
in context + TodoWrite — no file]
[Step 0a-review: dispatch plan-document reviewer on the in-context plan; apply fixes]
[Step 0b: tasks already in context + TodoWrite; compute waves]
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/quirk/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.
[Dispatch Codex adversarial reviewer (mcp__pal__clink, codex codereviewer)]
Codex: VERDICT: PASS — no gaps found between spec and implementation.
[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
[Dispatch Codex adversarial reviewer]
Codex: VERDICT: PASS — adversarial review found no spec-implementation gaps.
[Mark Task 2 complete]
...
[After all tasks]
[Dispatch final code-reviewer]
Final reviewer: All requirements met, ready to merge
Done!
vs. Manual execution:
vs. Executing Plans:
Efficiency gains:
Quality gates:
Cost:
Never:
If subagent asks questions:
If reviewer finds issues:
If subagent fails task:
Pi has no built-in retries beyond rate-limit backoff and no auto-detect for stale versions. Apply the quirk:pi-dev → Failure detection rules in order. On detection:
| Failure | Action |
|---|---|
| Auth (401, invalid api key, authentication_error) | Fall back to Claude for the rest of the run. Warn the user once. Don't consume retry budget — every worker hits the same wall. |
Billing (insufficient_quota, quota.exceeded) | Fall back to Claude for the rest of the run. Warn the user once. |
Rate limit (429, rate_limit_error, RESOURCE_EXHAUSTED) | One retry with 60s backoff. If the retry also fails, fall back to Claude for that role only. |
Timeout (gtimeout exit 124) | Treat the worker as FAIL. Re-dispatch once with a longer timeout; if it times out again, fall back to Claude for that role. |
| Empty/missing JSONL events | Worker hung or never started. Re-dispatch once. If still empty, fall back to Claude for that role. |
| Unparseable reviewer output | Apply quirk:pi-dev → Reviewer JSON parse fallback. Never count unparseable as PASS — synthesize a NEEDS_FIX verdict and let the implementer fix-and-retry. |
| Pi version < 0.65.1 (preflight check) | Don't dispatch any pi worker. Tell the user to upgrade (pnpm add -g @mariozechner/pi-coding-agent) or fall back to Claude. |
The same failure-detection rules apply uniformly to the new pi roles introduced for parallel mode and Codex review:
assets/codex-adversarial-prompt.md). Never count an unparseable Codex review as PASS.Task general-purpose path (assets/merge-resolver-prompt.md). On UNRESOLVABLE verdict, escalate to the user; do not retry the resolver in a loop.
When falling back, mark any partially completed task as needing re-review on the
Claude path before continuing to the next task. Don't silently continue with a
mixed-runtime task.Required workflow skills:
WORKTREE_PARALLEL mode: orchestrator creates one worktree per task in the wave (branch convention <parent-branch>/sdd/<task-id>), runs reviews inside the worktree pre-merge, rolling-merges back to the parent branch as each task's review chain passes, and tears down the worktree on success.tech.md when Step 0a-pre produced one, else from logic.md / requirements — including the optional task fields (independent, dependencies, scope.files, cooperative) the orchestrator uses for wave compute and mode decision in Step 0b / Step 0c.Required when pi runtime is selected:
Subagents should use:
Alternative workflow: