/team-implement — Spec-Driven Team Implementation. Use when the user wants to implement a feature from existing research (spec.md + plan.md). Spawns parallel teammate agents, each owning a concern boundary. Requires explicit invocation.
You are executing a spec-driven team implementation. Research has already been done by someone else. Your job is to read the specs, understand the architecture, define concern boundaries, and spin up a team of agents to build it.
You are the Team Lead. Follow CLAUDE.md Section 2A exactly.
The user will provide a research domain path (a directory containing spec documents). If they didn't, ask for it.
research.md — background research and findingsspec.md — the specification (required)plan.md — the implementation plan (required)tasks.md — pre-existing task breakdown (optional)*-findings.md — any additional research findingsCLAUDE.md — you will enforce its team protocol.tasks/lessons.md if it exists — internalize past mistakes.If there is no spec.md or plan.md, STOP and tell the user: "This domain has no spec or plan. Run /team-research first before using /team-implement."
Before defining any boundaries, you MUST understand the existing project structure:
.ts, .tsx, .py, .go, .rs, .sql, .toml, .yaml, etc. This determines the provenance header format.src/foo/bar.ts", read that file. Understand the patterns, conventions, and style already in place.Look for tasks.md in the research domain directory. This is the implementation task breakdown.
If tasks.md does NOT exist, you must create it before proceeding:
spec.md and plan.md to extract every discrete implementation task.tasks.md in the research domain directory. See TASKS-TEMPLATE.md for the format.Present tasks.md to the user for review before proceeding. Do not spawn teammates until the user approves the task breakdown.
From tasks.md, identify 2-5 concern boundaries that become teammates. Each boundary must:
Maximum 5 teammates. If the work is small enough for 2, use 2. Don't create teammates for the sake of parallelism.
Follow CLAUDE.md Section 2A Steps 1-4 exactly. You MUST use Team Mode (not naive subagent spawning):
TeamCreate.TaskCreate for every item in tasks.md, with addBlockedBy/addBlocks for dependency ordering.git worktree add .claude/worktrees/<teammate-name> -b team/<team-name>/<teammate-name> HEAD
Task tool with team_name and name parameters (this is what makes them Team members, not subagents). Do NOT use isolation: "worktree" — you already created worktrees manually. Spawn ALL teammates in a single message with parallel Task calls. Use the template in TEAMMATE-TEMPLATE.md.Why Team Mode, not subagents: Teammates work in isolated git worktrees on dedicated branches. The Team Lead merges their branches after completion. This allows parallel file writes without conflicts and preserves a merge-able git history. Naive subagents (Task without team_name) don't get worktrees, can't be coordinated via SendMessage, and can't be tracked via TaskList.
tasks.md and their concern section. They will pick up tasks themselves.Task calls.While teammates work:
TaskList for progress.SendMessage to tell B to pull from A's branch.When all teammates report completion:
SendMessage with type: "shutdown_request" to each. Wait for confirmation.--no-ff.tsc --noEmit, mypy, cargo check)npm test, pytest, cargo test)tasks.md — mark all completed tasks with [x].provenance.md — in the research domain directory, list every created/modified file with task IDs and change summaries. See PROVENANCE-GUIDE.md.done- to signal that the research has been implemented (e.g., research/phase-08/skills-tools-model/ → research/phase-08/done-skills-tools-model/). Use mv to rename in place.TeamDelete.Provide a summary to the user:
## Implementation Complete
**Domain**: <research domain>
**Spec**: <path to spec.md>
**Branch**: <current branch>
### What was built
- <high-level summary per concern boundary>
### Files changed
- <list of created/modified files, grouped by concern>
### Verification
- <type-check results>
- <test results>
### Provenance
See `<research-domain>/provenance.md` for full file-to-spec traceability.
### Next steps
- <anything the spec deferred or flagged as future work>
tasks.md.provenance.md in the research domain directory listing every created/modified file. Do NOT add provenance headers to source files. See PROVENANCE-GUIDE.md.tasks.md to user for approval before spawning any teammates.$ARGUMENTS