multi-agent-patterns
Skill36 starsChanged 6 months agoMITView on GitHub
Architectural reference for multi-agent system design — covers Supervisor/Orchestrator, Peer-to-Peer/Swarm, and Hierarchical patterns with token economics, context isolation strategies, consensus mechanisms, and failure mitigation. Primary use: building production LangGraph/LangChain/ADK agents and designing Claude Code agent orchestration.
17 other projects use a version of this.
Adopted by
Most recently taken up by
- AbdullahMalik17/Digital-FTEtheir own version, first seen Sep 26, 2026
- SkotAlexsander/skillstheir own version, first seen Sep 16, 2026
- docxology/templatetheir own version, first seen Aug 29, 2026
- muratcankoylan/Agent-Skills-for-Context-Engineeringtheir own version, first seen Aug 10, 2026
- georgekhananaev/claude-skills-vaulttheir own version, first seen May 25, 2026
- NeoLabHQ/context-engineering-kittheir own version, first seen Apr 16, 2026
Used with
Projects with it also use context-fundamentals, context-degradation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
rohunvoraSkillcontext-fundamentals
Understand the components, mechanics, and constraints of context in agent systems. Use when designing agent architectures, debugging context-related failures, or optimizing context usage.
Also in 8 projects that use this
rohunvoraSkillcontext-degradation
Recognize, diagnose, and mitigate patterns of context degradation in agent systems. Use when context grows large, agent performance degrades unexpectedly, or debugging agent failures.
Also in 7 projects that use this
AbdullahMalik17Skillconfiguring-dapr-pubsub
Configures Dapr pub/sub components for event-driven microservices with Kafka or Redis. Use when wiring agent-to-agent communication, setting up event subscriptions, or integrating Dapr sidecars. Covers component configuration, subscription patterns, publishing events, and Kubernetes deployment. NOT when using direct Kafka clients or non-Dapr messaging patterns.
Also in 3 projects that use this
AbdullahMalik17Skillcontainerizing-applications
Containerizes applications with Docker, docker-compose, and Helm charts. Use when creating Dockerfiles, docker-compose configurations, or Helm charts for Kubernetes. Includes Docker Hardened Images (95% fewer CVEs), multi-stage builds, and 15+ battle-tested gotchas.
Also in 3 projects that use this
muratcankoylanSkilllong-horizon-prompting
This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.
Also in 3 projects that use this
- +6 more from AbdullahMalik17
- +1 more from rohunvora
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- muratcankoylan/Agent-Skills-for-Context-Engineering★ 18ksame name
- NeoLabHQ/context-engineering-kit★ 1.7ksame name
- Svenja-dev/claude-code-skills★ 38same name
- georgekhananaev/claude-skills-vault★ 28same name
- mjunaidca/mjs-agent-skills★ 27same name
- docxology/template★ 20same name
- AbdullahMalik17/Digital-FTE★ 12same name
- AbdullahMalik17/Hacathan_5★ 9same name
- AbdullahMalik17/My_skills★ 9same name
- xfstudio/skills★ 9same name
7 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository157 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a2ui-angularSkill
- accessibility-auditSkill
- adk-deploy-guideSkill
- adk-dev-guideSkill
- adk-eval-guideSkill
- adk-observability-guideSkill
- agentic-ai-coding-standardSkill
- agentic-ai-devSkill
- ai-auditSkill
- ai-chatSkill
- ai-decision-recordSkill
- ai-incident-responseSkill
- ai-launch-checkSkill
- ai-playbookSkill
- angular-best-practicesSkill
- angularSkill
- angular-spaSkill
- angular-ui-patternsSkill
- api-design-principlesSkill
- app-store-optimizationSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-designSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-release-flowSkill
- asc-signing-setupSkill
- asc-submission-healthSkill
- asc-testflight-orchestrationSkill
- browser-testingSkill
- changelog-generatorSkill
- claude-actions-auditorSkill
- clean-codeSkill
- codebase-onboardingSkill
- code-explainerSkill
- code-reviewerSkill
- code-simplifierSkill
- comment-analyzerSkill
- database-schema-designerSkill
- ddd-architectSkill
- decision-frameworksSkill
- dedup-code-agentSkill
- deployment-ci-cdSkill
- design-systemSkill
- dockerSkill
- documentation-generationSkill
- domain-finderSkill
- error-detectiveSkill
- eval-guideSkill
- feature-forgeSkill
- firebase-basicsSkill
- firebase-hosting-basicsSkill
- fixing-accessibilitySkill
- fixing-motion-performanceSkill
- flutter-animationsSkill
- flutter-genuiSkill
- flutter-mobileSkill
- flutter-security-expertSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
4
Distinctive
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
- Distinctive: line 84
Attention scarcity: All information competes for the same attention budget
- Distinctive: line 150
Use multi-agent for tasks a single agent can handle — overhead is ~15× tokens
- Distinctive: line 151
Use supervisor pattern without direct pass-through mechanism (telephone game problem)
- Distinctive: line 152
Run swarm patterns without convergence constraints (infinite loops)
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Iron Law
CHOOSE ARCHITECTURE PATTERN BEFORE DISPATCHING AGENTS — dispatching without a chosen pattern (Supervisor, Swarm, or Hierarchical) produces uncontrolled context bloat and coordination failures
Explanation: Multi-agent systems consume ~15× the tokens of single-agent systems. Choosing the wrong pattern or dispatching without a plan creates bottlenecks that negate every parallelization benefit.
Multi-Agent Architecture Patterns
Reference skill for designing multi-agent systems. Covers when to use multi-agent architectures, which pattern to choose, how to handle context isolation, and how to prevent the most common failure modes.
Primary audience: Developers building LangGraph/LangChain agents, Google ADK agents, or Claude Code agent orchestration layers.
When to Activate
Load this skill when:
- Deciding whether a task warrants multi-agent architecture vs single agent
- Choosing between Supervisor, Swarm, or Hierarchical patterns
- Building production LangGraph/LangChain multi-agent systems
- Designing Claude Code sub-agent dispatch strategies
- Diagnosing performance problems in an existing multi-agent system
- Briefing a team on multi-agent architecture trade-offs
Pattern Selection Quick Guide
Is the task too large for one context window?
NO → Single agent. Multi-agent adds overhead, not capability.
YES ↓
Do subtasks decompose cleanly into parallel work?
NO → Sequential single agent with summarization between steps.
YES ↓
Does the task need centralized control and human oversight?
YES → Supervisor/Orchestrator pattern
NO ↓
Does the task need flexible exploration with emergent structure?
YES → Peer-to-Peer/Swarm pattern
NO ↓
Does the task have clear hierarchical abstraction layers (strategy → planning → execution)?
YES → Hierarchical pattern
NO → Default to SupervisorReference Files
| Topic | Reference | Load When |
| All 3 architectural patterns (deep) | references/architectural-patterns.md | Choosing a pattern or implementing a new multi-agent system |
| Token economics and cost data | references/token-economics.md | Deciding whether multi-agent architecture is justified |
| Failure modes and mitigations | references/failure-modes.md | Debugging a multi-agent system or designing resilience |
Core Concepts (Summary)
Why Multi-Agent?
Single agents face context ceilings. As tasks grow, context windows fill with accumulated history, retrieved documents, and tool outputs. Performance degrades via:
- Lost-in-middle effect: Information in context center gets ~10–40% lower recall
- Context poisoning: A hallucination that enters context gets reinforced on every turn
- Attention scarcity: All information competes for the same attention budget
Multi-agent architectures address this by partitioning work across multiple context windows.
The Three Patterns
| Pattern | Control | Use When | Risk |
| Supervisor/Orchestrator | Centralized | Clear decomposition, human oversight needed | Supervisor bottleneck |
| Peer-to-Peer/Swarm | Distributed | Flexible exploration, rigid planning counterproductive | Divergence, coordination overhead |
| Hierarchical | Layered | Strategy → planning → execution separation | Misalignment between layers |
Context Isolation Mechanisms
| Mechanism | When | Trade-off |
| Full context delegation | Complex tasks needing complete understanding | Defeats isolation purpose |
| Instruction passing | Simple, well-defined subtasks | Limits agent flexibility |
| File system memory | Shared state across agents | Adds latency, consistency risk |
Consensus: The Sycophancy Problem
Simple majority voting among agents degrades to consensus on false premises — agents bias toward agreement. Mitigations:
- Weighted voting: Agents with higher confidence carry more weight
- Debate protocols: Agents critique each other's outputs (adversarial > collaborative for accuracy)
- Trigger-based intervention: Monitor for stall and sycophancy markers
Critical Production Finding: The Telephone Game Problem
Evidence: LangGraph benchmarks found supervisor architectures initially performed 50% worse than optimized versions.
Cause: Supervisors paraphrase sub-agent responses, losing fidelity at each hop.
Fix: Implement forward_message tool for direct pass-through when sub-agent output is complete:
def forward_message(message: str, to_user: bool = True):
"""
Forward sub-agent response directly to user without supervisor synthesis.
Use when:
- Sub-agent response is final and complete
- Supervisor synthesis would lose important details
- Response format must be preserved exactly
"""
if to_user:
return {"type": "direct_response", "content": message}
return {"type": "supervisor_input", "content": message}With this pattern, swarm architectures can slightly outperform supervisor architectures for tasks where sub-agent output needs no synthesis.
Constraints
MUST DO
- Choose architecture pattern before dispatching agents
- Calculate token budget impact before committing to multi-agent (see
references/token-economics.md) - Define explicit handoff protocols with state passing
- Implement convergence constraints for swarm patterns (time-to-live, iteration limits)
- Validate agent outputs before passing to downstream agents
MUST NOT DO
- Use multi-agent for tasks a single agent can handle — overhead is ~15× tokens
- Use supervisor pattern without direct pass-through mechanism (telephone game problem)
- Run swarm patterns without convergence constraints (infinite loops)
- Assume model upgrade is always cheaper than parallelization (check
token-economics.md)
Knowledge Reference
LangGraph, AutoGen, CrewAI, context isolation, context window management, token economics, supervisor pattern, swarm architecture, hierarchical agents, consensus mechanisms, sycophancy detection, agent handoffs, forward_message, BrowseComp evaluation, multi-agent coordination
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

