skills/test-driven-development/SKILL.md
Use when implementing any logic, fixing any bug, or changing any behaviour. Use when you need to prove code works, when a bug report arrives, or when modifying existing functionality. Do NOT use for config changes, data migrations, or dependency updates.
npx skillsauth add paulund/skills test-driven-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Rationalization | Reality | |---|---| | "This is too simple to need a test" | Components fail in simple ways too. If it has a bug cost, it needs a test. | | "I'll write the tests after the code works" | Tests written after code often test the implementation, not the behaviour. They pass because they mirror the code. | | "I'm just refactoring, tests still pass" | If tests still pass without changes, they're testing implementation, not behaviour. Good tests break when you refactor internals. | | "I don't have time to write tests" | Untested code takes longer to debug, and bugs found in production cost 10× more. | | "The test coverage is already good enough" | Coverage numbers measure quantity, not quality. A 100% coverage suite can miss every bug if tests don't assert the right things. |
any or type casts to make the test compile| Topic | Reference | Load When | |-------|-----------|----------| | Testing Patterns | references/testing-patterns.md | Writing unit, integration, component, or E2E tests; looking up assertion syntax or mock patterns |
development
Use when starting a new feature, when requirements are unclear, when asked to write code without a clear spec, or before any non-trivial implementation. Do NOT use for trivial bug fixes or one-line changes.
development
Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters. Detects the stack from dependency files, fetches official documentation, implements following documented patterns, and cites sources for every framework-specific decision.
development
Use when preparing to ship a feature, release, or deployment. Use before merging to main, creating a release, or deploying to production. Do NOT use for CI-only changes or internal refactors that don't reach production.
development
Use when handling user input, authentication, data storage, or external integrations. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services.