// Coordinate multiple specialized Skills and Task Agents through parallel, sequential, swarm, hybrid, or iterative execution strategies. CRITICAL - Skills use Skill tool (rust-code-quality, architecture-validation, plan-gap-analysis), Task Agents use Task tool (code-reviewer, test-runner, debugger, loop-agent). Use this when orchestrating multi-worker workflows, managing dependencies, or optimizing complex task execution with quality gates.
| name | agent-coordination |
| description | Coordinate multiple specialized Skills and Task Agents through parallel, sequential, swarm, hybrid, or iterative execution strategies. CRITICAL - Skills use Skill tool (rust-code-quality, architecture-validation, plan-gap-analysis), Task Agents use Task tool (code-reviewer, test-runner, debugger, loop-agent). Use this when orchestrating multi-worker workflows, managing dependencies, or optimizing complex task execution with quality gates. |
Coordinate multiple specialized agents to solve complex multi-step tasks efficiently through strategic execution patterns.
Use When: Independent tasks, no dependencies, maximize throughput
Implementation:
Example:
Task: "Review code and run tests"
โโ code-reviewer: Review code quality
โโ test-runner: Execute test suite
Execution: One message, both Task tools
Use When: Strong dependencies, each task needs previous output
Implementation:
Example:
Task: "Implement feature, test it, then review"
โโ feature-implementer: Build feature
โโ test-runner: Test implementation
โโ code-reviewer: Review code
Execution: Sequential messages with context transfer
Use When: Complex problem needs multiple perspectives
Implementation:
Example A - Skill-Based Swarm (Analysis/Review):
Task: "Validate v0.1.0 implementation quality"
Phase 1 [Parallel Skills]:
โโ Skill(command="rust-code-quality")
โโ Skill(command="architecture-validation")
โโ Skill(command="plan-gap-analysis")
Phase 2: Synthesize findings โ identify gaps and issues
Phase 3: Create prioritized action plan
Example B - Agent-Based Swarm (Execution/Testing):
Task: "Diagnose performance degradation"
Phase 1 [Parallel Agents]:
โโ Task(subagent_type="debugger", prompt="Profile runtime performance")
โโ Task(subagent_type="code-reviewer", prompt="Analyze code efficiency")
โโ Task(subagent_type="test-runner", prompt="Run performance benchmarks")
Phase 2: Synthesize findings โ identify root cause
Phase 3: Apply coordinated fix
Use When: Complex workflows with mixed dependencies
Implementation:
Example:
Task: "Refactor module, update tests, verify"
Phase 1 [Parallel]: Assessment
โโ code-reviewer: Assess current code
โโ test-runner: Run existing tests
Phase 2 [Sequential]: Implementation
โโ refactorer: Apply improvements
Phase 3 [Parallel]: Validation
โโ test-runner: Verify refactored code
โโ code-reviewer: Final quality check
Use When: Tasks require progressive refinement until criteria met
Implementation:
Example:
Task: "Iteratively improve code quality until standards met"
Loop Configuration:
- Max Iterations: 5
- Success: All clippy warnings resolved + tests pass
- Agent: refactorer
Execution: loop-agent orchestrates iterations
Iteration 1: refactorer โ 15 issues โ Continue
Iteration 2: refactorer โ 3 issues โ Continue
Iteration 3: refactorer โ 0 issues โ โ Success
Use loop-agent for: test-fix-retest cycles, performance optimization loops,
progressive quality improvements, convergence-based refinement
There are TWO different types of workers you can coordinate:
Skill tool)Skills are instruction sets that guide Claude directly. They provide specialized knowledge and workflows.
How to invoke: Skill(command="skill-name")
Available Skills:
rust-code-quality - Comprehensive Rust code quality reviewarchitecture-validation - Validate implementation vs architecture plansplan-gap-analysis - Compare plans vs actual implementationanalysis-swarm - Multi-perspective code analysis (RYAN, FLASH, SOCRATES)test-fix - Systematic test debugging and fixingbuild-compile - Build and compilation managementdebug-troubleshoot - Debug async Rust issuesfeature-implement - Feature implementation workflowstorage-sync - Storage synchronization between Turso and redbtask-decomposition - Break down complex tasksTask tool)Task Agents are autonomous sub-processes that execute tasks independently using tools.
How to invoke: Task(subagent_type="agent-name", prompt="...", description="...")
Available Task Agents:
| Agent | Best For | Inputs | Outputs |
|---|---|---|---|
| code-reviewer | Quality, standards | Code changes | Review report, issues |
| test-runner | Testing, verification | Code to test | Test results, coverage |
| feature-implementer | New functionality | Requirements | Implementation, tests |
| refactorer | Code improvement | Code to refactor | Improved code |
| debugger | Issue diagnosis | Issue description | Root cause, fix |
| agent-creator | Create new agents | Agent requirements | New agent file |
| goap-agent | Complex multi-step tasks | Task description | Coordinated execution |
| loop-agent | Iterative refinement | Initial state + criteria | Refined result |
| analysis-swarm | Multi-perspective analysis | Code/design to analyze | Consensus analysis |
Use Skills when:
Use Task Agents when:
Pattern 1: Skill-Based Swarm (for analysis tasks)
Phase 1 [Parallel Skills]:
โโ Skill(command="rust-code-quality")
โโ Skill(command="architecture-validation")
โโ Skill(command="plan-gap-analysis")
Phase 2: Synthesize findings
Phase 3: Create action plan
Pattern 2: Agent-Based Swarm (for execution tasks)
Phase 1 [Parallel Agents]:
โโ Task(subagent_type="code-reviewer", ...)
โโ Task(subagent_type="test-runner", ...)
โโ Task(subagent_type="debugger", ...)
Phase 2: Aggregate results
Phase 3: Apply fixes
Pattern 3: Hybrid Coordination (combine Skills and Agents)
Phase 1: Skill(command="task-decomposition") # Plan the work
Phase 2 [Parallel Agents]: # Execute in parallel
โโ Task(subagent_type="feature-implementer", ...)
โโ Task(subagent_type="test-runner", ...)
Phase 3: Skill(command="rust-code-quality") # Validate quality
Decision Matrix:
Match Tasks to Agents:
## Execution Plan
### Strategy: [Parallel/Sequential/Swarm/Hybrid]
### Phase 1: [Name]
**Mode**: [Parallel/Sequential]
**Agents**:
- Agent: [name] | Task: [description] | Deps: [dependencies]
**Quality Gate**:
- [Validation criteria]
### Overall Success Criteria:
- [Criterion 1]
- [Criterion 2]
Monitoring Checklist:
Validation Gates (between phases):
## Execution Summary
### Completed Tasks:
- [Task 1]: โ [Agent] - [Outcome]
### Deliverables:
- [Item 1]: [Location/Description]
### Quality Validation:
- [Criterion 1]: โ Met
### Performance Metrics:
- Total time: [duration]
- Success rate: [percentage]
Context Transfer:
Agent A completes, produces output X
Message to Agent B:
"Previous agent (A) produced X. Use this as input.
Task: [specific instructions for B]
Success criteria: [how to validate]"
Parallel Convergence:
Quality Gates:
Retry: For transient failures (max 2-3 attempts) Alternative Approach: Different agent or technical approach Plan Adjustment: Remove optional tasks, simplify requirements Graceful Degradation: Partial completion with documentation
| Scenario | Response |
|---|---|
| Agent reports failure | Analyze reason, retry with adjusted params or find alternative |
| Quality gate fails | Stop dependent tasks, diagnose, fix, re-execute |
| Blocked dependency | Identify blocker, work around, reorder if possible |
โ Use Skill tool for analysis/review tasks (rust-code-quality, architecture-validation, plan-gap-analysis) โ Use Task tool for execution tasks (code-reviewer, test-runner, feature-implementer) โ Choose appropriate strategy for task dependencies โ Match workers (Skills/Agents) to tasks based on capabilities โ Validate at quality gates before proceeding โ Provide clear context in handoffs โ Monitor progress during execution โ Handle errors gracefully with recovery โ Aggregate results comprehensively
โ Use Task tool with skill names (e.g., Task(subagent_type="rust-code-quality") โ ERROR!) โ Use Skill tool with agent names (e.g., Skill(command="code-reviewer") โ May not work as expected) โ Force parallel execution when dependencies exist โ Assign tasks to inappropriate workers โ Skip quality validation โ Proceed after failed quality gates โ Provide insufficient context
The GOAP agent uses this skill as its core coordination engine:
Cause: Trying to use a Skill name with the Task tool
Example of Error:
Task(subagent_type="rust-code-quality", ...)
โ ERROR: Agent type 'rust-code-quality' not found
Solution: Use the Skill tool instead:
Skill(command="rust-code-quality")
โ SUCCESS
Available Task Agents ONLY:
Everything else is a Skill - use Skill(command="...")
| Task Type | Tool | Example |
|---|---|---|
| Rust code quality review | Skill | Skill(command="rust-code-quality") |
| Architecture validation | Skill | Skill(command="architecture-validation") |
| Plan gap analysis | Skill | Skill(command="plan-gap-analysis") |
| Multi-perspective analysis | Skill | Skill(command="analysis-swarm") |
| Run tests | Task | Task(subagent_type="test-runner", ...) |
| Review code changes | Task | Task(subagent_type="code-reviewer", ...) |
| Implement feature | Task | Task(subagent_type="feature-implementer", ...) |
| Debug issues | Task | Task(subagent_type="debugger", ...) |
| Refactor code | Task | Task(subagent_type="refactorer", ...) |
| Iterative refinement | Task | Task(subagent_type="loop-agent", ...) |
Skill tool)Task tool)Effective agent coordination requires:
Use this skill to coordinate any multi-agent workflow effectively.