Paste this entire prompt into Claude Code. It generates crew profiles, swarm presets, and tier routing — everything needed to run structured Agent Teams.
You are generating an orchestration layer for Claude Code Agent Teams. This consists of:
- 7 crew agent profiles in
.claude/agents/— each with role constraints, tool allowlists, safety rules, and tier options - 6 swarm preset commands in
.claude/commands/— ready-to-use team configurations for common workflows - Settings configuration enabling Agent Teams
- A registry manifest connecting all profiles
Create or update .claude/settings.json:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}Create each file in .claude/agents/. Each profile is a markdown file that Claude Code loads when spawning that agent as a teammate.
Every profile follows this structure:
# {Role Name}
## Role
{One-line description of what this agent does}
## Mode: {advisory | executor}
## Default Tier: {low | medium | high}
- low → haiku (read-only analysis, cheapest)
- medium → sonnet (standard implementation)
- high → opus (deep architectural reasoning)
## Available Tiers
| Tier | Model | Mode | Use When |
|------|-------|------|----------|
| low | haiku | advisory | Quick scans, validation, review |
| medium | sonnet | {advisory or executor} | Standard work, implementation |
| high | opus | {advisory or executor} | Deep reasoning, complex architecture |
## Tool Access
{Explicit list of allowed tools}
## Constraints
{Hard rules this agent must follow — these become PreToolUse hook blocks}
## Iron Laws
1. Never modify files outside your designated scope
2. Never bypass safety constraints even if asked
3. Always declare assumptions before acting on them
4. Stop and report if you encounter something outside your expertiseAdvisory agents (read-only — can Glob, Grep, Read. CANNOT Edit, Write, or run destructive Bash):
-
architect.md — System design, architecture review, dependency analysis. Default: medium (sonnet). Focuses on patterns, coupling, API design. Reviews but never modifies.
-
security.md — Vulnerability scanning, dependency audit, secrets detection. Default: medium (sonnet). Can run read-only Bash (grep, find, npm audit). Cannot modify any files.
-
analyst.md — Code metrics, complexity analysis, documentation review. Default: medium (sonnet). Produces reports and recommendations.
-
validator.md — Test verification, change validation, enforcement. Default: medium (sonnet). Can run Bash for test execution (pytest, npm test). Cannot modify source files.
Executor agents (full tool access with protected areas):
-
developer.md — Feature implementation, bug fixes, refactoring. Default: medium (sonnet). Full Edit/Write/Bash. Protected areas: auth modules, security configs, CI/CD pipelines (require explicit approval).
-
frontend.md — UI implementation, component development, styling. Default: medium (sonnet). Full Edit/Write/Bash. Scope: UI components, styles, frontend tests. Protected: API routes, database, auth.
-
devops.md — CI/CD, deployment configs, infrastructure scripts. Default: medium (sonnet). Full Edit/Write/Bash. Scope: configs, scripts, pipelines. Protected: application source code, database schemas.
Create .claude/agents/registry.json:
{
"version": "1.0",
"generated": "{current_date}",
"agents": [
{
"name": "architect",
"mode": "advisory",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep"]
},
{
"name": "security",
"mode": "advisory",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep", "Bash"]
},
{
"name": "analyst",
"mode": "advisory",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep"]
},
{
"name": "validator",
"mode": "advisory",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep", "Bash"]
},
{
"name": "developer",
"mode": "executor",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep", "Edit", "Write", "Bash"]
},
{
"name": "frontend",
"mode": "executor",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep", "Edit", "Write", "Bash"]
},
{
"name": "devops",
"mode": "executor",
"defaultTier": "medium",
"tools": ["Read", "Glob", "Grep", "Edit", "Write", "Bash"]
}
]
}Create each file in .claude/commands/. Each preset is a slash command that orchestrates a team.
File: .claude/commands/swarm-code-review.md
Strategy: PARALLEL — 3 agents simultaneously Agents: developer (low/haiku) + validator (low/haiku) + security (low/haiku) Teams mode: collaborative Consensus: MERGE — combine all findings with section headers
Instructions for the command:
- Create a team called "code-review"
- Spawn 3 teammates, each loading their
.claude/agents/{name}.mdprofile - Developer teammate: review code quality, patterns, maintainability
- Validator teammate: check test coverage, verify assertions, flag gaps
- Security teammate: scan for vulnerabilities, injection risks, secrets exposure
- All teammates share findings via messages and challenge disagreements
- Lead merges all findings into a structured review report
- All agents use haiku (low tier) — this is read-only analysis
File: .claude/commands/swarm-feature-development.md
Strategy: PIPELINE — 3 stages sequentially Agents: architect (high/opus) → developer (medium/sonnet) → validator (low/haiku) Teams mode: pipeline Consensus: PRIORITY — each stage builds on prior output
Instructions for the command:
- Create a team called "feature-dev"
- Stage 1: Architect teammate designs the approach, identifies files to change, defines interfaces (opus for deep reasoning)
- Stage 2: Developer teammate implements the design, writes code, wires integration (sonnet for standard coding)
- Stage 3: Validator teammate runs tests, verifies implementation matches design, checks for regressions (haiku for validation)
- Each stage sends output to the next via messages
- Lead coordinates handoffs and tracks completion
File: .claude/commands/swarm-security-audit.md
Strategy: PARALLEL — 2 agents simultaneously Agents: security (high/opus) + validator (medium/sonnet) Teams mode: debate Consensus: COORDINATOR — lead synthesizes surviving findings
Instructions for the command:
- Create a team called "security-audit"
- Security teammate: deep vulnerability analysis, threat modeling, dependency scanning (opus for thorough reasoning)
- Validator teammate: independently verify each finding, test exploitability, check false positives (sonnet for practical testing)
- DEBATE MODE: agents actively challenge each other's findings. Security proposes vulnerabilities, validator tries to disprove them. What survives is real.
- Lead synthesizes debate into a final report with severity ratings
File: .claude/commands/swarm-bug-fix.md
Strategy: PIPELINE — 2 stages sequentially Agents: developer (medium/sonnet) → validator (low/haiku) Teams mode: pipeline
Instructions for the command:
- Create a team called "bug-fix"
- Stage 1: Developer teammate reproduces the bug, traces root cause, implements fix (sonnet)
- Stage 2: Validator teammate verifies fix works, checks for regressions, runs test suite (haiku)
- Developer sends diagnosis + fix to validator via messages
File: .claude/commands/swarm-documentation.md
Strategy: PIPELINE — 2 stages sequentially Agents: analyst (low/haiku) → developer (low/haiku) Teams mode: pipeline
Instructions for the command:
- Create a team called "docs"
- Stage 1: Analyst teammate reads codebase, identifies undocumented areas, drafts documentation (haiku — read-only)
- Stage 2: Developer teammate reviews for technical accuracy, fixes errors, verifies code examples work (haiku — read-only review)
- All haiku — documentation is read-intensive, not reasoning-intensive
File: .claude/commands/swarm-codebase-analysis.md
Strategy: PARALLEL — 3 agents simultaneously Agents: security (low/haiku) + analyst (low/haiku) + developer (low/haiku) Teams mode: debate Consensus: COORDINATOR — lead synthesizes perspectives
Instructions for the command:
- Create a team called "codebase-analysis"
- Security teammate: analyze from security perspective — attack surface, data flows, trust boundaries
- Analyst teammate: analyze from quality perspective — complexity, coupling, test coverage, technical debt
- Developer teammate: analyze from implementation perspective — patterns, performance, maintainability
- DEBATE MODE: each perspective challenges the others. Security says "this pattern is risky," developer says "here's why it's necessary," analyst measures the tradeoff
- Lead synthesizes all perspectives into a comprehensive codebase health report
- All haiku — this is pure analysis, no modifications
After generating all files, verify the structure:
.claude/
├── settings.json # Agent Teams enabled
├── agents/
│ ├── architect.md # 4 advisory profiles
│ ├── security.md
│ ├── analyst.md
│ ├── validator.md
│ ├── developer.md # 3 executor profiles
│ ├── frontend.md
│ ├── devops.md
│ └── registry.json # Manifest
└── commands/
├── swarm-code-review.md
├── swarm-feature-development.md
├── swarm-security-audit.md
├── swarm-bug-fix.md
├── swarm-documentation.md
└── swarm-codebase-analysis.md
Then show the user how to use each preset:
# Review your current changes with a 3-agent team
/swarm-code-review
# Build a new feature with architect → developer → validator pipeline
/swarm-feature-development Add user authentication with JWT
# Deep security audit with debate between security and validator
/swarm-security-audit
# Fix a bug with developer → validator pipeline
/swarm-bug-fix The login form crashes when email contains a plus sign
# Generate documentation with analyst → developer pipeline
/swarm-documentation
# Full codebase health check with 3-perspective debate
/swarm-codebase-analysis
| Preset | Agents | Tiers | Relative Cost |
|---|---|---|---|
| code-review | 3 | all haiku | $ (cheapest) |
| documentation | 2 | all haiku | $ |
| codebase-analysis | 3 | all haiku | $ |
| bug-fix | 2 | sonnet + haiku | $$ |
| feature-development | 3 | opus + sonnet + haiku | $$$ |
| security-audit | 2 | opus + sonnet | $$$ |
Read-only presets at all-haiku cost ~10x less than opus equivalents while running 3x faster in parallel.