multi-agent-coordination
Coordinate multiple agents in parallel or sequential workflows. Use when running agents simultaneously, delegating to sub-agents, switching between specialized agents, or managing agent selection. Trigger keywords - "parallel agents", "sequential workflow", "delegate", "multi-agent", "sub-agent", "agent switching", "task decomposition".
What this skill does
# Multi-Agent Coordination
**Version:** 1.0.0
**Purpose:** Patterns for coordinating multiple agents in complex workflows
**Status:** Production Ready
## Overview
Multi-agent coordination is the foundation of sophisticated Claude Code workflows. This skill provides battle-tested patterns for orchestrating multiple specialized agents to accomplish complex tasks that are beyond the capabilities of a single agent.
The key challenge in multi-agent systems is **dependencies**. Some tasks must execute sequentially (one agent's output feeds into another), while others can run in parallel (independent validations from different perspectives). Getting this right is the difference between a 5-minute workflow and a 15-minute one.
This skill teaches you:
- When to run agents in **parallel** vs **sequential**
- How to **select the right agent** for each task
- How to **delegate** to sub-agents without polluting context
- How to manage **context windows** across multiple agent calls
## Core Patterns
### Pattern 1: Sequential vs Parallel Execution
**When to Use Sequential:**
Use sequential execution when there are **dependencies** between agents:
- Agent B needs Agent A's output as input
- Workflow phases must complete in order (plan → implement → test → review)
- Each agent modifies shared state (same files)
**Example: Multi-Phase Implementation**
```
Phase 1: Architecture Planning
Task: api-architect
Output: ai-docs/architecture-plan.md
Wait for completion ✓
Phase 2: Implementation (depends on Phase 1)
Task: backend-developer
Input: Read ai-docs/architecture-plan.md
Output: src/auth.ts, src/routes.ts
Wait for completion ✓
Phase 3: Testing (depends on Phase 2)
Task: test-architect
Input: Read src/auth.ts, src/routes.ts
Output: tests/auth.test.ts
```
**When to Use Parallel:**
Use parallel execution when agents are **independent**:
- Multiple validation perspectives (designer + tester + reviewer)
- Multiple AI models reviewing same code (Grok + Gemini + Claude)
- Multiple feature implementations in separate files
**Example: Multi-Perspective Validation**
```
Single Message with Multiple Task Calls:
Task: designer
Prompt: Validate UI against Figma design
Output: ai-docs/design-review.md
---
Task: ui-manual-tester
Prompt: Test UI in browser for usability
Output: ai-docs/testing-report.md
---
Task: senior-code-reviewer
Prompt: Review code quality and patterns
Output: ai-docs/code-review.md
All three execute simultaneously (3x speedup!)
Wait for all to complete, then consolidate results.
```
**The 4-Message Pattern for True Parallel Execution:**
This is **CRITICAL** for achieving true parallelism:
```
Message 1: Preparation (Bash Only)
- Create workspace directories
- Validate inputs
- Write context files
- NO Task calls, NO TodoWrite
Message 2: Parallel Execution (Task Only)
- Launch ALL agents in SINGLE message
- ONLY Task tool calls
- Each Task is independent
- All execute simultaneously
Message 3: Consolidation (Task Only)
- Launch consolidation agent
- Automatically triggered when N agents complete
Message 4: Present Results
- Show user final consolidated results
- Include links to detailed reports
```
**Anti-Pattern: Mixing Tool Types Breaks Parallelism**
```
❌ WRONG - Executes Sequentially:
await TodoWrite({...}); // Tool 1
await Task({...}); // Tool 2 - waits for TodoWrite
await Bash({...}); // Tool 3 - waits for Task
await Task({...}); // Tool 4 - waits for Bash
✅ CORRECT - Executes in Parallel:
await Task({...}); // Task 1
await Task({...}); // Task 2
await Task({...}); // Task 3
// All execute simultaneously
```
**Why Mixing Fails:**
Claude Code sees different tool types and assumes there are dependencies between them, forcing sequential execution. Using a single tool type (all Task calls) signals that operations are independent and can run in parallel.
---
### Pattern 2: Agent Selection by Task Type
**Task Detection Logic:**
Intelligent workflows automatically detect task type and select appropriate agents:
```
Task Type Detection:
IF request mentions "API", "endpoint", "backend", "database":
→ API-focused workflow
→ Use: api-architect, backend-developer, test-architect
→ Skip: designer, ui-developer (not relevant)
ELSE IF request mentions "UI", "component", "design", "Figma":
→ UI-focused workflow
→ Use: designer, ui-developer, ui-manual-tester
→ Optional: ui-developer-codex (external validation)
ELSE IF request mentions both API and UI:
→ Mixed workflow
→ Use all relevant agents from both categories
→ Coordinate between backend and frontend agents
ELSE IF request mentions "test", "coverage", "bug":
→ Testing-focused workflow
→ Use: test-architect, ui-manual-tester
→ Optional: codebase-detective (for bug investigation)
ELSE IF request mentions "review", "validate", "feedback":
→ Review-focused workflow
→ Use: senior-code-reviewer, designer, ui-developer
→ Optional: external model reviewers
```
**Agent Capability Matrix:**
| Task Type | Primary Agent | Secondary Agent | Optional External |
|-----------|---------------|-----------------|-------------------|
| API Implementation | backend-developer | api-architect | - |
| UI Implementation | ui-developer | designer | ui-developer-codex |
| Testing | test-architect | ui-manual-tester | - |
| Code Review | senior-code-reviewer | - | codex-code-reviewer |
| Architecture Planning | api-architect OR frontend-architect | - | plan-reviewer |
| Bug Investigation | codebase-detective | test-architect | - |
| Design Validation | designer | ui-developer | designer-codex |
**Agent Switching Pattern:**
Some workflows benefit from **adaptive agent selection** based on context:
```
Example: UI Development with External Validation
Base Implementation:
Task: ui-developer
Prompt: Implement navbar component from design
User requests external validation:
→ Switch to ui-developer-codex OR add parallel ui-developer-codex
→ Run both: embedded ui-developer + external ui-developer-codex
→ Consolidate feedback from both
Scenario 1: User wants speed
→ Use ONLY ui-developer (embedded, fast)
Scenario 2: User wants highest quality
→ Use BOTH ui-developer AND ui-developer-codex (parallel)
→ Consensus analysis on feedback
Scenario 3: User is out of credits
→ Fallback to ui-developer only
→ Notify user external validation unavailable
```
---
### Pattern 3: Sub-Agent Delegation
**File-Based Instructions (Context Isolation):**
When delegating to sub-agents, use **file-based instructions** to avoid context pollution:
```
✅ CORRECT - File-Based Delegation:
Step 1: Write instructions to file
Write: ai-docs/architecture-instructions.md
Content: "Design authentication system with JWT tokens..."
Step 2: Delegate to agent with file reference
Task: api-architect
Prompt: "Read instructions from ai-docs/architecture-instructions.md
and create architecture plan."
Step 3: Agent reads file, does work, writes output
Agent reads: ai-docs/architecture-instructions.md
Agent writes: ai-docs/architecture-plan.md
Step 4: Agent returns brief summary ONLY
Return: "Architecture plan complete. See ai-docs/architecture-plan.md"
Step 5: Orchestrator reads output file if needed
Read: ai-docs/architecture-plan.md
(Only if orchestrator needs to process the output)
```
**Why File-Based?**
- **Avoids context pollution:** Long user requirements don't bloat orchestrator context
- **Reusable:** Multiple agents can read same instruction file
- **Debuggable:** Files persist after workflow completes
- **Clean separation:** Input file, output file, orchestrator stays lightweight
**Anti-Pattern: Inline Delegation**
```
❌ WRONG - Context Pollution:
Task: api-architect
Prompt: "Design authentication system with:
- JWT tokens with refresh token rotation
- Email/password login with bcrypt hashing
- OAuth2 integratiRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.