Skip to content

Document TDD discipline in CONTRIBUTING.md #13

@paperhurts

Description

@paperhurts

What

Add an explicit TDD section to CONTRIBUTING.md's 'Code expectations' that spells out the RED → verify-RED → GREEN → verify-GREEN → REFACTOR loop. The current document mentions 'regression test is part of the same PR' but doesn't say write the test first or watch it fail for the right reason.

Why

  • The current 'tests are the design contract' line is too soft — it admits 'I wrote the code then added the test' as compliant, which loses the design-discovery benefit of TDD
  • Test-passes-immediately doesn't prove the test catches anything. The 'watch it fail' step is the actual guard
  • All existing implementation plans (docs/superpowers/plans/) already specify 'Write the failing test → Run and verify failure → Implement → Run and verify passing' — codifying that as policy formalizes existing practice

Scope

  • Expand the 'Tests are the design contract' bullet in CONTRIBUTING.md with the 6-step loop
  • Call out the exception for pure renames / type-design refactors where existing tests already exercise the surface

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions