Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Multi-agent coordination patterns for building effective AI teams
.claude/skills/majiayu000-agent-orchestration-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 68% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 116% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 165% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 85% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 81% | 0% |
> Build coordinated AI teams that work together seamlessly
This skill provides battle-tested patterns for orchestrating multiple AI agents to solve complex problems collaboratively.
Each agent should have one clear purpose. Generalists create confusion; specialists create excellence.
yamlBad: GeneralAgent: "Does everything - UI, backend, writing, testing" Good: FrontendAgent: "React components, styling, accessibility" BackendAgent: "APIs, database, business logic" TestAgent: "Unit tests, integration tests, E2E"
Define how agents share information, hand off work, and resolve conflicts.
yamlHandoff Protocol: From: BackendAgent To: FrontendAgent Includes: - API contract (types, endpoints) - Example payloads - Error scenarios - Authentication requirements
One agent coordinates; others execute. Prevents chaos and conflicting directions.
┌─────────────────┐
│ ORCHESTRATOR │
│ (Coordinates) │
└────────┬────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Agent A │ │ Agent B │ │ Agent C │
│ (Executes) │ │ (Executes) │ │ (Executes) │
└───────────────┘ └───────────────┘ └───────────────┘Best for: Tasks with clear dependencies where each step requires the previous step's output.
yamlPipeline: 1. Research Agent → Gathers information 2. Analysis Agent → Processes findings (needs step 1) 3. Writing Agent → Creates content (needs step 2) 4. Review Agent → Quality check (needs step 3)
Implementation:
markdown## Sequential Pipeline Protocol ### Step 1: Research Phase **Agent:** Research Agent **Input:** User query **Output:** Structured research document **Completion Signal:** "Research complete. Findings ready for analysis." ### Step 2: Analysis Phase **Agent:** Analysis Agent **Input:** Research document from Step 1 **Output:** Analyzed insights with recommendations **Completion Signal:** "Analysis complete. Ready for content creation." ### Step 3: Writing Phase **Agent:** Writing Agent **Input:** Analysis from Step 2 **Output:** Draft content **Completion Signal:** "Draft complete. Ready for review." ### Step 4: Review Phase **Agent:** Review Agent **Input:** Draft from Step 3 **Output:** Final content with quality assessment **Completion Signal:** "Review complete. Content finalized."
Best for: Independent tasks that can run simultaneously.
yamlFan-Out: Orchestrator splits task into: - Agent A: Frontend components - Agent B: Backend APIs - Agent C: Database schema Fan-In: - Orchestrator collects results - Integrates into unified solution
Implementation:
markdown## Parallel Fan-Out Protocol ### Split Phase **Orchestrator Action:** Divide task into independent workstreams **Criteria for parallelization:** - No shared state dependencies - No sequential requirements - Clear interface contracts defined ### Parallel Execution **Agent A:** [Task description] - Works independently - Reports completion status **Agent B:** [Task description] - Works independently - Reports completion status **Agent C:** [Task description] - Works independently - Reports completion status ### Integration Phase **Orchestrator Action:** - Wait for all agents to complete - Resolve any interface conflicts - Integrate outputs into unified result
Best for: Tasks requiring domain expertise at specific points.
yamlConsultation: Primary Agent working... → Hits domain-specific challenge → Consults Specialist Agent → Receives expert guidance → Continues with enhanced solution
Implementation:
markdown## Specialist Consultation Protocol ### Recognition Triggers The primary agent should consult a specialist when: - Task requires domain-specific knowledge - Decision has significant architectural impact - Quality standard requires expert validation - Risk mitigation requires specialized review ### Consultation Format **From:** [Primary Agent] **To:** [Specialist Agent] **Context:** [What we're building] **Question:** [Specific question] **Constraints:** [Relevant limitations] **Expected Output:** [What we need back] ### Response Integration Specialist provides: - Direct answer to question - Reasoning behind recommendation - Potential alternatives considered - Caveats or edge cases
Best for: Complex decisions where multiple perspectives improve outcomes.
yamlDebate: Agent A: Argues for Approach 1 Agent B: Argues for Approach 2 Agent C: Synthesizes best of both Orchestrator: Makes final decision
Implementation:
markdown## Debate & Synthesis Protocol ### Phase 1: Position Development **Agent A:** Develops Position 1 - State the approach clearly - List all advantages - Acknowledge weaknesses - Provide implementation path **Agent B:** Develops Position 2 - State the approach clearly - List all advantages - Acknowledge weaknesses - Provide implementation path ### Phase 2: Critique Each agent critiques the other's position: - What's missing? - What's overestimated? - What edge cases are unhandled? ### Phase 3: Synthesis **Synthesis Agent:** - Extract best elements from each position - Resolve contradictions - Propose hybrid solution if beneficial ### Phase 4: Decision **Orchestrator:** - Evaluate all positions and synthesis - Make final decision with reasoning - Document decision rationale
Best for: Large projects requiring multiple levels of coordination.
┌─────────────────┐
│ ORCHESTRATOR │
│ (Strategic) │
└────────┬────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Team Lead A │ │ Team Lead B │ │ Team Lead C │
│ (Tactical) │ │ (Tactical) │ │ (Tactical) │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
┌──────┴──────┐ ┌──────┴──────┐ ┌──────┴──────┐
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
┌───────┐ ┌───────┐ ... ... ... ...
│Agent 1│ │Agent 2│
└───────┘ └───────┘yamlMessage: from: "agent_id" to: "agent_id" type: "request|response|status|handoff" priority: "low|normal|high|critical" content: summary: "Brief description" details: "Full content" artifacts: ["list of outputs"] context: conversation_id: "unique_id" parent_message: "optional_id" related_tasks: ["task_ids"]
yamlStatus Update: agent: "agent_id" timestamp: "ISO 8601" status: "idle|working|blocked|complete|error" current_task: "description" progress: "0-100%" blockers: ["list of blockers"] next_steps: ["planned actions"] estimated_completion: "optional timestamp"
yamlError Report: agent: "agent_id" severity: "warning|error|critical" error_type: "category" description: "what went wrong" attempted_solutions: ["what we tried"] suggested_actions: ["what might help"] requires_human: true|false blocks_progress: true|false
Problem: One agent tries to do everything Symptom: Inconsistent quality, context overload Solution: Split into specialized agents
Problem: Agent A waits for B, B waits for C, C waits for A Symptom: Deadlock, no progress Solution: Identify and break cycles, define clear ordering
Problem: Agent works without status updates Symptom: Orchestrator has no visibility, surprises at completion Solution: Require regular status reports
Problem: Orchestrator controls every small decision Symptom: Bottleneck at orchestrator, slow progress Solution: Delegate decisions within boundaries
Problem: Agent expands task beyond assignment Symptom: Delayed completion, unnecessary work Solution: Clear scope definition, confirmation before expansion
yamlTeam: Architect: Role: Orchestrator + Technical decisions Responsibilities: Planning, coordination, architecture Builder: Role: Implementation Responsibilities: Frontend, backend, integrations Validator: Role: Quality assurance Responsibilities: Testing, review, documentation
yamlTeam: Architect: Role: Orchestrator Frontend: Role: UI specialist Backend: Role: API/data specialist DevOps: Role: Infrastructure QA: Role: Testing specialist
yamlTeam: Product: Strategist: Vision and roadmap Designer: UX/UI design Engineering: Architect: Technical leadership Frontend: UI implementation Backend: Services implementation DevOps: Infrastructure QA: Testing Content: Writer: Documentation, copy
yaml# .claude/agents/example-agent.md --- name: Example Agent description: What this agent does model: sonnet|opus mcpServers: - server-name workingDirectories: - /path/to/focus --- # Agent Name ## Mission What this agent aims to accomplish. ## Responsibilities - Specific duty 1 - Specific duty 2 ## Capabilities - What tools/skills it can use ## Communication Protocol How it reports status and coordinates.
yaml# Reference this skill in your session Skills: - .claude/skills/community/agent-orchestration
"A team of specialized agents, well-coordinated, will always outperform a single generalist."
Other measured skills in the registry, with their headline benchmark lift.