rust-tdd

Installation
SKILL.md

Rust TDD

One invariant carries the whole method: the test fails first, for the reason you predicted. A test written after the implementation only shows that the code does what the code does. Every step below serves that invariant.

The cycle

Repeat this cycle for each behavior. One test, one behavior, one cycle.

  1. RED — Write one failing test. Write down the expected failure in one sentence: which assertion fails, and with which value. Run the test and compare.
  2. GREEN — Write the minimum implementation that makes the test pass. Run the test again. Add no code that no test requires.
  3. REFACTOR — Clean up the test and the implementation. Run the tests of the crate.

Run the format and lint gate once before each commit, not after each cycle. The Verification section has the commands.

Installs
11
GitHub Stars
7
First Seen
Aug 19, 2026