원클릭으로
multi-agent-workflow
Design a multi-agent workflow using Claude Code's coordinator/swarm patterns — outputs a complete orchestration spec
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Design a multi-agent workflow using Claude Code's coordinator/swarm patterns — outputs a complete orchestration spec
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Design an agent system by referencing Claude Code's battle-tested architecture patterns
Find the right Claude Code design pattern for a specific agent engineering problem
Design a new tool using Claude Code's buildTool pattern — produces a complete, implementation-ready tool spec
| name | multi-agent-workflow |
| description | Design a multi-agent workflow using Claude Code's coordinator/swarm patterns — outputs a complete orchestration spec |
Usage: /multi-agent-workflow <complex task description>
Design a complete multi-agent workflow using Claude Code's proven patterns. Select the right coordination model, define each agent's role precisely, and specify how they communicate and recover from failures.
Read in this order:
/Users/mjm/Claude Code/_reference/toolkit/coordinator-workflow-template.md/Users/mjm/Claude Code/_reference/toolkit/swarm-team-template.md/Users/mjm/Claude Code/_reference/toolkit/agent-spawning-template.mdModel A: Coordinator + Workers
coordinator-workflow-template.mdModel B: Swarm
swarm-team-template.mdModel C: Fork (Context Inheritance)
agent-spawning-template.mdHybrid: Most production systems combine models. E.g., Coordinator orchestrates Phase 1 with fan-out research (Model A), then Phase 2 as a Swarm for parallel implementation (Model B).
## Workflow Design: [Name]
### Coordination Model
**Primary model**: [A / B / C / Hybrid]
**Reason**: [why this model fits the task]
---
### Agent Roster
| Agent | Role | Tools Allowed | Spawn Mode | Output |
|-------|------|--------------|------------|--------|
| Coordinator | Orchestrate all phases | All (read-heavy) | Main thread | Synthesis doc |
| Research-A | [specific area] | Glob, Grep, Read | Background | `scratchpad/research-a.md` |
| Research-B | [specific area] | Glob, Grep, Read | Background | `scratchpad/research-b.md` |
| Implementer | Execute synthesis spec | All | Fork from Coordinator | File changes |
| Verifier | Independent review | Read-only | Fresh (no prior context) | Verdict report |
---
### Communication Design
**Coordinator → Workers**: [how tasks are assigned]
```
Option 1: Direct spawn — AgentTool({ prompt: task_description, run_in_background: true })
Option 2: Shared queue — TaskList.add(task), workers poll and claim
Option 3: SendMessage — to: "agent-id", message: "new task"
```
**Choice**: [which option and why]
**Workers → Coordinator**: [how results return]
```
Option 1: <task-notification> XML injected into coordinator's stream
Option 2: Write to scratchpad/[agent-name].md, coordinator reads all
Option 3: TaskOutputTool(task_id, block=true)
```
**Choice**: [which option and why]
**Shared State**: [cross-agent knowledge]
```
Scratchpad directory: .claude/scratchpad/[workflow-name]/
├── research-findings.md
├── synthesis.md
└── implementation-log.md
```
---
### Phase Breakdown
**Phase 1: Research** *(N agents, parallel, ~X minutes)*
```
Coordinator spawns simultaneously:
Agent "research-backend" → [specific search area, specific tools]
Agent "research-frontend" → [specific search area, specific tools]
Agent "research-tests" → [specific search area, specific tools]
Collection: Wait for all <task-notification> completions
Result: scratchpad/research-*.md files
```
**Phase 2: Synthesis** *(Coordinator only)*
```
Read all scratchpad/research-*.md
Produce: scratchpad/implementation-spec.md
Contains: [list of specific changes with file paths and exact modifications]
```
**Phase 3: Implementation** *(1-N agents)*
```
[If one agent]: Fork from coordinator → inherits context → executes spec
[If multiple]: Swarm — coordinator splits spec into chunks, workers claim chunks
```
**Phase 4: Verification** *(1 FRESH agent — CRITICAL)*
```
⚠️ MUST be a fresh agent with NO implementation context
Only receives: original requirements + file diff
Checks:
- [ ] Requirements are met
- [ ] No regressions introduced
- [ ] Tests pass
- [ ] Code quality acceptable
```
---
### Prompt Cache Strategy
| Agent | Fork from? | Shared prefix | Savings |
|-------|-----------|---------------|---------|
| Research agents | No (independent context) | 0 | — |
| Implementer | Yes, from Coordinator | ~[N]k tokens | ~$[X] |
| Verifier | No (fresh — intentional) | 0 | — |
---
### Permission Model
```
Coordinator permissions: [list]
Workers inherit via permission sync: [list]
Bubble up to user for: [sensitive operations]
```
---
### Failure Recovery
| Failure scenario | Detection | Recovery |
|-----------------|-----------|----------|
| Research agent crashes | No task-notification after timeout | Re-spawn with same task |
| Coordinator crashes | Session .claude/pointer file | Resume from pointer |
| Verification fails | Verifier returns rejection | [escalate to user / re-implement / partial accept] |
| Scratchpad write conflict | File lock error | Retry with exponential backoff |
---
### Anti-Patterns Checklist
- [ ] ✅ Verifier has NO access to implementation plan (prevents confirmation bias)
- [ ] ✅ Workers do NOT share mutable state except via scratchpad (prevents races)
- [ ] ✅ Synthesis phase exists between research and implementation (prevents "telephone game")
- [ ] ✅ Context window per agent bounded by task scope (prevents overflow)
- [ ] ✅ Permission level appropriate per agent (researcher = read-only, implementer = full)
Ready to use — no custom definition needed:
| Type | Key constraint | Best for |
|---|---|---|
general-purpose | All tools | Research, implementation, multi-step |
Explore | Read-only tools only | Fast codebase exploration |
Plan | Read-only tools only | Architecture planning |
verification | Read-only tools only | Independent review |
Custom agents: create .claude/agents/[name].md with frontmatter:
---
name: my-agent
description: what it does and when to use it
model: claude-opus-4-6
tools: [Bash, Read, Grep, Glob, FileWriteTool]
---
You are a specialized agent that...