/ai-agent-skills:multi-agent-orchestrationfrom ai-agent-skills
Guides when and how to split tasks across multiple LLM agents (supervisor/worker, pipeline, debate patterns) vs. using a single agent. Covers topologies, hand-off reliability, and diagnosing coordination failures.
Ships in ai-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Splitting a task across multiple agents can reduce per-agent context load, allow specialization (a narrower system prompt and tool set per role), and enable parallelism — but it also multiplies the surface area for coordination failures: duplicated work, agents that silently disagree, lost context at hand-off boundaries, and cost/latency from redundant model calls. Multi-agent orchestration is not automatically better than a single well-designed agent; it is a specific tool for specific shapes of problem. This skill covers the common orchestration topologies (supervisor/worker, pipeline, debate/parallel-with-aggregation), when each is justified over a single agent, and how to keep hand-offs between agents reliable.
Justify the split with a concrete symptom, not intuition. Before introducing a second agent, write down what specifically breaks with one agent: context window pressure, measurable role confusion in evaluation results (see agent-evaluation-and-guardrails), or a genuine need for parallel independent work. "It felt cleaner to split it" is not sufficient justification given the added coordination cost.
Choose a topology that matches the task's dependency structure:
researcher -> writer -> fact_checker).
Best when the task has a natural linear dependency chain.Define the hand-off contract between agents explicitly, as a structured schema, not free-form prose passed between prompts:
{
"from_agent": "researcher",
"to_agent": "writer",
"task_id": "task-8842",
"findings": [
{ "claim": "...", "source": "doc-42", "confidence": "high" }
],
"open_questions": ["..."]
}
Free-form hand-offs ("here's what I found: ...") are the single biggest source of lost or misinterpreted context between agents.
Give each sub-agent the narrowest system prompt and tool set that its role needs — this is the actual payoff of splitting; a worker agent with a 10-line role-specific prompt and 3 tools will outperform the same role embedded as one section of a 40-tool generalist's prompt.
Make the supervisor responsible for validating hand-offs, not just routing them — check that a worker's output matches the expected schema and addresses the delegated sub-task before passing it downstream or integrating it, rather than assuming compliance.
def supervisor_step(task):
plan = supervisor_llm.plan(task)
results = {}
for subtask in plan.subtasks:
worker = select_worker(subtask.role)
output = worker.run(subtask)
if not validate_schema(output, subtask.expected_schema):
output = worker.run(subtask, retry_hint="prior output was malformed: ...")
results[subtask.id] = output
return supervisor_llm.integrate(task, results)
Bound total cost and depth explicitly at the orchestration level — cap how many sub-agents a supervisor can spawn per task and how many levels of delegation are allowed (avoid a supervisor's worker itself spawning further workers unbounded), independent of any single agent's own loop cap (see agent-architecture-design).
Decide where shared state lives — a common data store both agents read/write, or strictly message-passing hand-offs with no shared mutable state. Message-passing is easier to reason about and debug; shared mutable state introduces race conditions in parallel topologies and should be avoided unless there's a specific need for it.
Instrument the full multi-agent trace, not just each agent's individual log — you need to see the sequence of hand-offs, not just each agent's isolated behavior, to debug coordination failures.
Symptom: Two agents each independently do overlapping work (e.g. both fetch and summarize the same document) because task boundaries were left implicit. Fix: Make the supervisor's delegation explicit and mutually exclusive per sub-task in the plan; validate at integration time that no two workers were assigned overlapping scope.
Symptom: A worker agent's output subtly contradicts another worker's output (e.g. different numbers for the same metric), and the supervisor merges both into a final answer without noticing. Fix: Add an explicit consistency-check step (rule-based or a dedicated critic agent) before integration, rather than assuming the supervisor's integration prompt alone will catch contradictions.
Symptom: Context that mattered in an early agent's reasoning (a caveat, an assumption) is lost by the time a later agent in a pipeline produces the final output, because hand-offs passed only the "answer," not the reasoning behind it. Fix: Structure hand-offs to include relevant caveats/assumptions/ confidence explicitly as schema fields, not just the bottom-line result.
Symptom: Cost and latency balloon because a supervisor spawns sub-agents that themselves spawn further sub-agents for sub-sub-tasks, with no depth limit. Fix: Cap delegation depth and total sub-agent count per task at the orchestration layer; require justification (in code, not just prompt instruction) for any recursive delegation.
Symptom: The team reaches for a multi-agent design for a task a single well-scoped agent could have handled, and the result is slower, more expensive, and no more accurate. Fix: Re-evaluate against a single-agent baseline with the same eval suite before committing to the multi-agent architecture — the split should be justified by a measured gap, not adopted by default because it seems more sophisticated.
Task: produce a weekly engineering status digest that summarizes merged PRs, open incidents, and upcoming deploys from three unrelated internal systems.
Topology: parallel + aggregation, since the three data sources are independent and don't need to inform each other's summarization.
fan-out:
pr_summarizer_agent (tools: list_merged_prs, get_pr_details)
incident_agent (tools: list_open_incidents)
deploy_calendar_agent (tools: get_upcoming_deploys)
each returns:
{ "section": "...", "bullets": [ {"text": "...", "source_id": "..."} ] }
fan-in:
aggregator_agent receives all three structured outputs (not free text),
validates each against the shared schema, orders sections, and produces
the final Markdown digest with source citations preserved from each
sub-agent's output.
Each sub-agent gets a narrow prompt and only the 1–2 tools its section needs — the PR summarizer never sees incident tools or vice versa — and the whole run is capped at exactly 3 parallel sub-agents with no further delegation allowed, keeping cost bounded and predictable per digest run. The aggregator is evaluated separately (does it preserve every source citation, does it handle a sub-agent returning an empty section gracefully) from each sub-agent's own eval suite.
What SKILL.md sets; muted values are Claude Code's defaults
20 skills in this plugin
/agent-architecture-designGuides designing the control loop, state/memory model, and tool boundaries for an LLM-driven agent. Use when a user asks to "design an agent architecture," choose between a ReAct loop / plan-and-execute / finite-state agent, decide on single-agent vs multi-agent decomposition, define how an agent should manage state and memory across turns, or review whether an existing agent's control flow is safe to run unattended.
/agent-bad-response-triage-and-root-cause-classificationGuides triaging a single reported bad, wrong, or harmful agent response: reproducing it deterministically and classifying the root cause into one of five buckets — prompt issue, tool failure, retrieval issue, model behavior change, or genuine edge case — so the fix targets the actual cause instead of the symptom. Use when a user asks to "investigate this bad agent response," "why did the agent say/do that," "triage this reported hallucination/harmful output," "figure out if this is a prompt bug or a model regression," or files an incident about a single problematic agent interaction that needs root-causing before a fix ships.
/agent-cost-and-latency-spike-investigationGuides rapidly triaging a sudden cost or latency spike affecting one specific agent workflow — scoping it, correlating it against recent changes, and applying a fast, safe stopgap — before launching a full optimization pass. Use when a user asks "why did our LLM bill jump overnight," "this one workflow got slow/expensive all of a sudden," "investigate a cost/latency spike," or reports an alert/invoice surprise for a single agent or task type, as distinct from a deliberate, scheduled effort to reduce baseline cost or latency.
/agent-evaluation-and-guardrailsGuides building evaluation harnesses, regression test suites, and runtime guardrails for LLM agents. Use when a user asks to "evaluate this agent," "write test cases for a prompt change," "set up an eval harness," "add guardrails to prevent unsafe output," "detect prompt injection at runtime," or needs to know whether a prompt/model/tool change made an agent better or worse before shipping it.
/agent-tool-call-loop-diagnosis-and-circuit-breakingGuides diagnosing an active or recurring runaway agent tool-call loop and stopping it safely with a bounded retry policy and a hard ceiling — distinct from raising the iteration limit. Use when a user asks to "figure out why the agent is stuck calling the same tool," "safely kill a runaway agent session," "the agent keeps retrying the same failing action," "someone just raised the retry limit and it's still looping," or needs to design a circuit breaker so a stalled agent fails closed instead of burning cost/quota indefinitely.
/agent-tool-use-patternsGuides designing safe, reliable tool/function-calling interfaces and loops for LLM agents. Use when a user asks to "design tool schemas," fix an agent that hallucinates tool calls or arguments, prevent infinite tool-call loops, decide how much autonomy to give an agent's tool use, handle untrusted tool output safely, or add confirmation gates before destructive tool actions.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin ai-agent-skillsOther plugins' skills for the same job