tdd

Installation
Summary

Test-driven development with vertical slices, behavior-focused tests, and incremental red-green-refactor cycles.

  • Emphasizes integration-style tests that verify behavior through public APIs, not implementation details; tests should survive refactors unchanged
  • Requires vertical slicing (one test → one implementation → repeat) instead of horizontal slicing (all tests first, then all code), preventing brittle, behavior-insensitive test suites
  • Includes planning phase to confirm interface changes, prioritize behaviors to test, and design for testability before writing code
  • Provides refactoring guidelines covering duplication extraction, module deepening, and SOLID principles, applied only after all tests pass
SKILL.md

Test-Driven Development

Philosophy

Core principle: Tests should verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.

Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how it does it. A good test reads like a specification - "user can checkout with valid cart" tells you exactly what capability exists. These tests survive refactors because they don't care about internal structure.

Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means (like querying a database directly instead of using the interface). The warning sign: your test breaks when you refactor, but behavior hasn't changed. If you rename an internal function and tests fail, those tests were testing implementation, not behavior.

See tests.md for examples and mocking.md for mocking guidelines.

Anti-Pattern: Horizontal Slices

DO NOT write all tests first, then all implementation. This is "horizontal slicing" - treating RED as "write all tests" and GREEN as "write all code."

This produces crap tests:

  • Tests written in bulk test imagined behavior, not actual behavior
Related skills
Installs
89.3K
GitHub Stars
73.5K
First Seen
Feb 10, 2026