testinglisted
Install: claude install-skill JorgeCostaMacia/skills
# Testing & TDD (principles)
Canon-anchored: sections marked **[canon]** state the standard; **[our convention]** marks deliberate positions, each with its why. Where test files live and which framework/tooling to use is each stack skill's decision. **Rules get revised, not forced: if one fights the reality of a project, question the rule.**
## Done means tested — [our convention]
A use case, rule, or fix without tests **doesn't exist**. Tests are part of the change — same commit, same PR, same definition of done — never a follow-up task.
The one exception: a **thin driving adapter** — one that only unpacks its input and calls a use case, with no rule of its own — may go without a unit test of its own. The composition test proves it is wired, and it is watched in production until it has behaved. Anything holding a rule is tested.
## The loop — [canon: red-green-refactor]
1. **Red** — write the failing test that states the expected behavior. Name it first: if you can't name it, you don't know what you're building yet.
2. **Green** — the simplest code that passes. No gold-plating.
3. **Refactor** — with green tests: names, duplication, structure. Tests are code — they refactor too.
**[our convention]** Pragmatics over ritual: an exploratory spike may come first — but the tests are written **before the work is considered done**, and the design is re-checked against them. The non-negotiable is the end state (tested), not the ceremony.
## The test pyramid — [canon]
```