From quangflow
Referenced by `3-handoff.md`, `dev-teammate.md`, and `cook.md`. Ensures test-driven development is followed, not just claimed.
npx claudepluginhub duongmquang/quangflowqf/_protocols/# TDD Enforcement Protocol Referenced by `3-handoff.md`, `dev-teammate.md`, and `cook.md`. Ensures test-driven development is followed, not just claimed. --- ## HARD-GATE <HARD-GATE> Do NOT write implementation code until a failing test exists for the requirement being implemented. No exceptions. No "I'll test it after." The test comes first — always. </HARD-GATE> --- ## RED-GREEN-REFACTOR Cycle Every implementation task follows this exact sequence: ### Step 1: RED — Write a Failing Test - Write a test that describes the expected behavior - Run it. It MUST fail. - Save the failing o...
Referenced by 3-handoff.md, dev-teammate.md, and cook.md. Ensures test-driven development is followed, not just claimed.
Every implementation task follows this exact sequence:
.evidence/tdd/REQ-{ID}-red.log.evidence/tdd/REQ-{ID}-green.logfeat(REQ-{ID}): {description}For each requirement implemented via TDD:
REQ-{ID}-red.log MUST exist — proves the test failed before implementationREQ-{ID}-green.log MUST exist — proves the test passed after implementationPhase 4 verification will audit these logs. Missing logs = failed gate.
| Statement | Response |
|---|---|
| "I wrote the test and implementation together" | That is not TDD. Delete the implementation, verify the test fails, then re-implement. |
| "The test is trivial so I skipped the red phase" | Save the red log anyway. Trivial tests still need evidence. |
| "I'll write the test after I figure out the design" | Write a test for the interface you want. The test IS the design exploration. |
| "This code is just glue / config / boilerplate" | See Scope below. If it has logic, it needs a test. |
| "The test framework isn't set up yet" | Setting up the test framework IS the first task. Do it before any feature code. |
When in doubt: write the test. The cost of an unnecessary test is near zero. The cost of a missing test is unbounded.
When used in a team pipeline (cook.md):