Test-driven development discipline and testing strategy for production applications. Use when: writing tests, fixing bugs, implementing features, running test suites, choosing what to test, or when the agent skips testing. Enforces RED-GREEN-REFACTOR cycle and the Prove-It Pattern for bug fixes.
From cksnpx claudepluginhub cardinalconseils/claude-starter --plugin cksThis skill is limited to using the following tools:
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Domain expertise for test-driven development, test strategy, and the discipline of proving code works through automated tests. Covers the TDD cycle, the Prove-It Pattern for bug fixes, test pyramid, what to test, framework patterns, and mocking discipline.
The cycle repeats for each behavior. Small cycles (5-15 minutes) keep you focused.
Never fix a bug without a test. "I fixed it" without a test means "I think I fixed it."
| Level | Quantity | Speed | Scope | Examples |
|---|---|---|---|---|
| Unit | Many (70%) | Fast (ms) | Single function/class | Pure logic, transformations, validators |
| Integration | Some (20%) | Medium (s) | Multiple components | API routes + DB, service + external API |
| E2E | Few (10%) | Slow (s-min) | Full user flow | Login -> create -> verify in UI |
Invest most effort in unit tests. They run fast, catch most bugs, and pinpoint failures.
| Layer | Recommended Tools |
|---|---|
| Unit tests | Jest, Vitest, pytest, Go testing |
| Component tests | Testing Library (React/Vue/Svelte) |
| API integration | Supertest, httpx, requests |
| E2E tests | Playwright, Cypress |
| Mocking | jest.mock, vi.mock, unittest.mock |
describe("UserService", () => {
describe("createUser", () => {
it("creates a user with valid email and password", ...)
it("throws ValidationError when email is empty", ...)
it("throws ConflictError when email already exists", ...)
})
})
Pattern: it("[expected behavior] when [condition]")
beforeEach / afterEach)| Rationalization | Reality |
|---|---|
| "This is too simple to test" | Simple code with tests stays simple. Simple code without tests becomes complex. |
| "I'll add tests later" | Later means never. The test is the proof. Write it now. |
| "Tests slow me down" | Debugging without tests is what slows you down. Tests are the fast path. |
| "The manual test worked" | Manual tests don't prevent regressions. Automated tests do. |
| "100% coverage is the goal" | Coverage measures lines executed, not correctness. Test behavior, not coverage numbers. |
it.skip, @pytest.mark.skip) left in the suite