atdd-team
Team-Based ATDD Workflow
Orchestrate an agent team that follows the Acceptance Test Driven Development workflow. The team lead coordinates specialist agents through five phases: spec writing, spec review, pipeline generation, implementation, and post-implementation review.
Team Detection
Before creating a team, check for existing teams:
- Read
~/.claude/teams/to list active teams - If a team exists, present the user with a choice:
- Extend — Add ATDD roles (spec-writer, implementer, reviewer) to the existing team. Skip roles that already exist by name.
- Replace — Shut down the existing team and create a fresh ATDD team.
- New team — Create a separate ATDD team alongside the existing one.
If no team exists, proceed directly to team creation.
Roles
Create three teammates with these roles:
| Name | Agent Type | Purpose |
|---|---|---|
spec-writer |
general-purpose |
Writes Given/When/Then acceptance specs in domain language. Follows the atdd skill strictly. |
implementer |
general-purpose |
Implements features using TDD. Unit tests first, then code, until both test streams pass. |
reviewer |
general-purpose |
Reviews specs for implementation leakage. Reviews code for quality. Has the atdd plugin installed. Runs /atdd:spec-check. |
The team lead (the orchestrating agent or user) owns the workflow, reviews specs, approves all work, and enforces discipline. The team lead never delegates approval — specs are the team lead's contract.
Workflow Phases
Execute phases strictly in order. Each phase has a gate that must pass before proceeding to the next phase.
Phase 1 — Spec Writing
Assign to: spec-writer
Send the feature description and instruct the spec-writer to:
- Read the existing codebase to understand domain language
- Write Given/When/Then specs in
specs/[feature-name].txt - Use ONLY external observables — no implementation language
- Follow the GWT format from the atdd skill (semicolon comments, periods at end of statements)
- Send specs back for review before proceeding
Gate: Team lead reviews and approves specs. Do not proceed until approved.
For the detailed prompt template, see references/prompts.md — Phase 1.
Phase 2 — Spec Review
Assign to: reviewer
Instruct the reviewer to audit specs for implementation leakage:
- Class names, function names, method names
- Database tables, columns, queries
- API endpoints, HTTP methods, status codes
- Framework terms (controller, service, repository)
- Internal state or data structures
Also verify: one behavior per spec, clarity for non-developers, language portability.
Gate: Reviewer sends findings. Team lead decides whether specs need revision. If revisions needed, return to Phase 1.
For the detailed prompt template, see references/prompts.md — Phase 2.
Phase 3 — Pipeline Generation
Assign to: Team lead (self) or implementer
Generate or update the 3-stage test pipeline:
- Parser — reads
specs/*.txt, outputs IR - Generator — reads IR, produces runnable tests
- Runner —
run-acceptance-tests.sh
Run acceptance tests after generation. They must fail (red). If they pass, either the behavior exists or the generator is wrong.
Gate: Acceptance tests fail as expected. Pipeline is functional.
For the detailed prompt template, see references/prompts.md — Phase 3.
Phase 4 — Implementation
Assign to: implementer
Instruct the implementer to:
- Run acceptance tests — confirm they fail
- Pick the simplest failing acceptance test
- Write a unit test, then minimal code to pass it
- Refactor, repeat until that acceptance test passes
- Move to next failing acceptance test
- Continue until ALL acceptance + unit tests pass
Rules for the implementer:
- Never modify spec files — they are the contract
- Never modify generated test files — only regenerate
- If a spec seems wrong, stop and ask the team lead
- Report results of both test streams when done
Gate: Both test streams green. Implementer reports results.
For the detailed prompt template, see references/prompts.md — Phase 4.
Phase 5 — Post-Implementation Review
Assign to: reviewer
Two reviews:
- Spec review — Run /atdd:spec-check. Check if implementation details leaked into specs during development.
- Code review — Check test quality, code structure, missing edge cases.
Gate: Reviews clean or issues addressed. Team lead approves.
For the detailed prompt template, see references/prompts.md — Phase 5.
Phase 6 — Mutation Testing (Optional)
Assign to: reviewer or implementer
After both test streams are green and reviews pass, run mutation testing to verify test quality:
- Run
/atdd:mutateto generate mutants and measure mutation score - Analyze surviving mutants — identify real test gaps vs. equivalent mutants
- Run
/atdd:kill-mutantsto write targeted tests for survivors - Re-run mutations to confirm kills
Gate: Mutation score meets target (90%+ recommended). Remaining survivors documented as equivalent mutants.
For the detailed prompt template, see references/prompts.md — Phase 6.
After Completion
When all phases pass:
- Run both test streams one final time to confirm green
- Ask the user whether to commit (do not auto-commit)
- Ask whether to iterate with the next feature (return to Phase 1) or shut down the team
Tips for Team Leads
- Never delegate spec approval. Specs are the team lead's contract.
- Run spec-check twice — before and after implementation.
- Test portability. Verify specs would work for a different implementation language.
- Scope tightly. One feature per cycle. Do not spec the whole system.
- Verify both streams personally before accepting the implementer's work.
- Keep the team informed. When revising specs after review, notify the implementer so they don't work against stale specs.
Additional Resources
Reference Files
For detailed prompt templates for each phase:
references/prompts.md— Copy-paste prompt templates for every phase, including the team creation prompt and all agent instructions