Prompt file imported from loiane/specs-driven-development-spring-angular (
.github/prompts/build.prompt.md). Copyright stays with the author.
/build
Phase: 4 — build (TDD)
Owning agent: .github/chatmodes/spring-implementer.chatmode.md (collaborates with spring-test-engineer)
Skills used: tdd-red-green-refactor, spring-boot-4-conventions, clarity-over-cleverness, junit5-testcontainers-patterns, spring-task-decomposition
Stack routing
| Task type | Red step agent | Green/refactor/simplify agent |
|---|---|---|
Backend (src/main/java/**, src/test/java/**) |
spring-test-engineer |
spring-implementer (this agent) |
Frontend (src/**/*.ts, src/**/*.html, src/**/*.scss) |
angular-test-engineer |
angular-implementer |
Determine the task type from its files_in_scope in 04-tasks.md. If all files are frontend paths, delegate to the Angular agents. If mixed, split into sub-steps: backend first (Spring agents), then frontend (Angular agents).
Purpose
Execute one task end-to-end through the four TDD phases (red → green → refactor → simplify), updating .tdd-state.json and appending a block to 05-implementation-log.md after each phase.
Inputs
<task-id>(e.g.T-001). Required.
Reads
.specs/<feature-id>/04-tasks.md.specs/<feature-id>/03-design.md.specs/<feature-id>/.tdd-state.json.github/skills/tdd-red-green-refactor/SKILL.md(authoritative)
Writes
src/test/**andsrc/main/**files listed intasks[<task-id>].files_in_scope..specs/<feature-id>/.tdd-state.json(phase transitions)..specs/<feature-id>/05-implementation-log.md(one### <task-id> — <phase>block per phase).
Process
For the supplied <task-id>:
- Activate. Set
.tdd-state.jsonactive_task = <task-id>. Refuse if any other task isphase: red|green|refactor|simplify(one task in flight at a time). - Red. Write the smallest test that captures the next AC slice. Run it. Capture the failure message into
tasks[<task-id>].red_failure_excerpt. Setphase: "red". Append log block. - Green. Write the minimum production code under
files_in_scopeto pass the test. Run only the new test, then run all tests. Setphase: "green". Append log block. - Refactor. Improve structure without changing behavior. Re-run all tests. Set
phase: "refactor". Append log block. - Simplify. Apply
clarity-over-cleverness(untangle ternaries, inline once-used helpers, kill dead options, name domain concepts). Re-run all tests. Setphase: "simplify". Append log block. - Done. Set
phase: "done", clearactive_task. If more ACs in this task remain uncovered, immediately re-run from step 2 with the next slice (do not declare done early).
Refuse if
<task-id>is not in.tdd-state.json.- Another task is mid-flight (not
pendingordone). - A
src/main/**edit is attempted whilephase != "red"andred_failure_excerptis empty (this is also enforced by the Claude hookblock-impl-without-failing-test.sh). - Any test edit lands outside
tasks[<task-id>].files_in_scope(enforced byenforce-files-in-scope.sh).
Done when
- Every AC listed under
tasks[<task-id>].acs_coveredhas at least one@Tag("AC-NNN")test. - All four phase blocks are present in
05-implementation-log.mdfor this task. .tdd-state.jsonshowsphase: "done"for<task-id>.- Recommend
/build <next-task>until all tasks done; then/testand/validate.