building-multiagent-systems
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when designing or implementing systems with multiple AI agents that coordinate to accomplish tasks. Triggers on "multi-agent"…
от aiskillstore★ 509 звёзд на GitHubОб этом скилле
Building Multi-Agent, Tool-Using Agentic Systems
Overview
Comprehensive architecture patterns for multi-agent systems where AI agents coordinate to accomplish complex tasks using tools. Language-agnostic and applicable across TypeScript, Python, Go, Rust, and other environments.
Discovery Questions (Required)
Before architecting any system, ask these six mandatory questions:
- Starting Point - Greenfield, adding to existing system, or fixing current implementation?
- Primary Use Case - Parallel work, sequential pipeline, recursive delegation, peer collaboration, work queues, or other?
- Scale Expectations - Small (2-5 agents), medium (10-50), or large (100+)?
- State Requirements - Stateless runs, session-based, or persistent across crashes?
- Tool Coordination - Independent agents, shared read-only resources, write coordination, or rate-limited APIs?
- Existing Constraints - Language, framework, performance needs, compliance requirements?
Foundational Architecture
Four-Layer Stack
Every agent follows the four-layer architecture for testability, safety, and modularity:
| Layer | Name | Responsibility |
|---|---|---|
| 1 | Reasoning (LLM) | Plans, critiques, decides which tools to call |
| 2 | Orchestration | Validates, routes, enforces policy, spawns sub-agents |
| 3 | Tool Bus | Schema validation, tool execution coordination |
| 4 | Deterministic Adapters | File I/O, APIs, shell commands, database access |
Critical Rule: Everything below Layer 1 must be deterministic. No LLM calls in tools.
See references/four-layer-architecture.md for detailed implementation with code examples.
Foundational Patterns
| Pattern | Purpose |
|---|---|
| Event-Sourcing | All state changes as events for audit trails and replay |
| Hierarchical IDs | Encode delegation hierarchy (e.g., session.1.2) for cost aggregation |
| Agent State Machines | Explicit states (idle → thinking → tool_execution → stopped) with invalid transition errors |
| Communication | EventEmitter for state changes, promises for result collection |
Seven Coordination Patterns
Choose based on discovery question answers:
| Pattern | Use Case | Trade-offs |
|---|---|---|
| Fan-Out/Fan-In | Parallel independent work | Fast but costly; watch for orphans |
| Sequential Pipeline | Multi-stage transformations | Bottleneck at slowest stage |
| Recursive Delegation | Hierarchical task breakdown | Must add depth limits |
| Work-Stealing Queue | 1000+ tasks with load balancing | No built-in priority |
| Map-Reduce | Cost optimization | Cheap map ($0.01), smart reduce ($0.15) |
| Peer Collaboration | LLM council for bias reduction | Expensive (3N+1 calls), slow |
| MAKER | Zero-error tasks (100K+ steps) | 5× cost but ~0% error rate |
See references/coordination-patterns.md for detailed implementations.
Pattern Selection Guide
| Requirement | Recommended Pattern |
|---|---|
| Parallel independent tasks | Fan-Out/Fan-In |
| Each stage depends on previous | Sequential Pipeline |
| Complex task decomposition | Recursive Delegation |
| Large batch processing | Work-Stealing Queue |
| Cost-sensitive analysis | Map-Reduce |
| Need diverse perspectives | Peer Collaboration |
| Zero error tolerance | MAKER |
MAKER Pattern (Zero Errors)
For tasks requiring 100K+ steps with zero error tolerance (medical, financial, legal domains):
- Extreme Decomposition - Recursive breakdown until each subtask <100 steps
- Microagents - Single tool, focused expertise, cheap models
- Multi-Agent Voting - N parallel attempts per subtask, majority consensus
- Error Correction - Deterministic validation + retry with failure context
Cost comparison: Same cost as traditional approach, zero errors vs. 10+ errors.
See references/maker-pattern.md for full implementation with medical diagnosis example.
Tool Coordination
| Mechanism | Purpose |
|---|---|
| Permission Inheritance | Children inherit subset of parent permissions (cannot escalate) |
| Resource Locking | Acquire/release patterns for shared resources |
| Rate Limiting | Token bucket algorithm across all agents |
| Result Caching | Cache read-only, idempotent, expensive operations |
Sub-Agent as Tool Pattern: Wrap specialized agents as tools the parent can call, providing composable abstractions and natural lifecycle management.
See references/tool-coordination.md for implementations.
Critical Lifecycle: Cascading Stop
"Always stop children before stopping self." This prevents orphaned agents.
1. Get all child agents
2. Stop all children in parallel
3. Stop self
4. Cancel ongoing work
5. Flush events
If pause/resume unavailable, implement manual checkpointing: save agent state (messages, context, tool results), then restore later.
Production Harde
Установить building-multiagent-systems в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл building-multiagent-systems?
This skill should be used when designing or implementing systems with multiple AI agents that coordinate to accomplish tasks. Triggers on "multi-agent", "orchestrator", "sub-agent", "coordination", "delegation", "parallel agents", "sequential pipeline", "fan-out", "map-reduce", "spawn agents", "agent hierarchy".
Как установить скилл building-multiagent-systems?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл building-multiagent-systems запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
agent-skill-stack
Find, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
от GitHubbuild-evidence-map
Build an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
от GitHubpinecone-rag
Build production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
от GitHubqdrant-monitoring-debugging
Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…
от GitHub