TDD
Use: Any impl task. Compose with language skill for tooling. Standalone = fallback.
Cycle
- Write failing test first — defines expected behaviour.
- Implement minimum code → test passes.
- Refactor → still passes.
- Repeat per behaviour slice.
Adapting to Unknown Stack
- Read
CLAUDE.md+package.json/pyproject.toml/Makefile/Cargo.toml→ find test command. - Run existing tests first — confirm baseline green before touching anything.
- Match existing test file naming and structure exactly.
- No test framework present → note gap in PR description; write closest supported equivalent.
Verification Before Commit
Run project lint+test command (pre-commit run --all-files, make test, npm test, etc.). Must be green. No exceptions.
Do / Don't
- DO: test behaviour, not implementation details.
- DO: search existing tests before writing any — understand conventions first.
- DON'T: commit with failing tests.
- DON'T: invent new testing framework — use what's in the repo.
- DON'T: skip verification because stack is unfamiliar — investigate until green.