| name | use-subagents |
| description | This skill should be used when coordinating agents, delegating tasks to specialists, or when dispatch agents, which agent, or multi-agent are mentioned. |
| metadata | {"version":"2.2.1","related-skills":["context-management","pathfinding"]} |
Subagent Coordination
Orchestrate outfitter subagents by matching tasks to the right agent + skill combinations.
Orchestration Planning
For complex multi-agent tasks, start with the Plan subagent to research and design the orchestration strategy before execution.
Complex task arrives
โ
โโโบ Plan subagent (research stage)
โ โโโบ Explore codebase, gather context
โ โโโบ Identify which agents and skills needed
โ โโโบ Design execution sequence (sequential, parallel, or hybrid)
โ โโโบ Return orchestration plan
โ
โโโบ Execute plan (dispatch agents per plan)
Plan subagent benefits:
- Runs in isolated context โ doesn't consume main conversation tokens
- Can read many files without bloating orchestrator context
- Returns concise plan for execution
When to use Plan subagent:
- Task touches multiple domains (auth + performance + testing)
- Unknown codebase area โ needs exploration first
- Sequence of agents matters (dependencies between steps)
- High-stakes changes requiring careful coordination
Context Management
For long-running orchestration, load the context-management skill. It teaches:
- Using Tasks as survivable state (persists across compaction)
- Delegating to subagents to preserve main context
- Pre-compaction checklists to capture progress
- Cross-session patterns for multi-day work
Key principle: Main conversation context is precious. Delegate exploration and research to subagents โ only their summaries return, keeping main context lean.
Roles and Agents
Coordination uses roles (what function is needed) mapped to agents (who fulfills it). This allows substitution when better-suited agents are available.
Baselayer Agents
| Role | Agent | Purpose |
|---|
| coding | engineer | Build, implement, fix, refactor |
| reviewing | reviewer | Evaluate code, PRs, architecture, security |
| research | analyst | Investigate, research, explore |
| debugging | debugger | Diagnose issues, trace problems |
| testing | tester | Validate, prove, verify behavior |
| challenging | skeptic | Challenge complexity, question assumptions |
| specialist | specialist | Domain expertise (CI/CD, design, accessibility, etc.) |
| patterns | analyst | Extract reusable patterns from work |
Other Available Agents
Additional agents may be available in your environment (user-defined, plugin-provided, or built-in). When dispatching:
- Check available agents for best fit to the role
- Prefer specialized agents over generalists when they match the task
- Fall back to outfitter agents when no better option exists
Examples of role substitution:
- coding โ
senior-engineer, developer, engineer
- reviewing โ
security-auditor, code-reviewer, reviewer
- research โ
research-engineer, docs-librarian, analyst
- specialist โ
cicd-expert, design-agent, accessibility-auditor, bun-expert
Task Routing
Route by role, then select the best available agent for that role:
User request arrives
โ
โโโบ "build/implement/fix/refactor" โโโบ coding role
โ
โโโบ "review/critique/audit" โโโบ reviewing role
โ
โโโบ "investigate/research/explore" โโโบ research role
โ
โโโบ "debug/diagnose/trace" โโโบ debugging role
โ
โโโบ "test/validate/prove" โโโบ testing role
โ
โโโบ "simplify/challenge/is this overkill" โโโบ challenging role
โ
โโโบ "deploy/configure/CI/design/a11y" โโโบ specialist role
โ
โโโบ "capture this workflow/make reusable" โโโบ patterns role
Workflow Patterns
Sequential Handoff
One agent completes, passes to next:
research (investigate) โ coding (implement) โ reviewing (verify) โ testing (validate)
Use when: Clear stages, each requires different expertise.
Parallel Execution
Multiple agents work simultaneously using run_in_background: true:
โโโบ reviewing (code quality)
โ
task โโโผโโบ research (impact analysis)
โ
โโโบ testing (regression tests)
Use when: Independent concerns, time-sensitive, comprehensive coverage needed.
Challenge Loop
Build โ challenge โ refine:
coding (propose) โโ challenging (evaluate) โ coding (refine)
Use when: Complex architecture, preventing over-engineering, high-stakes decisions.
Investigation Chain
Narrow down, then fix:
research (scope) โ debugging (root cause) โ coding (fix) โ testing (verify)
Use when: Bug reports, production issues, unclear symptoms.
Role + Skill Combinations
Coding Role
| Task | Skills |
|---|
| New feature | software-craft, tdd-fieldguide |
| Bug fix | debugging โ software-craft |
| Refactor | software-craft + sanity-check |
| API endpoint | hono-fieldguide, software-craft |
| React component | react-fieldguide, software-craft |
| AI feature | software-craft |
Reviewing Role
| Task | Skills |
|---|
| PR review | code-review |
| Architecture review | systems-design |
| Performance audit | performance |
| Security audit | security |
| Pre-merge check | code-review + prove-it-works |
Research Role
| Task | Skills |
|---|
| Codebase exploration | codebase-analysis |
| Research question | research |
| Unclear requirements | pathfinding |
| Status report | status, report-findings |
Testing Role
| Task | Skills |
|---|
| Feature validation | prove-it-works |
| TDD implementation | tdd-fieldguide |
| Integration testing | prove-it-works |
Advanced Execution Patterns
Background Execution
Run agents asynchronously for parallel work:
{
"description": "Security review",
"prompt": "Review auth module for vulnerabilities",
"subagent_type": "reviewer",
"run_in_background": true
}
Retrieve results with TaskOutput:
{
"task_id": "agent-abc123",
"block": true
}
Chaining Subagents
Sequence agents for complex workflows โ each agent's output informs the next:
research agent โ "Found 3 auth patterns in use"
โ
coding agent โ "Implementing refresh token flow using pattern A"
โ
reviewing agent โ "Verified implementation, found 1 issue"
โ
coding agent โ "Fixed issue, ready for merge"
Pass context explicitly between agents via prompt.
Resumable Sessions
Continue long-running work across invocations:
{
"description": "Continue security analysis",
"prompt": "Now examine session management",
"subagent_type": "reviewer",
"resume": "agent-abc123"
}
Agent preserves full context from previous execution.
Use cases:
- Multi-stage research spanning topics
- Iterative refinement without re-explaining context
- Long debugging sessions with incremental discoveries
Model Selection
Override model for specific needs:
{
"subagent_type": "analyst",
"model": "haiku"
}
- haiku: Fast exploration, simple queries
- sonnet: Balanced reasoning (default)
- opus: Complex analysis, nuanced judgment
Coordination Rules
- Single owner: One role owns each task stage
- Clear handoffs: Explicit deliverables between agents
- Skill loading: Agent loads only needed skills
- User prefs first: Check
CLAUDE.md before applying defaults
- Minimal agents: Don't parallelize what can be sequential
Decision Framework
When agents face implementation choices:
- Favor existing patterns โ Match what's already in the codebase
- Prefer simplicity โ Cleverness is a liability; simple is maintainable
- Optimize for maintainability โ Next developer (or agent) must understand it
- Consider backward compatibility โ Breaking changes require explicit approval
- Document trade-offs โ When choosing between options, record why
These principles apply across all roles. Agents should surface decisions to the orchestrator when trade-offs are significant.
Communication Style
Orchestrators and agents should:
- Report progress at each major step (don't go silent)
- Flag blockers immediately โ don't spin on unsolvable problems
- Provide clear summaries of delegated work (what was done, what remains)
- Include file paths and line numbers when referencing code
Progress format:
โโโโโโโโโโ [1/5] research: Exploring auth patterns
โโโโโโโโโโ [2/5] coding: Implementing refresh token flow
When to Escalate
- Blocked: Agent can't proceed โ route to research role
- Conflicting findings: Multiple agents disagree โ surface to user
- Scope creep: Task expands beyond role's domain โ re-route
- Missing context: Not enough info โ research role with pathfinding skill
Git Operations Policy
CRITICAL: Subagents MUST NOT perform git operations (commit, push, branch creation) when running in parallel.
Only the orchestrator handles git state. Subagents write code to the filesystem and report completion.
Anti-Patterns
- Running all agents on every task (wasteful)
- Skipping reviewing role for "small changes" (risk)
- Coding role debugging without debugging skills (inefficient)
- Parallel agents with dependencies (race conditions)
- Not challenging complex proposals (over-engineering)
- Parallel agents with git permissions (stack corruption)
Quick Reference
"I need to build X" โ coding role + TDD skills
"Review this PR" โ reviewing role + code-review
"Why is this broken?" โ debugging role + debugging
"Is this approach overkill?" โ challenging role + sanity-check
"Prove this works" โ testing role + prove-it-works
"What's the codebase doing?" โ research role + codebase-analysis
"Deploy to production" โ specialist role + domain skills
"Make this workflow reusable" โ patterns role + codify