dispatching-parallel-agents
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when you have a spec or requirements for a multi-step task, before touching code
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Use when starting implementation tasks and need to research dependencies and find reference implementations before writing any code
Retrieves up-to-date documentation, API references, and code examples for any developer technology. Use this skill whenever the user asks about a specific library, framework, SDK, CLI tool, or cloud service -- even for well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. Your training data may not reflect recent API changes or version updates. Always use for: API syntax questions, configuration options, version migration issues, "how do I" questions mentioning a library name, debugging that involves library-specific behavior, setup instructions, and CLI tool usage. Use even when you think you know the answer -- do not rely on training data for API details, signatures, or configuration options as they are frequently outdated. Always verify against current docs. Prefer this over web search for library documentation and API details.
Research official documentation for technologies in a spec, generating actionable guides for implementation planning
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.
| name | dispatching-parallel-agents |
| description | Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies |
Before running this skill, you MUST check if team mode is enabled.
Check settings.json for:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
If team mode is NOT enabled:
⚠️ Team mode is required for parallel agent dispatch.
To enable, add this to your settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
Then restart Claude Code and try again.
If team mode is enabled, proceed with the workflow below.
Use Claude Code Agent Teams to dispatch parallel agents with shared task coordination. Each teammate works on independent tasks concurrently while the lead orchestrates and synthesizes results.
When to use:
TeamCreate({
team_name: "parallel-[feature]-[timestamp]",
description: "Parallel execution of [task description]",
agent_type: "coordinator"
})
For each independent task:
TaskCreate({
subject: "[Task name]",
description: "[Detailed description of what to do]",
activeForm: "[What the agent is doing]"
})
IMPORTANT: Only spawn implementers as team members. Verifiers are spawned by implementers themselves (self-verification loop).
For each task, spawn a teammate:
Agent({
description: "[Task description]",
prompt: `## Your Task
[Task description from TaskGet]
Task ID: [from TaskGet]
## TDD Requirement
You MUST follow Red-Green-Refactor:
1. Write a failing test FIRST (RED)
2. Run test to confirm it fails
3. Write minimal code to pass (GREEN)
4. Run test to confirm it passes
5. Refactor if needed
## Self-Verification (MANDATORY)
After completing your implementation:
1. Spawn a verifier (see ./references/VERIFIER_SPAWN_TEMPLATE.md)
2. Wait for verifier's report
3. If PASS: Notify lead with "Task [ID] verified and complete"
4. If FAIL: Read issues, fix, spawn new verifier, repeat
## Report to Lead
When verifier reports PASS:
"Task [ID] verified and complete"`,
subagent_type: "general-purpose",
name: "[unique-name]",
team_name: "parallel-[feature]-[timestamp]"
})
Team members = implementers only (they self-verify)
Lead tracks via TaskList:
in_progress = implementer working OR verifyingcompleted = verifier reported PASSLead acts when:
Lead Flow:
Send task to implementer
↓
Wait for "verified and complete"
↓
If no response after [timeout]:
→ Send reminder: "Please verify your work"
→ Implementer must respond with status
After all tasks complete:
// Shutdown each teammate
SendMessage({
to: "[teammate-name]",
message: "Please shut down - all tasks are complete"
})
// After all confirmations, delete the team
TeamDelete()
// Direct message to one teammate
SendMessage({
to: "researcher-1",
summary: "Task assignment",
message: "Your task is to investigate..."
})
// Broadcast to all
SendMessage({
to: "*",
summary: "Status update",
message: "All tasks complete, wrapping up"
})
// Update task status
TaskUpdate({
taskId: "task-1",
status: "completed"
})
// Check task list
TaskList()
// Get task details
TaskGet({ taskId: "task-1" })
pending — Waiting to be claimedin_progress — Being worked oncompleted — Done❌ No feature flag check — TeamCreate fails without experimental flag
✅ Check first — Verify CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
❌ Unfocused scope — "Fix all tests" - agent gets lost ✅ Specific — "Fix {file} only" - narrow scope
❌ No output specification — "Fix it" - you don't know what changed ✅ Specific — "Report root cause and test results"
❌ Teammate runs cleanup — Can cause resource inconsistency ✅ Lead runs cleanup — Always use lead to execute TeamDelete()
Related failures: Fixing one might fix others - investigate together first Need full context: Understanding requires seeing entire system Exploratory debugging: You don't know what's broken yet Shared state: Agents would interfere (editing same files)
in_progress until "verified and complete"