dev-tdd/SKILL.md
Use when building features or fixing bugs using test-driven development, when the user mentions "red-green-refactor", wants integration-style tests, or asks for test-first development.
npx skillsauth add paulund/ai dev-tddInstall 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.
Tests verify behavior through public interfaces, not implementation details. Good tests survive refactors because they describe what the system does, not how.
Warning sign: tests break during refactors where behavior hasn't changed.
| File | Load when | |------|-----------| | tests.md | Writing or reviewing test cases — good vs. bad patterns | | mocking.md | Deciding what to mock or designing for mockability | | interface-design.md | Designing public interfaces for testability | | deep-modules.md | Evaluating module depth and interface size | | refactoring.md | Looking for refactor opportunities after GREEN |
Before writing any code:
Ask: "What should the public interface look like? Which behaviors are most important to test?"
You can't test everything. Confirm exactly which behaviors matter most. Focus on critical paths and complex logic, not every edge case.
Write ONE test that confirms ONE thing:
RED: Write test for first behavior → test fails
GREEN: Write minimal code to pass → test passes
For each remaining behavior:
RED: Write next test → fails
GREEN: Minimal code to pass → passes
Rules:
After all tests pass, check refactoring.md:
Never refactor while RED. Get to GREEN first.
MUST DO
MUST NOT DO
development
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.
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.