Agent skill
Multi-Agent Coordination
This skill should be used when the user asks about "multi-agent coordination", "agent spawning", "parallel agents", "agent communication", "team coordination", "sub-agent management", "agent limits", "agent layers", or needs guidance on coordinating multiple agents for complex tasks.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/multi-agent-coordination-lobbi-docs-claude-2
SKILL.md
Multi-Agent Coordination
Establish effective coordination between multiple agents working on complex tasks, ensuring proper communication, resource sharing, and conflict resolution.
Agent Spawning Guidelines
Mandatory Limits (ENFORCED)
| Constraint | Value | Enforcement |
|---|---|---|
| Minimum Agents | 3 per complex task | Hook-enforced |
| Maximum Agents | 13 per task | Hard limit |
| Recommended | 5-7 agents | Optimal performance |
When to Spawn Agents
Always spawn agents for:
- Tasks requiring more than 3 steps
- Work spanning multiple files/components
- Tasks requiring diverse expertise
- Parallel workstreams
Single agent sufficient for:
- Simple file edits
- Quick lookups
- Straightforward questions
Agent Layer Architecture
Organize agents into functional layers for clear responsibility separation:
Strategic Layer
- Role: High-level planning and decision-making
- Agents: master-strategist, architect-supreme, risk-assessor
- Output: Plans, architectural decisions, risk assessments
Tactical Layer
- Role: Coordination and resource management
- Agents: plan-decomposer, resource-allocator, conflict-resolver
- Output: Task breakdowns, schedules, conflict resolutions
Operational Layer
- Role: Direct implementation work
- Agents: coder, tester, reviewer, debugger
- Output: Code, tests, reviews, fixes
Quality Layer
- Role: Validation and documentation
- Agents: test-strategist, security-specialist, documentation-expert
- Output: Test plans, security audits, documentation
Parallel Execution Strategy
Level-Based Parallelization
Level 0: [Agent A] [Agent B] [Agent C] ← Execute in parallel
↓ ↓ ↓
Level 1: [Agent D] [Agent E] ← Wait for L0, then parallel
↓ ↓
Level 2: [Agent F] ← Wait for L1
Dependency Rules
- Agents at same level execute concurrently
- Level N+1 waits for all Level N completion
- Independent agents always run in parallel
- Shared resources require coordination
Communication Patterns
Message Types
| Type | Purpose | Priority |
|---|---|---|
| TASK | Assign work to agent | High |
| STATUS | Progress updates | Medium |
| RESULT | Completed work output | High |
| HANDOFF | Transfer context to next agent | Critical |
| ERROR | Failure notification | Critical |
Handoff Protocol
When transferring work between agents:
-
Context Package
- Task description and objectives
- Files modified/created
- Decisions made and rationale
- Known issues or blockers
-
State Transfer
- Current phase and progress
- Pending tasks
- Dependencies resolved/pending
-
Verification
- Receiving agent confirms context
- Missing information requested
- Handoff logged for audit
Conflict Resolution
Resource Conflicts
When multiple agents need the same resource:
- Priority-Based: Higher-layer agents get priority
- Time-Based: First requester wins
- Merge-Based: Combine compatible changes
- Escalation: Strategic layer decides
Decision Conflicts
When agents disagree on approach:
- Document both positions
- Escalate to strategic layer
- Strategic agent decides with rationale
- Decision logged for learning
Agent Lifecycle
Spawning
- Define clear scope and objectives
- Assign layer and role
- Provide initial context
- Set success criteria
Monitoring
- Track progress against objectives
- Monitor resource usage
- Detect stuck/blocked states
- Log all significant actions
Completion
- Verify deliverables against objectives
- Package outputs for next phase
- Document lessons learned
- Clean up resources
Best Practices
DO:
- Spawn minimum 3 agents for complex tasks
- Use parallel execution for independent work
- Include quality layer agents in every task
- Document all handoffs
- Set clear success criteria
DON'T:
- Exceed 13 agents per task
- Skip testing agents
- Allow single agent for complex work
- Ignore conflicts between agents
- Lose context during handoffs
Additional Resources
Reference Files
references/agent-layer-details.md- Detailed layer specificationsreferences/communication-protocols.md- Message format specifications
Examples
examples/parallel-execution.json- Sample parallel execution planexamples/handoff-package.json- Sample context handoff structure
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?