Use this skill whenever delegating work to subagents — whether a single Task call or a full team via TeamCreate. Guides delegation, task decomposition, agent selection, and coordination. Covers when to spawn architect (design decisions, trade-offs), researcher (explorations, technical investigation), developer (FEATURE specs and code), tech-writer (documentation), qa (post-implementation validation), and architecture-critic (stress-testing architect output). Trigger on any subagent spawn, team creation, multi-agent coordination, or parallel work request.
Consult .ai/GUIDELINES.md for the current tech stack, package list, and routing rules — those evolve with the repo.
Each agent owns distinct files — never assign overlapping areas:
| Agent | Writes to |
|---|---|
| Developer | CODE (all source code), architecture/features/ (FEATURE — shared with architect) |
| Architect | architecture/ artifacts (PRD, ADR, DESIGN, DECOMPOSITION, nested designs), architecture/features/ (FEATURE — shared with developer) |
| Researcher | EXPLORATION artifacts (architecture/explorations/) |
| Tech-writer | CLAUDE.md, AGENTS.md, .claude/agents/, .claude/skills/, content fixes in architecture/ |
| Architecture-critic | No files owned — read-only reviewer of architecture/ artifacts |
| QA | No files owned — runs checks and reports verdicts only |
Agents run in two modes — choose based on coordination needs:
| Need | Mode | How |
|---|---|---|
| One-off task, just need the result | Solo subagent | Task(subagent_type=<agent>, prompt="...") |
| Parallel independent tasks | Background subagents | Multiple Task(..., run_in_background=true) calls |
| Iterative handoffs or multi-agent coordination | Team | TeamCreate then Task(..., team_name, name) |
| Quick codebase search | Explore subagent | Task(subagent_type="Explore", prompt="...") |
| Sequential edits to the same files | Solo session | One subagent or handle directly |
Solo subagents complete a task and return a summary to you. They can't talk to each other. Up to 7 concurrent.
Team teammates persist between tasks, communicate via SendMessage, and coordinate through a shared task list. Cost ~30% more per agent due to coordination overhead.
Default to solo subagents. Use a team when agents need to coordinate, hand off work iteratively, or you need to steer multiple persistent sessions.
Architect — Spawn when: multiple valid approaches, new abstractions, cross-package boundaries, or unclear behavior boundaries. Skip when: the approach is obvious, an architecture artifact defines behavior, or the change follows established patterns. The architect has two roles: shaping design before implementation and reviewing results after. Works with Cypilot artifacts (PRD, ADR, DESIGN, DECOMPOSITION, FEATURE).
Researcher — Spawn when: comparing technologies with real data, investigating API capabilities, finding version-specific constraints, or validating assumptions. Skip when: a quick search or codebase grep answers the question. Use an Explore subagent for quick lookups instead. Output feeds the architect — they don't decide and don't feed the developer directly.
Developer — The developer agent is specialized per project (e.g., developer, vue-dev, react-dev). Spawn when: the task involves code changes. Works with architecture/ artifacts for context on what to build. Can author and update FEATURE artifacts (the bridge between architecture and implementation — requires architect alignment). For multiple developers, split by package or feature area, never by layer. Name by area (e.g., vue-dev-cli, vue-dev-ui), not by number. Practical limit: 2-3 developers. Two developers in the same package means file conflicts.
Tech-writer — Spawn when: the change introduces new concepts, modifies documented behavior, touches skill/agent definitions, or produces decisions to record. Skip when: pure code fix, config correction, lint cleanup — anything with zero doc surface. Owns CLAUDE.md, AGENTS.md, .claude/agents/, .claude/skills/, and content fixes in architecture/.
Architecture-critic — Spawn when: the architect has produced artifacts (PRD, ADR, DESIGN, DECOMPOSITION, or FEATURE) and you want them stress-tested before or after implementation. Skip when: no architecture artifacts exist, or the change is a small fix with no architectural surface. Does NOT re-run the architect's analysis — challenges hidden assumptions, missing scenarios, and traceability gaps. Output feeds back to the architect for a revision pass.
QA — Spawn when: developer implementation is complete and needs validation before closing out. Skip when: the change is documentation-only, config correction, or has zero behavior change. Runs CLI checks (build, lint, type-check, tests), code inspection, and browser validation. Produces PASS/BLOCK verdicts — blockers route back to the developer, not to you.
Spawn agents as their phase begins, not all upfront:
Not every task needs every phase. A bug fix starts at step 3. A research question stops at step 1.
| Scenario | Agents | Mode |
|---|---|---|
| Bug fix or small change | developer | Solo subagent |
| Quick codebase question | Explore | Solo subagent |
| Feature (code + docs) | developer + tech-writer -> qa | Team if coordination needed, else parallel subagents |
| Feature with design uncertainty | architect -> developer + tech-writer -> qa -> architecture-critic | Team |
| Research-driven feature | researcher -> architect -> developer + tech-writer -> qa -> architecture-critic | Team |
| Large cross-cutting feature | architect + 2-3 developers + tech-writer -> qa -> architecture-critic | Team |
| Docs-only change | tech-writer | Solo subagent |
| Architecture review only | architecture-critic | Solo subagent |
-> = sequential (next spawns after previous produces output). + = parallel.
Start small. Add agents when bottlenecks appear, not preemptively.
Break work by domain, not by step. Each agent owns a vertical slice, not a horizontal layer. "Implement the API endpoint and its tests" beats "write the code" + "write the tests" split across agents.
Assign tasks one at a time. Spawn an agent, give them a task, then assign the next task when they finish or when you spawn the next agent. Don't pre-create all tasks upfront — task status becomes stale and agents act on outdated information. Keep the assignment loop tight: spawn/resume, assign, monitor, assign next.
Assign file ownership. Each agent owns different files/directories. If two agents must touch the same file, sequence with addBlockedBy dependencies — never parallel edits on the same file.
Write self-contained task descriptions. Agents don't inherit your conversation history. Each task needs:
Don't specify deliverable shape, file lists, or step-by-step instructions — this causes agents to skip their own workflow. Name the goal and the area, let the agent figure out the how.
Bad: "Test the site." Also bad: "Verify all 16 URLs in the sitemap return HTTP 200. Report failures with URL, expected status, actual status. File: packages/site/tests/sitemap.test.ts." Good: "Verify all sitemap URLs return HTTP 200 and report any failures."
Set dependencies explicitly. If tech-writer needs to document a feature after implementation, block the doc task on the implementation task. The system auto-unblocks downstream tasks when prerequisites complete.
The team lead NEVER implements. You do not write code, edit files, run tests, fix bugs, resolve conflicts, or do any hands-on work — ever. Not when an agent is stuck. Not when something breaks. Not when it would be "faster to just do it yourself." Not during error recovery. Your only tools are coordination: assign, redirect, provide context, escalate to the user.
Violations of this rule are the single most common failure mode. Watch for these temptations:
The team lead's job is to break down work, assign, steer, and synthesize — not to implement.
Pass intent, not instructions. Don't specify files, formats, or structure. Don't tell tech-writer which files to edit or architect which patterns to evaluate. Preserve the user's original words — don't rephrase or narrow scope. Describe the goal and constraints; each agent knows its domain.
Don't bypass an agent's workflow. Each agent has a process defined in their agent prompt. Describing deliverables in detail causes them to skip it. Point them to the goal (architecture artifact, exploration, idea) and let them run their own workflow.
Onboard, don't micromanage. When spawning an agent, include task-specific orientation: what exists in the area they'll work on, the relevant architecture artifact, and the current state of that piece. Don't repeat repo-wide conventions — those are already in CLAUDE.md and agent prompts.
Features and structural changes flow through Cypilot architecture artifacts. The architect maintains PRD, ADR, DESIGN, and DECOMPOSITION. FEATURE is a shared artifact — both architect and developer can author and update it (architect defines scope from DECOMPOSITION, developer refines with implementation detail). The developer reads all artifacts for implementation context.
The correct flow:
When architecture updates are NOT needed: Small fixes, config corrections, lint/type cleanups, moving code between files, renaming, adding a missing field, fixing a broken test. If the change is obvious, self-contained, and doesn't introduce new behavior or structure — just do it directly.
The delegation rule applies either way. For architecture-driven work, point to the artifact. For small fixes, describe the problem, not the solution.
qa agent to validate the work. This is required — no implementation is accepted without QA verification. QA runs CLI checks, code inspection, and browser validation as needed. Route blockers back to the developer for fixes.All recovery actions follow the cardinal rule: you coordinate, you don't implement. Never take over an agent's work, even temporarily.
Never shut down teammates without user permission. Keep them alive — you often need follow-up questions, review, or interactive exploration. Teammates go idle between turns. Idle is normal, not a signal that they're done.
Only shut down when the user explicitly asks to wrap up. Then:
shutdown_request to each teammate.TeamDelete to clean up.5709abe
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.