tddlisted
Install: claude install-skill JeronimoRepetto/DwarfAI-Miners
# Failing test first
[`CONTRIBUTING.md`](../../CONTRIBUTING.md) asks contributors to write the test first _"when you
can"_. For an agent that is not a preference, it is the rule — because the thing an agent does
wrong that a human does not is quietly adjust the expectation until the bar clears.
## The rule
1. Write the test first.
2. **Watch it fail**, and check it fails for the reason you expect. A test that passes before the
fix is testing nothing.
3. Make it pass.
4. **Never weaken an expectation to make it pass.** When a test resists, the test is usually right
— several bugs here were found by agents that refused to relax one.
Loosening an assertion, widening a tolerance, deleting a case, or adding a conditional skip in
order to go green are all the same move, and all of them are the failure this rule exists to stop.
## Prove a decision that carries weight
When a choice is load-bearing, break it deliberately and confirm the **specific** test that should
fail does fail. Two designs that looked fine were caught this way. Undo the break immediately.
## House idioms
Copy these rather than inventing a style — verified against the suite:
- **Hand-written fakes, not `vi.mock`.** The named ones are `fakeFs.ts`, `fakeHookFs.ts` and
`memorySqlite.ts`; `CONTRIBUTING.md` gives their paths. `vi.mock` appears in only 2 test files
(5 occurrences) in the whole suite, so reaching for it means you are probably going against the
grain.
- **Injected clocks.** Where a mod