agentleFS
patonkikhpatonkikh/APES/skills/ai/multi-agent-planner/skill.md

multi-agent-planner

Skill3 starsChanged 4 months agoMITView on GitHub

Design a multi-agent orchestration architecture: agent roles, communication patterns, handoff protocols, and failure recovery for collaborative AI systems. Use when working on prompt engineering, AI workflows, agents, context design, or LLM optimization.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Input: Use case description, AI architecture (optional), task decomposition, constraints (latency, cost, reliability)

    line 16
  2. Distinctive:

    Document chosen pattern with rationale.

    line 53
  3. Distinctive:

    Start with supervisor pattern.

    line 117
  4. Distinctive:

    Keep agent count ≤5 for maintainability unless domain requires more.

    line 118
  5. Distinctive:

    Use structured output contracts between agents (JSON schema, not free text).

    line 119

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

Multi-Agent Planner

Purpose

Design a multi-agent orchestration architecture: agent roles, communication patterns, handoff protocols, and failure recovery for collaborative AI systems.

Input: Use case description, AI architecture (optional), task decomposition, constraints (latency, cost, reliability)
Output: Multi-Agent Orchestration Plan with agent roster, interaction diagram, and coordination rules Examples: See examples.md for worked input/output.


Workflow

Step 1: Decompose the problem

Break the use case into subtasks:

SubtaskComplexityDependenciesHuman approval needed

Identify which subtasks require specialized reasoning, tool access, or isolation.

Step 2: Define agent roles

For each agent specify:

  • Responsibility — single bounded objective
  • Inputs — what context it receives
  • Outputs — artifact or message format
  • Tools — allowed integrations (MCP, APIs, none)
  • Autonomy level — fully autonomous / supervised / advisory only

Step 3: Select orchestration pattern

PatternWhen to use
SupervisorCentral router delegates to specialists
PipelineSequential handoffs with fixed stages
Peer-to-peerAgents negotiate without central coordinator
HierarchicalManager agents delegate to worker agents
SwarmParallel exploration with aggregation step

Document chosen pattern with rationale.

Step 4: Design communication protocol

Define:

  • Message schema (task ID, agent ID, payload, status)
  • Handoff triggers (completion, escalation, timeout)
  • Shared state store (conversation, scratchpad, blackboard)
  • Conflict resolution (priority rules, supervisor override)

Step 5: Plan failure and recovery

Failure modeDetectionRecovery action
Agent timeoutHeartbeat / deadlineRetry or escalate to supervisor
Invalid outputSchema validationRe-prompt with error context
Tool failureError codeFallback agent or degrade gracefully
Infinite loopMax iteration capTerminate and surface to user

Step 6: Validate

Run Validation checklist.


Decision Rules

ConditionAction
Single agent can complete taskRecommend single-agent design; do not over-orchestrate
Subtasks share mutable stateDefine explicit state ownership and locking
Customer-facing with high riskRequire human-in-the-loop gate before final output
Agents need different tool permissionsIsolate tool access per agent; no shared credentials
Latency budget < 5sAvoid deep agent chains; prefer parallel or single agent
No clear task boundariesStop; decompose further before designing agents

Validation

  • Problem decomposed with dependency map
  • Each agent has single bounded responsibility
  • Orchestration pattern selected with rationale
  • Message schema and handoff triggers defined
  • Failure modes with recovery actions documented
  • Tool permissions scoped per agent
  • Cost/latency impact estimated for agent count
  • Human-in-the-loop gates defined for high-risk paths

Anti-patterns

  • Agent sprawl — creating agents for every minor subtask without coordination benefit.
  • Shared omniscient context — passing full conversation history to every agent.
  • No termination condition — agents loop without max iteration or success criteria.
  • Duplicate responsibilities — two agents performing the same task without clear split.
  • Orchestration without eval — multi-agent system without per-agent quality measurement.

Best Practices

  • Start with supervisor pattern; evolve to peer-to-peer only when justified.
  • Keep agent count ≤5 for maintainability unless domain requires more.
  • Use structured output contracts between agents (JSON schema, not free text).
  • Log every inter-agent message for debugging and audit.
  • Pair with ai-evaluation-builder to measure per-agent contribution.

Output Structure

# Multi-Agent Orchestration Plan: [System Name]

## Problem Decomposition
| Subtask | Agent candidate | Dependencies |
|---------|-----------------|--------------|

## Agent Roster
| Agent | Responsibility | Tools | Autonomy |
|-------|----------------|-------|----------|

## Orchestration Pattern
[Pattern name and rationale]

## Interaction Diagram
[ASCII or mermaid sequence]

## Communication Protocol
| Field | Type | Description |
|-------|------|-------------|

## Failure & Recovery
| Failure | Detection | Recovery |
|---------|-----------|----------|

## Cost & Latency Estimate
[Per-request impact vs single-agent baseline]

## Open Decisions
- [ ] [Unresolved design choice]

Next Skills

OutcomeRecommended Skill
Implement workflow pipelineai/ai-workflow-builder
Design evaluation per agentai/ai-evaluation-builder
Optimize agent call costsai/ai-cost-optimizer
Reduce orchestration latencyai/ai-latency-optimizer
MCP tool integration neededmcp/mcp-tool-generator

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.