npx claudepluginhub psd401/psd-claude-plugins --plugin psd-coding-systemWant just this skill?
Then install: npx claudepluginhub u/[userId]/[slug]
Orchestrate parallel agent teams using Claude Code's experimental Agent Teams feature
This skill is limited to using the following tools:
Swarm Command
You orchestrate parallel agent teams for complex multi-agent workflows. This skill surfaces the swarm orchestration pattern documented in docs/patterns/swarm-orchestration.md.
Task: $ARGUMENTS
Phase 1: Check Environment
echo "=== Swarm Readiness Check ==="
# Check if Agent Teams is enabled
if [ -n "$CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS" ]; then
echo "Agent Teams: ENABLED"
SWARM_MODE="agent-teams"
else
echo "Agent Teams: NOT ENABLED (falling back to parallel Task dispatch)"
echo ""
echo "To enable Agent Teams (experimental):"
echo " export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1"
echo ""
SWARM_MODE="task-parallel"
fi
echo "Swarm mode: $SWARM_MODE"
Phase 2: Decompose the Task
Break the user's task into parallelizable work units. For each unit, identify:
- Agent type — which specialized agent should handle this?
- Dependencies — does this unit depend on another completing first?
- Inputs — what context does the agent need?
- Outputs — what should the agent produce?
Present the decomposition:
### Task Decomposition
| # | Work Unit | Agent | Depends On | Parallel Group |
|---|-----------|-------|------------|----------------|
| 1 | [desc] | [agent type] | — | A |
| 2 | [desc] | [agent type] | — | A |
| 3 | [desc] | [agent type] | 1, 2 | B |
Parallel groups run simultaneously. Group B waits for Group A to complete.
Phase 3: Dispatch
Task-Parallel Mode (Default)
Use multiple Task tool invocations in a single message to achieve parallelism:
For each work unit in Parallel Group A:
Task tool invocation:
subagent_type: [appropriate agent]
description: "[work unit description]"
prompt: "[detailed prompt with context and expected output format]"
Wait for Group A results.
For each work unit in Parallel Group B:
Task tool invocation:
subagent_type: [appropriate agent]
description: "[work unit description]"
prompt: "[detailed prompt with Group A results as context]"
Key rules:
- Launch ALL agents in the same parallel group in a single message
- Never launch dependent work units before their dependencies complete
- Include full context in each agent prompt (agents don't share memory)
- Set
run_in_background: truefor long-running agents if you have other work to do
Agent Teams Mode (Experimental)
If Agent Teams is enabled, use the TeammateTool and InboxTool pattern instead:
- Spawn teammates for each work unit
- Each teammate works independently
- Leader monitors inboxes for results
- Leader synthesizes findings as they arrive
Note: Agent Teams is experimental. If it fails, fall back to Task-Parallel mode.
Phase 4: Synthesize
After all work units complete:
- Collect results from all agents
- Resolve conflicts — if agents disagree, present both perspectives
- Identify gaps — what did no agent cover?
- Produce unified output — combine into a single coherent result
### Swarm Results
**Mode:** [task-parallel | agent-teams]
**Agents dispatched:** [count]
**Parallel groups:** [count]
#### Findings
[Synthesized results organized by theme, not by agent]
#### Conflicts
[Areas where agents disagreed, with both perspectives]
#### Gaps
[Areas no agent covered that may need follow-up]
#### Recommended Next Steps
[What to do with these results]
Common Swarm Patterns
Code Review Swarm
Dispatch security-analyst, typescript-reviewer, architecture-strategist, and code-simplicity-reviewer in parallel against the same diff.
Research Swarm
Dispatch learnings-researcher, best-practices-researcher, framework-docs-researcher, and repo-research-analyst in parallel on different aspects of a question.
Implementation Swarm
Dispatch frontend-specialist and backend-specialist in parallel for full-stack features, then work-validator to review both.
Guidelines
- Minimum 2 agents — if only 1 agent is needed, use Task directly instead of /swarm
- Maximum 6 agents per group — more than 6 parallel agents is diminishing returns
- Include full context — each agent gets its own prompt; don't assume shared knowledge
- Prefer Task-Parallel — it's stable and production-ready. Agent Teams is experimental.
Similar Skills
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.