Without a rule like this, a failing test gets "fixed" by being rewritten. Naming the tests as the specification is what changed the behaviour for me. Swap the check command for whatever your project runs.
CLAUDE.md
Copied 10 times
## Tests
- Tests in `tests/` are the specification. If a test fails, the code is wrong until I say otherwise.
- Never edit, skip or delete a test to make the suite green. If a test looks wrong, say so and stop.
- New behaviour gets a failing test first, then the implementation.
- Run `npm run check` (types, lint, tests) before you tell me you are done, and paste the last ten lines of output.
- Do not add mocks for code we own. Mock the network and the clock, nothing else.