ワンクリックで
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 職業分類に基づく
Use when you have a spec or requirements for a multi-step task, before touching code
Use when auditing a Rust codebase, module, or workspace and wanting cross-model consensus on findings, a false-positive-filtered consolidated report, and a reproducible audit trail in git
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
Use after writing or modifying code to simplify and refine it for clarity, consistency, and maintainability without changing functionality. Triggers after any implementation work in the current session.
Dynamic performance measurement for Rust projects — profiling, load testing, benchmarking, and analysis of existing observability data (traces, metrics, logs). Use when you need measured impact, not inference. Requires either a runnable binary + load generator, or existing production telemetry. For static code-level analysis without measurement, use rust-perf.
Static performance audit for Rust projects — analyzes code for allocation, async, database, data-structure, and compile-time anti-patterns without requiring a running system. Use when reviewing code for performance issues before or instead of load testing. For runtime profiling and load-test analysis, use rust-perf-measure.
| 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 two-stage review after each: spec compliance review first, then code quality review.
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 + two-stage review (spec then quality) = high quality, fast iteration
Parallelism: Tasks that touch independent files can run in parallel using Agent() with run_in_background: true, then collecting results with get_subagent_result(). Tasks with shared file dependencies must run sequentially.
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"];
}
vs. Executing Plans (parallel session):
digraph process {
rankdir=TB;
"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
"Analyze task independence: which tasks touch independent files?" [shape=diamond];
subgraph cluster_parallel {
label="Parallel Batch (independent tasks)";
"Dispatch parallel implementers via Agent(run_in_background:true)" [shape=box];
"Collect all results via get_subagent_result(wait:true)" [shape=box];
"Dispatch parallel spec reviewers via Agent(run_in_background:true)" [shape=box];
"All spec reviews pass?" [shape=diamond];
"Fix failing tasks (re-dispatch implementers)" [shape=box];
"Dispatch parallel code quality reviewers via Agent(run_in_background:true)" [shape=box];
"All quality reviews pass?" [shape=diamond];
"Fix quality issues (re-dispatch implementers)" [shape=box];
}
subgraph cluster_sequential {
label="Sequential (dependent tasks)";
"Dispatch implementer via Agent() (./implementer-prompt.md)" [shape=box];
"Implementer subagent asks questions?" [shape=diamond];
"Answer questions via steer_subagent()" [shape=box];
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
"Dispatch spec reviewer via Agent() (./spec-reviewer-prompt.md)" [shape=box];
"Spec reviewer confirms code matches spec?" [shape=diamond];
"Fix spec gaps" [shape=box];
"Dispatch code quality reviewer via Agent() (./code-quality-reviewer-prompt.md)" [shape=box];
"Code quality reviewer approves?" [shape=diamond];
"Fix quality issues (sequential)" [shape=box];
"Mark task complete in 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" -> "Analyze task independence: which tasks touch independent files?";
"Analyze task independence: which tasks touch independent files?" -> "Dispatch parallel implementers via Agent(run_in_background:true)" [label="independent"];
"Analyze task independence: which tasks touch independent files?" -> "Dispatch implementer via Agent() (./implementer-prompt.md)" [label="dependent"];
"Dispatch parallel implementers via Agent(run_in_background:true)" -> "Collect all results via get_subagent_result(wait:true)";
"Collect all results via get_subagent_result(wait:true)" -> "Dispatch parallel spec reviewers via Agent(run_in_background:true)";
"Dispatch parallel spec reviewers via Agent(run_in_background:true)" -> "All spec reviews pass?";
"All spec reviews pass?" -> "Fix failing tasks (re-dispatch implementers)" [label="no"];
"Fix failing tasks (re-dispatch implementers)" -> "Dispatch parallel spec reviewers via Agent(run_in_background:true)";
"All spec reviews pass?" -> "Dispatch parallel code quality reviewers via Agent(run_in_background:true)" [label="yes"];
"Dispatch parallel code quality reviewers via Agent(run_in_background:true)" -> "All quality reviews pass?";
"All quality reviews pass?" -> "Fix quality issues (re-dispatch implementers)" [label="no"];
"Fix quality issues (re-dispatch implementers)" -> "Dispatch parallel code quality reviewers via Agent(run_in_background:true)";
"All quality reviews pass?" -> "More tasks remain?" [label="yes"];
"Dispatch implementer via Agent() (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
"Implementer subagent asks questions?" -> "Answer questions via steer_subagent()" [label="yes"];
"Answer questions via steer_subagent()" -> "Dispatch implementer via Agent() (./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 via Agent() (./spec-reviewer-prompt.md)";
"Dispatch spec reviewer via Agent() (./spec-reviewer-prompt.md)" -> "Spec reviewer confirms code matches spec?";
"Spec reviewer confirms code matches spec?" -> "Fix spec gaps" [label="no"];
"Fix spec gaps" -> "Dispatch spec reviewer via Agent() (./spec-reviewer-prompt.md)" [label="re-review"];
"Spec reviewer confirms code matches spec?" -> "Dispatch code quality reviewer via Agent() (./code-quality-reviewer-prompt.md)" [label="yes"];
"Dispatch code quality reviewer via Agent() (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer approves?";
"Code quality reviewer approves?" -> "Fix quality issues (sequential)" [label="no"];
"Fix quality issues (sequential)" -> "Dispatch code quality reviewer via Agent() (./code-quality-reviewer-prompt.md)" [label="re-review"];
"Code quality reviewer approves?" -> "Mark task complete in TodoWrite" [label="yes"];
"Mark task complete in TodoWrite" -> "More tasks remain?";
"More tasks remain?" -> "Dispatch implementer via Agent() (./implementer-prompt.md)" [label="yes - dependent"];
"More tasks remain?" -> "Dispatch parallel implementers via Agent(run_in_background:true)" [label="yes - independent batch"];
"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";
}
The @tintinweb/pi-subagents package provides Agent(), get_subagent_result(), and steer_subagent() tools. Use run_in_background: true for parallel execution when tasks are independent (no shared file edits).
A task is independent if:
Run in parallel: Different modules, different features, different test files with isolated fixtures Run sequentially: Shared config files, shared types/interfaces, tasks that build on each other's output
# Implementers in parallel (all touch independent files)
Agent({ subagent_type: "worker", prompt: "Implement Task 1: [full text + context]", description: "Task 1: hook install script", run_in_background: true })
# → returns agent_id: "agent-1"
Agent({ subagent_type: "worker", prompt: "Implement Task 2: [full text + context]", description: "Task 2: recovery modes", run_in_background: true })
# → returns agent_id: "agent-2"
Agent({ subagent_type: "worker", prompt: "Implement Task 3: [full text + context]", description: "Task 3: config parser", run_in_background: true })
# → returns agent_id: "agent-3"
# Wait for all to complete
get_subagent_result({ agent_id: "agent-1", wait: true })
get_subagent_result({ agent_id: "agent-2", wait: true })
get_subagent_result({ agent_id: "agent-3", wait: true })
# After all complete, spec reviewers in parallel
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 1: [requirements + T1 report]", description: "Spec review: Task 1", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 2: [requirements + T2 report]", description: "Spec review: Task 2", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 3: [requirements + T3 report]", description: "Spec review: Task 3", run_in_background: true })
# Wait for all, then dispatch quality reviewers the same way
# Single foreground agent (blocks until complete)
Agent({ subagent_type: "worker", prompt: "Implement Task 4: [full text + context]", description: "Task 4: integration layer" })
# If the agent needs guidance mid-task:
steer_subagent({ agent_id: "agent-4", message: "The config format changed — use TOML not YAML. See src/config.toml for the schema." })
Max concurrency: Up to 4 agents run concurrently by default. Configurable via /agents → Settings.
Streaming: All parallel agents stream updates simultaneously. You see live progress from all tasks at once.
When some parallel tasks fail and others succeed:
Models are configured per agent type. There are three ways to set a model, in order of precedence:
model parameter on Agent() call — overrides everything for that specific dispatch:
Agent({ subagent_type: "worker", prompt: "...", description: "...", model: "haiku" })
Agent .md frontmatter — set the model: field in the agent definition file (e.g., agents/worker.md). Applies to all dispatches of that agent type unless overridden by (1). Supports fuzzy names (e.g., "haiku", "sonnet") or exact identifiers (e.g., "anthropic/claude-sonnet-4-6").
Inherit parent model — if neither (1) nor (2) specifies a model, the subagent inherits the parent agent's model.
Agent types:
agents/*.md files: worker, scout, reviewer, plannergeneral-purpose, Explore, PlanGuideline: Use the least powerful model that can handle each task to conserve cost and increase speed. Most implementation tasks are mechanical when the plan is well-specified — a fast model suffices. Reserve capable models for architecture, design, integration, and review tasks.
Each subagent reports its own usage stats in the result. The format is:
⟳3 · 12 tool uses · 8.2k token · 14s
This shows: turns, tool invocations, token usage, and wall-clock time.
Quick mental math:
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:
model parameterNever ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
./implementer-prompt.md - Dispatch implementer subagent./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]
[Assess independence: Tasks 1, 2, 3 are independent modules. Tasks 4, 5 depend on Task 3 output.]
=== Parallel Batch: Tasks 1, 2, 3 ===
[Dispatch parallel implementers]
Agent({ subagent_type: "worker", prompt: "Implement Task 1: Hook installation script. [full text]...", description: "Task 1: hook install", run_in_background: true })
# → agent_id: "agent-1"
Agent({ subagent_type: "worker", prompt: "Implement Task 2: Recovery modes. [full text]...", description: "Task 2: recovery modes", run_in_background: true })
# → agent_id: "agent-2"
Agent({ subagent_type: "worker", prompt: "Implement Task 3: Config parser. [full text]...", description: "Task 3: config parser", run_in_background: true })
# → agent_id: "agent-3"
[Live streaming: all 3 agents working simultaneously]
[Collect results]
get_subagent_result({ agent_id: "agent-1", wait: true }) # ✓
get_subagent_result({ agent_id: "agent-2", wait: true }) # ✓
get_subagent_result({ agent_id: "agent-3", wait: true }) # ✓
[Dispatch parallel spec reviewers]
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 1: [requirements + T1 report]", description: "Spec review: Task 1", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 2: [requirements + T2 report]", description: "Spec review: Task 2", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Spec compliance for Task 3: [requirements + T3 report]", description: "Spec review: Task 3", run_in_background: true })
[Collect spec review results]
Task 1: ✅ Spec compliant
Task 2: ❌ Missing: Progress reporting (spec says "report every 100 items")
Task 3: ✅ Spec compliant
[Re-dispatch only Task 2 implementer to fix]
Agent({ subagent_type: "worker", prompt: "Fix Task 2: add progress reporting every 100 items. [details]", description: "Fix Task 2: progress reporting" })
[Re-run spec review for Task 2 only]
Agent({ subagent_type: "reviewer", prompt: "Re-review spec compliance for Task 2: [requirements + fix report]", description: "Re-review: Task 2 spec" })
Task 2: ✅ Spec compliant
[Dispatch parallel code quality reviewers for all 3]
Agent({ subagent_type: "reviewer", prompt: "Code quality for Task 1: base sha X, head sha Y...", description: "Quality review: Task 1", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Code quality for Task 2: base sha X, head sha Y...", description: "Quality review: Task 2", run_in_background: true })
Agent({ subagent_type: "reviewer", prompt: "Code quality for Task 3: base sha X, head sha Y...", description: "Quality review: Task 3", run_in_background: true })
[Collect quality review results]
All ✅ — mark Tasks 1, 2, 3 complete in TodoWrite
=== Sequential: Task 4 (depends on Task 3) ===
[Dispatch single implementer]
Agent({ subagent_type: "worker", prompt: "Implement Task 4: [full text + Task 3 output]", description: "Task 4: integration layer" })
...
[spec review → quality review → complete]
=== Sequential: Task 5 (depends on Task 4) ===
...
[All tasks complete]
[Dispatch final code reviewer]
[Use superpowers:finishing-a-development-branch]
vs. Manual execution:
vs. Executing Plans:
Parallelism gains:
/agents → Settings)Efficiency gains:
Quality gates:
Cost:
Never:
Parallel is SAFE for:
Parallel is UNSAFE for:
If subagent asks questions:
steer_subagent()If reviewer finds issues:
If subagent fails task:
Required workflow skills:
Subagents should use:
Alternative workflow: