
Orchestrating Multi-Agent Systems
FreeBuild coordinated workflows across AI agents.
Free · Opens the source repo
What Orchestrating Multi-Agent Systems does
Orchestrating Multi-Agent Systems is a skill designed to help developers and designers create complex AI systems that require collaboration among multiple agents. This skill leverages the AI SDK v5 to implement structured handoffs, intelligent routing, and coordinated workflows, allowing for efficient task delegation and inter-agent communication. By defining agent roles and utilizing various orchestration patterns, users can build systems that effectively manage workflows across different AI providers.
The skill includes detailed instructions for setting up a TypeScript project, defining agent roles, and implementing tool functions with type-safe execution using Zod for input/output validation. Users can configure handoff rules to facilitate task delegation between agents based on specific trigger conditions, ensuring that the right agent handles the appropriate task. The routing logic classifies incoming requests by intent, directing them to the specialist agents best suited for the job, which enhances the overall efficiency of the system.
With built-in error handling mechanisms, such as circuit breakers and timeout guards, this skill ensures that workflows run smoothly and can recover from common issues. The output includes TypeScript modules for agents, handoff configurations, and workflow orchestration files, providing a comprehensive framework for building multi-agent systems. This skill is ideal for developers looking to create sophisticated AI solutions that require seamless collaboration between multiple agents.
When to use it
Use this skill when you need to build a multi-agent system that requires coordination and collaboration across different AI providers.
When not to use it
This skill may not be suitable for simple tasks that do not require multiple agents or complex workflows.
What you can build with it
Customer Support Triage
A coordinator agent classifies incoming tickets and routes them to specialist agents based on the type of inquiry.
Research Pipeline
A sequential workflow processes research queries through a series of agents, each producing structured outputs for the next.
Code Review Multi-Agent
A supervisor agent distributes code review tasks to specialized agents, aggregating their findings into a comprehensive report.
How to install Orchestrating Multi-Agent Systems
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/orchestrating-multi-agent-systems --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeremylongshoreOrchestrating Multi-Agent Systems
Overview
Design and implement multi-agent systems using AI SDK v5 with structured handoffs, intelligent routing, and coordinated workflows across AI providers. This skill covers agent role definition, tool scoping, inter-agent delegation via handoff rules, and workflow orchestration patterns including coordinator-worker and supervisor topologies.
Prerequisites
- Node.js 18+ and TypeScript 5.0+ runtime
- AI SDK v5 (
npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google) - API keys for target providers set in environment variables (
OPENAI_API_KEY,ANTHROPIC_API_KEY,GOOGLE_GENERATIVE_AI_API_KEY) - Zod for input/output schema validation (
npm install zod) - Familiarity with agent-based architecture patterns (coordinator, pipeline, broadcast)
Instructions
- Initialize a TypeScript project with
tsconfig.jsontargeting ES2022 and moduleResolutionbundler - Install AI SDK v5 core and provider packages for each model backend required
- Define agent roles by creating separate modules per agent, each with a system prompt, model binding, and scoped tool set
- Implement tool functions using
ai.tool()with Zod input/output schemas for type-safe execution - Configure handoff rules using
ai.handoff()to delegate tasks between agents with clear trigger conditions and context passing - Build routing logic that classifies incoming requests by topic or intent and dispatches to the appropriate specialist agent
- Wire agents into a workflow using sequential, parallel, or conditional orchestration patterns
- Add state management to persist context across multi-step workflows using a shared context object or external store
- Implement circuit breakers and timeout guards to prevent workflow deadlocks
- Test each agent in isolation, then validate end-to-end handoff chains with representative inputs
See ${CLAUDE_SKILL_DIR}/references/implementation.md for the detailed implementation guide.
Output
- TypeScript agent modules with AI SDK v5 provider bindings and system prompts
- Tool definitions with Zod-validated input/output schemas
- Handoff configuration mapping agent-to-agent delegation triggers
- Workflow orchestration files defining sequential, parallel, and conditional execution paths
- Routing classifier that maps user intents to specialist agents
- Integration test suite covering handoff chains and fallback paths
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Provider configuration invalid | Missing or malformed API key in environment | Verify process.env.*_API_KEY values; check provider SDK version compatibility |
| Circular handoff detected | Agent A hands off to B which hands back to A | Implement handoff depth counter; set maxHandoffDepth and add a fallback terminal agent |
| Task routed to no agent | Routing classifier returned no match for input | Add a default catch-all route; improve classifier training data or keyword coverage |
| Tool access violation | Agent invoked a tool outside its scoped permission set | Review tools array per agent; ensure tool names match registered definitions exactly |
| Workflow timeout | Multi-step workflow exceeded deadline without completion | Set per-step timeouts with AbortController; add workflow-level deadline and partial-result handling |
See ${CLAUDE_SKILL_DIR}/references/errors.md for the full error reference.
Examples
Scenario 1: Customer Support Triage -- A coordinator agent classifies incoming tickets as billing, technical, or general. Billing queries hand off to a specialist agent with access to Stripe tools. Technical queries route to a code-analysis agent with filesystem read tools. Resolution rate target: 85% automated within 3 handoff steps.
Scenario 2: Research Pipeline -- A sequential workflow chains a web-search agent, a summarization agent, and a report-writer agent. Each agent produces structured JSON output consumed by the next. The pipeline processes 50 research queries per batch with a p95 latency under 30 seconds per query.
Scenario 3: Code Review Multi-Agent -- A supervisor agent distributes pull request diffs to specialized reviewers (security, performance, style). Each reviewer returns findings with severity scores. The supervisor aggregates results into a unified review with prioritized action items.
See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.
Resources
- AI SDK v5 Documentation -- agent creation, tool definitions, handoffs
- Zod Schema Library -- input/output validation for tools and flows
- Provider integration guides: OpenAI, Anthropic, Google Gemini
- Coordinator-worker and supervisor orchestration pattern references
- OpenTelemetry tracing for multi-agent observability
Frequently asked questions about Orchestrating Multi-Agent Systems
Similar skills
Agent Skill Stack
Assemble compatible AI Agent Skills for workflows.
AI Team Orchestration
Streamline multi-agent development workflows.
Advisor Orchestrator Worker
Efficiently manage complex tasks with multiple AI models.
Agent Orchestrator
Automate multi-agent workflows with zero manual intervention.
Agent Governance
Implement safety and trust controls for AI agents.
Microsoft Foundry
End-to-end management for Microsoft Foundry agents.
