From majestic-tools
Provides patterns for multi-agent systems in Claude Code: job description method, shared folder communication, handbook consolidation, context management. Use for complex agent orchestrations.
npx claudepluginhub majesticlabs-dev/majestic-marketplace --plugin majestic-toolsThis skill uses the workspace's default tool permissions.
Design principles for orchestrating many sub-agents without context overflow.
Designs and implements multi-agent LLM systems using orchestrator patterns, parallel coordination, pipelines, hierarchical delegation, communication, and failure handling. For agent workflows and debugging failures.
<!-- AUTO-GENERATED by export-plugins.py — DO NOT EDIT -->
Guides coordination of multiple Claude Code agents as teams for shared tasks, including agent teams, subagents, multi-agent workflows, and Claude Agent SDK. Use when setting up teams, delegating tasks, or orchestrating programmatically.
Share bugs, ideas, or general feedback.
Design principles for orchestrating many sub-agents without context overflow.
Treat agent design like human hiring: write a job description first, then translate to architecture. The framing shapes every decision.
Before writing any agent code:
| JD Section | Architecture Element |
|---|---|
| Responsibilities | Agent workflows |
| Required skills | Tool permissions |
| Success indicators | Output schemas |
| Escalation criteria | Error handling |
| Onboarding materials | Skills/handbook |
Problem: Orchestrator context overwhelmed when 10+ sub-agents return detailed reports simultaneously.
Solution: Sub-agents write to temp folder → downstream agents read directly.
.claude/workspace/
├── phase-1/
│ ├── gmail-analysis.md
│ ├── calendar-analysis.md
│ └── drive-inventory.md
├── phase-2/
│ ├── client-summary.md
│ └── action-items.md
└── manifest.yml
Workflow:
1. Orchestrator spawns sub-agents
2. Each sub-agent:
- Does work
- Writes report to .claude/workspace/{phase}/{name}.md
- Returns only: { status: "complete", path: "..." }
3. Downstream agents read prior phase outputs directly
4. Orchestrator reads manifest, not full reports
Benefits:
Problem: Many narrow skills create fragility and maintenance burden.
Solution: One handbook organized by chapters, read foundation + relevant sections.
skills/project-manager/
├── SKILL.md # Entry point, routes to chapters
└── references/
├── 01-foundation.md # Who we are, tools, escalation, standards
├── 02-daily-ops.md # Data gathering procedures
├── 03-dashboards.md # Structure, quality checks
└── 04-onboarding.md # New client setup
Chapter Structure:
| Chapter | Contents |
|---|---|
| Foundation | Team, tools, data sources, escalation rules, quality standards |
| Domain chapters | Specific procedures for each responsibility area |
Reading Pattern:
Sub-agent reads:
1. Foundation chapter (always)
2. Relevant domain chapter(s) (based on task)
| Strategy | When to Use |
|---|---|
| Shared folder | 5+ sub-agents, inter-agent dependencies |
| Context proxy | Research agents returning verbose results |
| Manifest files | Orchestrator needs status, not details |
| Chunked execution | Serial phases when parallel overwhelms |
How many sub-agents?
├── 1-3 → Direct orchestration (return reports to main)
├── 4-10 → Shared folder pattern
└── 10+ → Phased execution with manifest
Do teammates need direct communication?
├── No → Sub-agents (Task tool) — report results back only
└── Yes → Agent Teams — shared task list, inter-agent messaging
├── See agent-teams skill for full guide
└── Best for: parallel review, competing hypotheses, multi-module features
Do sub-agents need each other's output?
├── No → Parallel execution, merge results
└── Yes → Shared folder, dependency ordering
Is orchestrator context a concern?
├── No → Return full reports
└── Yes → Status-only returns + file paths
| Pattern | Problem | Fix |
|---|---|---|
| Slash commands as orchestration | Context exhaustion before work starts | Move to sub-agents |
| Orchestrator relays all context | Bottleneck, signal loss | Shared folder |
| One skill per micro-task | Fragile, hard to maintain | Handbook chapters |
| Sub-agents return full reports | Context overflow at 10+ agents | Path-only returns |
Most multi-agent systems evolve through:
Skip earlier stages when building new systems.
When workers need to communicate directly with each other — not just report back to an orchestrator — use Agent Teams instead of sub-agents. Agent Teams provide shared task lists, inter-agent messaging, and independent context windows.
Key differences from sub-agent patterns above:
When to upgrade from sub-agents to Agent Teams:
For full setup, operations reference, and orchestration patterns, apply the agent-teams skill.