Tdd

Apply when the task requires implementing net-new behavior — features, modules, endpoints, integrations, or any additive change. Drives development through strict red-green-refactor with test-first slicing and deterministic verification.

discountry 0f99bfc 1.4 KB Updated

File contents

TDD Skill

Strict red-green-refactor for all net-new behavior. Test-first, one behavior slice at a time.


Constraints

  • Test-first — no production code without a failing test that demands it.
  • Minimal diff — no unrelated refactors, renames, or formatting churn.
  • Deterministic — control time, randomness, I/O, and concurrency via seams/fakes.
  • Fail fast — no silent error swallowing without a test proving the intent.

Cycle

Per behavior slice, execute the canonical red-green-refactor loop:

  1. Red — one test, failing for the right reason. Name encodes behavior + condition.
  2. Green — minimum production code to pass. No speculative abstraction (Rule of Three).
  3. Refactor — remove duplication, tighten names, simplify flow. Behavior unchanged.
  4. Verify — run smallest relevant target first, then full suite. Report commands + outcomes.

Output

  • Intent: one sentence.
  • Test slices: 3-7 bullets, ordered.
  • Changes: tests added/updated + production code, by file.
  • Verification: commands + pass/fail.
  • Risks: contract changes, flaky-test vectors, uncovered boundaries.

discountry/ritmex-skills/tree/main/skills/tdd commit 0f99bfcbb6

Frequently asked questions

npx skillmds@latest add discountry/tdd