tdd-workflow

Installation
SKILL.md

TDD Workflow — Red-Green-Refactor Mastery


Mandatory Pre-Flight Context Inspection

Before implementing feature logic or writing unit tests, you MUST inspect:

  1. Red-Green-Refactor Cycle → Write failing test FIRST (Red) → minimal passing code SECOND (Green) → cleanup THIRD (Refactor)
  2. Behavior-First Assertion Rule → Assert public contract results (GIVEN/WHEN/THEN); ban asserting internal private fields or private state
  3. I/O Boundary-Only Mocking → Mock ONLY un-owned external boundaries (database I/O, network fetch); ban mocking pure domain utilities or internal classes
  4. Fast Deterministic Test Runner → Tests must execute in memory in < 100ms per file; avoid unneeded sleep delays or live network connections

Activation Boundaries

  • Activate when: Developing new algorithms, complex business logic, financial calculations, state machine transitions, and fixing bugs via regression reproduction.
  • DO NOT activate when: Writing disposable prototype scripts, pure visual CSS layouts, or static documentation.

2026 TDD & Verification Invariants

Installs
3
GitHub Stars
7
First Seen
Apr 26, 2026