TDD feature implementation pipeline. Orchestrates test-writer and code-reviewer subagents. Use after /spec approval or directly for small features. Trigger: "implement", "build feature", "TDD".
Switch to Plan mode. If a spec exists in specs/, read it. Outline:
Present plan. Wait for approval.
Delegate to test-writer agent with two parallel tasks:
Task A — Behat (acceptance layer):
"Write failing Behat scenarios for: [feature]. Suite: api.
Run vendor/bin/behat --suite=api, confirm all scenarios fail."
Task B — PHPUnit (unit + feature layer):
"Write failing PHPUnit tests for: [feature]. Run
php artisan test(Laravel) orvendor/bin/phpunit(Symfony/agnostic), confirm all tests fail."
Do NOT proceed to Step 3 until:
Report: "X Behat scenarios written (all failing). Y PHPUnit tests written (all failing)."
Write minimal code to pass tests. Implementation is complete when BOTH pass:
vendor/bin/behat --suite=api exits 0php artisan test (Laravel) or vendor/bin/phpunit (Symfony/agnostic) exits 0Delegate to code-reviewer agent:
"Review all changed files against CLAUDE.md and org conventions."
Fix any blocking issues.
feature/<short-description>Summarize: files changed, tests written, pass rate, review result, branch name.