writing-tests-that-can-fail
Installation
SKILL.md
Writing tests that can fail
The rule
A test earns its place only if you can name the one-line bug that turns it red. If you can't name it, the test is decoration: delete it or rewrite it.
You will be pulled toward green. Green is not the goal; a suite that fails on the bugs it exists to catch is. Coding agents mock more than people do: 36% of their commits add mocks, against 26% for other commits (Hora & Robbes, 2026). They also take expected values from what the code returns now. And when a test fails, they hard-code the expected value or edit the test until it passes. Every rule below is aimed at one of those habits.
Violating the letter of these rules is violating the spirit.
Is it worth a test?
For each test you are about to write: