Skip to content

docs: spell out TDD red-green-refactor loop in CONTRIBUTING#14

Merged
paperhurts merged 1 commit into
mainfrom
docs/tdd-discipline
May 24, 2026
Merged

docs: spell out TDD red-green-refactor loop in CONTRIBUTING#14
paperhurts merged 1 commit into
mainfrom
docs/tdd-discipline

Conversation

@paperhurts
Copy link
Copy Markdown
Owner

Summary

Expand the 'Tests are the design contract' bullet in CONTRIBUTING.md into the explicit 6-step TDD loop: write failing test → run + watch it fail for the right reason → minimal code to pass → run + watch it pass → refactor staying green. Calls out the exception for pure renames / type-design refactors where existing tests already cover the surface.

Why

The existing soft wording admitted "I wrote the code then added the test" as compliant — which loses the design-discovery and proof-it-catches-bugs guarantees that make TDD worth doing. The implementation plans in docs/superpowers/plans/ have always specified test-first; this PR formalizes that as documented policy.

Test plan

  • CI green (docs-only change; typecheck + build untouched)
  • CONTRIBUTING.md renders correctly on GitHub

Closes #13

The existing 'regression test is part of the same PR' line allowed
tests-after as compliant, which loses the design-discovery and
proof-it-catches-bugs benefits. Replace with the explicit 6-step
loop (write failing test → run + watch fail for right reason →
minimal code to pass → run + watch pass → refactor staying green).

All existing plans in docs/superpowers/plans/ already follow this;
this commit codifies the practice as documented policy.

Closes #13
@paperhurts paperhurts merged commit 49f4dd1 into main May 24, 2026
1 check passed
@paperhurts paperhurts deleted the docs/tdd-discipline branch May 24, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document TDD discipline in CONTRIBUTING.md

1 participant