plugins/agent-teams/skills/team-composition-patterns/SKILL.md
Design optimal agent team compositions with sizing heuristics, preset configurations, and agent type selection. Use this skill when deciding how many agents to spawn for a task, when choosing between a review team versus a feature team versus a debug team, when selecting the correct subagent_type for each role to ensure agents have the tools they need, when configuring display modes (tmux, iTerm2, in-process) for a CI or local environment, or when building a custom team composition for a non-standard workflow such as a migration or security audit.
npx skillsauth add acaprino/anvil-toolset team-composition-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Best practices for composing multi-agent teams, selecting team sizes, choosing agent types, and configuring display modes for Claude Code's Agent Teams feature.
| Complexity | Team Size | When to Use | | ------------ | --------- | ----------------------------------------------------------- | | Simple | 1-2 | Single-dimension review, isolated bug, small feature | | Moderate | 2-3 | Multi-file changes, 2-3 concerns, medium features | | Complex | 3-4 | Cross-cutting concerns, large features, deep debugging | | Very Complex | 4-5 | Full-stack features, comprehensive reviews, systemic issues |
Rule of thumb: Start with the smallest team that covers all required dimensions. Adding teammates increases coordination overhead.
A team costs 3-10x the tokens of a single Claude (typical ~7x for plan-mode workflows). Each teammate runs in its own context window and consumes tokens independently. Drivers of cost:
Cheap-team recipe: Opus lead + Sonnet teammates, 2-3 teammates, scope-bounded spawn prompts, Haiku for any role where summarization is the main job. Cost killers: unbounded scope, no file ownership (forces rework), no task dependencies (forces rework on unstable foundations), no TaskCompleted quality gates (forces rework on broken code).
These are enforced by the harness and cannot be worked around with prompt engineering:
Agent cannot itself call Agent to spawn a sub-subagent./resume and /rewind do not restore them.message per recipient by name.Reference: docs/references/agent-teams-best-practices.md § Hard limits.
senior-review:security-auditor + senior-review:code-auditor + a third dimension matching the diff (e.g. senior-review:ui-race-auditor for frontend changes, senior-review:distributed-flow-auditor for cross-service changes). Fall back to agent-teams:team-reviewer only when no specialized agent fits the dimension./team-review, the command auto-selects specialized agents based on the diff and adds Phase 1 context (deep-dive + interconnect map) automatically.team-debuggerteam-lead + 2x team-implementerteam-lead + 1x frontend team-implementer + 1x backend team-implementer + 1x test team-implementerresearch:deep-researcher (for systematic multi-source investigation) or general-purpose fallback; use research:quick-searcher for single-fact lookupssenior-review:security-auditor for OWASP / auth / secrets, platform-engineering:platform-reviewer for client-side hardening (CSP, token storage, secrets in bundles), senior-review:distributed-flow-auditor for cross-service auth flows, and codebase-cleanup:deps-audit (or senior-review:cleanup-auditor) for dependencies / supply chain. Fall back to agent-teams:team-reviewer only if a dimension has no specialized agent.team-lead + 2x team-implementer + 1x team-reviewerresearch:deep-researcher + optional domain expert (auto-selected)codebase-mapper:codebase-explorer + 1x codebase-mapper:documentation-engineer + 1x senior-review:code-auditorapp-analyzer:app-analyzer + 1x research:deep-researcher + 1x frontend:frontend-designteam-lead + 1x tauri-development:rust-engineer + 1x frontend:frontend-engineer + 1x tauri-development:tauri-desktopfrontend:frontend-design (direction) + 1x frontend:frontend-layout (layout) + 1x frontend:frontend-design (UX)frontend:frontend-design (polish) + 1x react-development:react-performance-optimizer (perf) + 1x senior-review:code-auditor (review)When spawning teammates with the Agent tool, choose subagent_type based on what tools the teammate needs:
| Agent Type | Tools Available | Use For |
| ------------------------------ | ----------------------------------------- | ---------------------------------------------------------- |
| general-purpose | All tools (Read, Write, Edit, Bash, etc.) | Implementation, debugging, any task requiring file changes |
| Explore | Read-only tools (Read, Grep, Glob) | Research, code exploration, analysis |
| Plan | Read-only tools | Architecture planning, task decomposition |
| agent-teams:team-reviewer | Read/Write/search/Bash plus TaskList/TaskGet/TaskUpdate/SendMessage | Code review with structured findings |
| agent-teams:team-debugger | Read/Write/search/Bash plus TaskList/TaskGet/TaskUpdate/SendMessage | Hypothesis-driven investigation |
| agent-teams:team-implementer | Read/Write/Edit/search/Bash plus team tools | Building features within file ownership boundaries |
| agent-teams:team-lead | Read/search/Bash plus Agent Teams coordination tools (Agent, TeamCreate, TeamDelete, TaskCreate/List/Get/Update, SendMessage) | Team orchestration and coordination |
Key distinction: Read-only agents (Explore, Plan) cannot modify files. Never assign implementation tasks to read-only agents.
Configure in ~/.claude/settings.json:
{
"teammateMode": "tmux"
}
| Mode | Behavior | Best For |
| -------------- | ------------------------------ | ------------------------------------------------- |
| "tmux" | Split panes (auto-detects tmux or iTerm2's it2 CLI) | Development workflows, monitoring multiple agents |
| "in-process" | All teammates in main terminal, Shift+Down to cycle | Simple tasks, CI/CD environments, any terminal without tmux |
| "auto" (default) | Split panes if already in tmux, otherwise in-process | Most users; no manual choice needed |
Note: "iterm2" is not a separate setting. Split-pane mode uses tmux first and falls back to iTerm2's it2 CLI automatically. VS Code's integrated terminal, Windows Terminal, and Ghostty do not support split panes -- they always use in-process mode.
When building custom teams:
team-lead or have the user coordinate directlyA teammate was spawned as Explore but needs to write files.
Explore and Plan are read-only agents. Change the subagent_type to general-purpose or an appropriate specialized agent type. Never assign implementation tasks to read-only agents.
The team is growing too large and coordination is slowing everything down. Each additional teammate adds communication overhead. Consolidate roles: can one agent cover two dimensions? A 4-person team doing 6 independent tasks is usually better served by 3 agents covering 2 tasks each.
tmux mode is not showing panes.
Ensure tmux is installed and a session is already running before spawning teammates. The in-process mode works without tmux and is suitable for CI or scripted environments.
Two reviewers are flagging the same issues. The review dimensions overlap. Redefine each reviewer's focus area: one on correctness/logic, one on security, one on performance/scalability. Overlapping coverage wastes tokens and produces duplicate findings.
A team-lead is spawning teammates but they are not receiving tasks.
Verify that the lead is using the Agent tool to spawn teammates and passing complete context in the prompt. Teammates start fresh with no prior conversation history -- they need all relevant information in their initial prompt.
development
Quality gates for multi-reviewer code review pipelines: adversarial verification panel, completeness critic, reviewer pipeline conventions, and the context sharing pattern for parallel reviewers. TRIGGER WHEN: running /senior-review:team-review quality gates; running /senior-review:code-review Steps 4b/4c (adversarial verification and completeness check); consolidating or deduplicating findings from multiple parallel reviewers. DO NOT TRIGGER WHEN: single-reviewer style review without a consolidation phase, or generic team coordination (the upstream agent-teams skills cover that).
development
Knowledge base for pure-architecture decisions on when to unify duplicated logic into a shared abstraction versus leave it duplicated. Covers the canonical theory (Rule of Three, DRY/WET/AHA, Wrong Abstraction, Locality of Behaviour, Bounded Contexts, Tidy First options framing, CUPID vs SOLID), 12 essential-duplication patterns that justify unification, 12 wrong-abstraction patterns that justify inlining or decomposition, an operational decision frame, and a verified reading list. TRIGGER WHEN: the user is making an architectural decision about whether to centralize, extract, or remove a layer; reviewing an abstraction for premature generality; auditing scattered cross-cutting concerns; spawned by the abstraction-architect agent during /abstraction-architect:audit or as the Abstraction dimension of /senior-review:team-review or /senior-review:code-review; the user asks "should I extract this into a service" / "is this DRY enough" / "is this wrong abstraction". DO NOT TRIGGER WHEN: the task is code formatting and readability cleanup (use clean-code:clean-code), Python-specific refactoring with metrics (use python-development:python-refactor), generic dead-code removal (use senior-review:cleanup-dead-code), security review (use senior-review:security-auditor), or pure pattern-consistency review without an architecture lens (use senior-review:code-auditor).
development
Unified web frontend knowledge base covering CSS architecture, UX psychology, UI components, distinctive aesthetics, and interface design generation. TRIGGER WHEN: working on web styling, design systems, component decisions, responsive strategy, distinctive frontend aesthetics, or exploring multiple interface designs. DO NOT TRIGGER WHEN: the task is purely backend or unrelated to web frontend.
development
Stripe payments knowledge base - API patterns, checkout optimization, subscription lifecycle, pricing strategies, webhook reliability, Firebase integration, cost analysis, and revenue modeling. Loaded by stripe-integrator and revenue-optimizer agents; also consumable directly when the user asks for Stripe-specific patterns without needing an agent. TRIGGER WHEN: working with Stripe API (Payment Intents, Customers, Subscriptions, Checkout Sessions, Connect, webhooks, tax, usage-based billing), pricing strategy, or revenue modeling. DO NOT TRIGGER WHEN: payment work is non-Stripe (PayPal, Square, crypto) or the task is generic e-commerce unrelated to payments.