jeremylongshore/tons-of-skills-marketplace

orchestrating-multi-agent-systems

'Execute orchestrate multi-agent systems with handoffs, routing, and workflows across AI providers.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace --skill orchestrating-multi-agent-systems

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Orchestrating 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

  1. Initialize a TypeScript project with tsconfig.json targeting ES2022 and moduleResolution bundler
  2. Install AI SDK v5 core and provider packages for each model backend required
  3. Define agent roles by creating separate modules per agent, each with a system prompt, model binding, and scoped tool set
  4. Implement tool functions using ai.tool() with Zod input/output schemas for type-safe execution
  5. Configure handoff rules using ai.handoff() to delegate tasks between agents with clear trigger conditions and context passing
  6. Build routing logic that classifies incoming requests by topic or intent and dispatches to the appropriate specialist agent
  7. Wire agents into a workflow using sequential, parallel, or conditional orchestration patterns
  8. Add state management to persist context across multi-step workflows using a shared context object or external store
  9. Implement circuit breakers and timeout guards to prevent workflow deadlocks
  10. Test each agent in isolation, then validate end-to-end handoff chains with representative inputs

See `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

ErrorCauseSolution
Provider configuration invalidMissing or malformed API key in environmentVerify process.env.*_API_KEY values; check provider SDK version compatibility
Circular handoff detectedAgent A hands off to B which hands back to AImplement handoff depth counter; set maxHandoffDepth and add a fallback terminal agent
Task routed to no agentRouting classifier returned no match for inputAdd a default catch-all route; improve classifier training data or keyword coverage
Tool access violationAgent invoked a tool outside its scoped permission setReview tools array per agent; ensure tool names match registered definitions exactly
Workflow timeoutMulti-step workflow exceeded deadline without completionSet per-step timeouts with AbortController; add workflow-level deadline and partial-result handling

See `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 `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
来自同一仓库

更多 Skills

全部 Skills
jeremylongshore
社区

agent-context-loader

'Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose. '

1小时安装量
2
GitHub Stars
2907
最近更新
11月8日
jeremylongshore
社区

agent-creator

'Create production-grade agent .md files aligned with the current Anthropic subagent contract. Also validates existing agents against the marketplace compliance rules. Use when building custom subagents, reviewing agent quality, or creating parallel agent architectures for orchestrator skills. Trigger with "/agent-creator", "create an agent", "build a subagent", or "validate my agent". Make sure to use this skill whenever creating agents/.md files for plugins or standalone use. '

1小时安装量
2
GitHub Stars
2907
最近更新
11月8日
jeremylongshore
社区

agent-patterns

'Execute this skill should be used when the user asks about "SPAWN REQUEST format", "agent reports", "agent coordination", "parallel agents", "report format", "agent communication", or needs to understand how agents coordinate within the sprint system. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose. '

1小时安装量
2
GitHub Stars
2907
最近更新
11月8日
jeremylongshore
社区

agent-safety-preflight

Generate a local repository risk receipt before Claude Code or other AI-agent edits. Use when the user asks to prepare a repository for agent changes, check for risky hooks or credential-writing automation, or run the /agent-preflight command. Trigger with "run agent preflight", "check this repo before agent edits", or "/agent-preflight".

1小时安装量
2
GitHub Stars
2907
最近更新
11月8日