| name | sdlc-implement |
| description | Phase 5 of the SDLC. Use this to write code that satisfies the tasks, strictly test-first (TDD). Triggers when tasks.md exists and design is done or not needed. Implements one task at a time, writing a failing test before code, then making it pass, then refactoring. Persists progress to memory after each task so work survives session boundaries. |
Phase 5 — Implement (TDD, one task at a time)
Preconditions
specs/<feature>/tasks.md exists.
- Design done OR feature is non-UI.
The loop (per task, in order)
- Read the task's definition of done.
- Red — write the failing test that encodes the definition of done. Run it; confirm it fails.
- Green — write the minimum code to pass. Run the test; confirm it passes.
- Refactor — clean up while keeping tests green.
- Persist a memory checkpoint (task ID, files touched, status). Update
.sdlc/state.json.
- Move to the next unblocked task.
This Red→Green→Refactor discipline comes from superpowers-core — defer to it for the
exact TDD micro-workflow and brainstorming when a task is ambiguous.
Rules
- TDD is mandatory unless
memory/constitution.md explicitly downgrades it for this repo.
- Never mark a task done with a failing or skipped test.
- If a task turns out underspecified, STOP and route back to
/tasks to split it — do not
silently expand scope.
- Ask before any side-effecting command (commit, push, install global deps).
Exit
When all tasks pass: update state (phase=implement, done). Persist. Say: "Implementation complete. Next: /review."
Примітка (UK)
Реалізація йде строго test-first: спершу падаючий тест (Red), потім мінімальний код (Green),
потім рефакторинг. Після кожної задачі — чекпойнт у пам'ять, щоб робота пережила /clear.