multi-agent-composition
Decision frameworks and patterns for choosing and composing Claude Code components — skills, sub-agents, hooks, MCP servers, and slash commands — into effective multi-component agentic systems with proper orchestration and context management.
What this skill does
# Multi-Agent Composition **Master Claude Code's components, patterns, and principles** to build effective agentic systems. ## When to Use This Knowledge Use this knowledge when: - **Learning Claude Code** - Understanding what each component does - **Making architectural decisions** - Choosing Skills vs Sub-Agents vs MCP vs Slash Commands - **Building custom solutions** - Creating specialized agents or orchestration systems - **Scaling agentic workflows** - Moving from single agents to multi-agent orchestration - **Debugging issues** - Understanding why components behave certain ways - **Adding observability** - Implementing hooks for monitoring and control ## Quick Reference ### The Core 4 Framework Every agent is built on these four elements: 1. **Context** - What information does the agent have? 2. **Model** - What capabilities does the model provide? 3. **Prompt** - What instruction are you giving? 4. **Tools** - What actions can the agent take? > "Everything comes down to just four pieces. If you understand these, you will win." ### Component Overview | Component | Trigger | Use When | Best For | |-----------|---------|----------|----------| | **Skills** | Agent-invoked | Repeat problems needing management | Domain-specific workflows | | **Sub-Agents** | Tool-invoked | Parallelization & context isolation | Scale & batch operations | | **MCP Servers** | As needed | External data/services | Integration with external systems | | **Slash Commands** | Manual/tool | One-off tasks | Simple repeatable prompts | | **Hooks** | Lifecycle events | Observability & control | Monitoring & blocking | ### Composition Hierarchy ```text Skills (Top Layer) ├─→ Can use: Sub-Agents, Slash Commands, MCP Servers, Other Skills └─→ Purpose: Orchestrate primitives for repeatable workflows Sub-Agents (Execution Layer) ├─→ Can use: Slash Commands, Skills └─→ Cannot nest other Sub-Agents Slash Commands (Primitive Layer) └─→ The fundamental building block MCP Servers (Integration Layer) └─→ Connect external systems ``` ### Golden Rules 1. **Always start with prompts** - Master the primitive first 2. **"Parallel" = Sub-Agents** - Nothing else supports parallel execution 3. **External = MCP, Internal = Skills** - Clear separation of concerns 4. **One-off = Slash Command** - Don't over-engineer 5. **Repeat + Management = Skill** - Only scale when needed 6. **Don't convert all slash commands to skills** - Huge mistake 7. **Context, Model, Prompt, Tools** - Never forget the foundation ## Documentation Structure This skill uses progressive disclosure. Start here, then navigate to specific topics as needed. ### Reference Documentation **Architecture fundamentals** - What each component is and how they work - **[architecture.md](reference/architecture.md)** - Component definitions, capabilities, restrictions - **[core-4-framework.md](reference/core-4-framework.md)** - Deep dive into Context, Model, Prompt, Tools ### Implementation Patterns **How to use components effectively** - Decision-making and implementation - **[decision-framework.md](patterns/decision-framework.md)** - When to use Skills vs Sub-Agents vs MCP vs Slash Commands - **[hooks-in-composition.md](patterns/hooks-in-composition.md)** - Implementing hooks for observability and control - **[orchestrator-pattern.md](patterns/orchestrator-pattern.md)** - Multi-agent orchestration at scale - **[context-management.md](patterns/context-management.md)** - Managing context across agents - **[context-in-composition.md](patterns/context-in-composition.md)** - Context handling in multi-agent systems ### Anti-Patterns #### Common mistakes to avoid - **[common-mistakes.md](anti-patterns/common-mistakes.md)** - Converting all slash commands to skills, using skills for one-offs, context explosion, and more ### Examples #### Real-world case studies and progression paths - **[progression-example.md](examples/progression-example.md)** - Evolution from prompt → sub-agent → skill (work tree manager example) - **[case-studies.md](examples/case-studies.md)** - Scout-builder patterns, orchestration workflows, multi-agent systems ### Workflows #### Visual guides and decision trees - **[decision-tree.md](workflows/decision-tree.md)** - Decision trees, mindmaps, and visual guides for choosing components ## Getting Started ### If you're new to Claude Code 1. Start with **[reference/architecture.md](reference/architecture.md)** to understand components 2. Read **[reference/core-4-framework.md](reference/core-4-framework.md)** to grasp the foundation 3. Use **[patterns/decision-framework.md](patterns/decision-framework.md)** to make your first architectural choice 4. Check **[anti-patterns/common-mistakes.md](anti-patterns/common-mistakes.md)** to avoid pitfalls ### If you're making an architectural decision 1. Open **[patterns/decision-framework.md](patterns/decision-framework.md)** 2. Follow the decision tree to identify the right component 3. Review the specific component in **[reference/architecture.md](reference/architecture.md)** 4. Check **[examples/](examples/)** for similar use cases ### If you're adding observability 1. Read **[patterns/hooks-in-composition.md](patterns/hooks-in-composition.md)** to understand available hooks and implementation 2. Use isolated scripts pattern (UV, bun, or shell) ### If you're scaling to multi-agent orchestration 1. Ensure you've mastered custom agents first 2. Read **[patterns/orchestrator-pattern.md](patterns/orchestrator-pattern.md)** 3. Study **[examples/case-studies.md](examples/case-studies.md)** 4. Review **[patterns/context-management.md](patterns/context-management.md)** ## Key Principles from the Field ### Prompts Are the Primitive > "Do not give away the prompt. The prompt is the fundamental unit of knowledge work and of programming. If you don't know how to build and manage prompts, you will lose." **Everything is prompts in the end.** Master slash commands before skills. Have a strong bias toward slash commands. ### Skills Are Compositional, Not Replacements > "It is very clear this does not replace any existing feature or capability. It is a higher compositional level." Skills orchestrate other components; they don't replace them. Don't convert all your slash commands to skills—that's a huge mistake. ### Observability is Everything > "When it comes to agentic coding, observability is everything. How well you can observe, iterate, and improve your agentic system is going to be a massive differentiating factor." If you can't measure it, you can't improve it. If you can't measure it, you can't scale it. ### Context Window Protection > "200k context window is plenty. You're just stuffing a single agent with too much work. Don't force your agent to context switch." Create focused agents with single purposes. Delete them when done. Treat agents as temporary, deletable resources. ### The Agentic Engineering Progression ```text Level 1: Base agents → Use agents out of the box Level 2: Better agents → Customize prompts and workflows Level 3: More agents → Run multiple agents Level 4: Custom agents → Build specialized solutions Level 5: Orchestration → Manage fleets of agents ``` ## Source Attribution This knowledge synthesizes: - Video presentations by Claude Code engineering team - Official Claude Code documentation (docs.claude.com) - Hands-on experimentation and validation - Multi-agent orchestration patterns from the field ## Quick Navigation **Need to understand what a component is?** → [reference/architecture.md](reference/architecture.md) **Need to choose the right component?** → [patterns/decision-framework.md](patterns/decision-framework.md) **Need to implement hooks?** → [patterns/hooks-in-composition.md](patterns/hooks-in-composition.md) **Need to scale to multiple agents?** → [patterns/orchestrator-pattern.md](patterns/orchestrator-pattern.md) **Need to see real examples?** → [exampl
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.