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 | All tools | Code review with structured findings |
| agent-teams:team-debugger | All tools | Hypothesis-driven investigation |
| agent-teams:team-implementer | All tools | Building features within file ownership boundaries |
| agent-teams:team-lead | All tools | 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
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
Coordinate parallel code reviews across multiple quality dimensions with finding deduplication, severity calibration, and consolidated reporting. Use this skill when organizing multi-reviewer code reviews, calibrating finding severity, or consolidating review results.
tools
Knowledge base for the codebase-mapper plugin. Provides writing guidelines, tone rules, and diagram conventions for generating human-readable project guides. Referenced by all codebase-mapper agents during document generation. TRIGGER WHEN: referenced by codebase-mapper pipeline agents (codebase-explorer, overview-writer, tech-writer, flow-writer, onboarding-writer, ops-writer, config-writer, guide-reviewer) during document generation. DO NOT TRIGGER WHEN: outside the /map-codebase pipeline (general documentation work should use docs:readme-craft or codebase-mapper:docs-create).
tools
Progressive Web App knowledge base for 2025-2026: Web App Manifest, Service Workers (Workbox 7, Serwist), Web Push (VAPID, RFC 8030/8291/8292, Declarative Push for Safari 18.4+), install flows (beforeinstallprompt, Window Controls Overlay), OPFS storage, Project Fugu, Core Web Vitals (INP < 200ms), security (HTTPS, CSP, COOP/COEP), and distribution (Bubblewrap, PWA Builder MSIX, Capacitor). TRIGGER WHEN: building, auditing, or debugging PWAs, including manifest, service worker, Web Push, install flow, OPFS, Background Sync, Wake Lock, vite-plugin-pwa, Next.js Serwist, @angular/pwa, @vite-pwa/nuxt, Bubblewrap, TWA, PWA Builder, or Capacitor wrapping. DO NOT TRIGGER WHEN: the task is generic frontend styling (use frontend), React performance (use react-development:review-react), cross-platform security unrelated to PWA (use platform-engineering), Tauri or Electron wrappers (use tauri-development), or GA4 / analytics (use digital-marketing).