docs: spell out TDD red-green-refactor loop in CONTRIBUTING#14
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expand the 'Tests are the design contract' bullet in
CONTRIBUTING.mdinto 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
Closes #13