npx skills add ...
npx skills add darkmatter/skills --skill test-driven-development
Use when the user asks for TDD, test-first, or red-green-refactor, or repository instructions require that cycle. Ordinary requests for tests use when-to-write-tests; a new contract or helper alone does not trigger TDD.
npx skills add darkmatter/skills --skill test-driven-development
Use a few behavior tests through the public interface. This skill is opt-in when the user asks for TDD/test-first, or repository instructions require that cycle. Follow codebase-design for shared readability rules and when-to-write-tests for test scope.
Default is no new test. Smoke the changed path. See when-to-write-tests.
One (or a few) tests that walk the real path: input at the public boundary → through the system → observable result.
Good: seed the old inbound tables, apply the migration, list events, assert facts and metadata survived.
Bad: a test per helper, encoder, or bind-list rewrite.
Prefer real collaborators over mocks. Exercise the route/store/UI path for those contracts; test a public pure function through its inputs and outputs. Supporting notes: tests.md, mocking.md.
Next to the source: foo.test.ts beside foo.ts. Do not create a separate top-level test/ or tests/ directory in a package for these.
Exception: an end-to-end test that spawns the real server or CLI, or spans packages, lives in the repo-root tests/ (for example tests/smoke.test.ts).
Include failure, completion, and cleanup behavior when the contract requires it; a public pure function does not need an application-wide E2E harness.
Do not delete working code to restart TDD. Outside a requested or required TDD cycle, use the repository's proportional validation policy.
User instructions and repository requirements take precedence. Use
when-to-write-tests to avoid redundant tests, not to waive required public
behavior or lifecycle coverage.