Write tests before implementation

cm-tddskillsetup L145
tody-agent/codymaster
What it does

Write tests before implementation code

Best for

Catching regressions and hidden edge cases that manual testing cannot verify

Inputs
  • · Feature spec or bug description
  • · .cm/CONTINUITY.md for edge case patterns
Outputs
  • · Failing test demonstrating behavior
  • · Minimal passing implementation
  • · Refactored clean code
Requires
  • · Jest or comparable test runner
Preconditions
  • · CONTINUITY.md checked for past edge cases
  • · Test fails correctly before writing code
  • · Test passes and other tests stay green
Failure modes
  • · Writing code before test invalidates discipline
  • · Test written after code passes immediately
  • · Skipping Red verification step misses wrong failures
Trust signals
  • · Enforces Red-Green-Refactor cycle with verification
  • · Test must fail before code added
  • · All other tests must stay green