tdd
Test-Driven Development
TDD is the red → green loop; this skill makes that loop produce tests worth keeping. Choose coverage proportional to the changed contract.
Read the File structure section of the installed domain-modeling/SKILL.md (without that skill, use the paths docs/agents/domain.md records, else the root GLOSSARY-MAP.md or GLOSSARY.md, or legacy CONTEXT-MAP.md or CONTEXT.md) and the selected glossary as read-only context. Use its terms in test names and interfaces. Read docs/agents/workflow.md when present for the repository's feedback-loop contract, and respect ADRs in the area you are touching.
Choose verification first
- Visual styling, layout, typography, copy, and static link corrections: edit and inspect the affected route at relevant viewport sizes; exercise a changed link. Use existing focused checks where useful. These changes need no artificial failing test or new test harness.
- State, validation, calculations, permissions, API contracts, and interaction logic: use a focused failing test at an existing seam. Frontend logic belongs here too.
- Mixed work: test the changed logic and visually inspect presentation. The presence of UI files alone does not select TDD.
After each vertical slice, use the smallest applicable loop from the repository contract: format changed files, run the fastest reliable static check, then run focused behavior tests. Broaden to the full suite, build, preview, or release checks only when the contract or the change's risk requires it.
Honor explicit test-first requests and repository-required checks. When meaningful automated coverage requires disproportionate new infrastructure, use the smallest reliable direct check and report the gap; escalate only for a concrete risk or required coverage.
What a good test is
Tests verify behavior through public interfaces, so they survive refactors that leave behavior unchanged. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what capability exists. Each test makes one logical assertion.