tdd

Enforces test-first development with failing tests observed before production code changes.

3|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/gen4recomp/gen4recomp --skill tdd-gen4recomp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/gen4recomp/gen4recomp/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/gen4recomp/gen4recomp --skill tdd-gen4recomp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents backfilled tests and unverified behavior changes by requiring a failing test to be observed before any production code is written, ensuring every edit is anchored to an observable contract. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing one failing test, verifying it fails for the intended behavioral reason, then implementing the minimum code to make it green. - Test Layer Selection: Directs each behavior to the cheapest isolating layer — unit, component integration, graphics smoke, ROM conformance, or acceptance tests. - Stateful and Failure-Mode Coverage: Requires failure and multi-step sequence tests for stateful, cached, asynchronous, persistent, or resource-owning code. - Use Case: When fixing a bug in a Lua module of a LÖVE game, write a failing unit test next to the module, confirm it fails for the behavioral reason, implement the fix, then run the layer, full suite, and lint. ## Quick Start Ask the assistant to implement a bug fix or feature using the tdd skill so it writes a failing test first and verifies it turns red before changing production code.

Frequently Asked Questions about tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I practice test-driven development on a bug fix?

Write one failing test that names the missing behavior, run it and confirm it fails for the behavioral reason rather than a syntax or require error, then implement the minimum code to make it green and refactor while green.

How do I choose the right test layer for a behavior?

Pick the cheapest layer that isolates the failure cause: unit tests next to the module for pure logic, component integration for real collaborators, graphics smoke for LÖVE rendering, and acceptance tests only when composition is the contract.

When is TDD not required for a code change?

Docs-only or skill-only edits are exempt. Everything else — features, bug fixes, stateful or resource-owning changes, and refactors of unprotected behavior — requires a failing or characterization test first.

Why does my test fail before I write any production code?

A red result is only meaningful if it names the missing behavior. Failures from require paths, syntax errors, missing capabilities, or wrong fixtures mean the test itself is broken and must be fixed before it can signal anything.

What extra tests does stateful or asynchronous code need?

Add at least one failure or multi-step sequence test, such as an Nth-stage acquisition failure, a double dispose, a busy or reentrant start, or last-known-good preservation, beyond the happy-path test.