test-driven-development

Enforces writing a failing test before implementing production code in a red-green-refactor cycle.

33|1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/infinition/LaRuche --skill test-driven-development-infinition
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/infinition/LaRuche/tree/main/laruche/skills/test-driven-development
Command: npx skills add https://github.com/infinition/LaRuche --skill test-driven-development-infinition

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Tests written after the code only confirm what the code already does, so they can pass while asserting nothing meaningful. This Skill enforces the discipline of writing one failing test first, watching it fail for the right reason, then writing the minimum code to make it pass. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides one behaviour per cycle, from a failing test through minimal implementation to safe refactoring on green. - Bug Fixing via Reproduction Tests: Turns every bug report into a failing test that reproduces the exact symptom before any fix is attempted. - Delegation Discipline: Provides a ready-made brief for handing TDD requirements to sub-agents, including the exact test command and verification rules. - Use Case: When asked to add a retry mechanism, write test_retries_three_times_before_giving_up, watch it fail, implement the smallest passing version, then run the full suite to catch regressions. ## Quick Start Ask the agent to implement the next feature using strict test-driven development with pytest as the test command.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development step by step?▼

Write one failing test named after the behaviour, run it and confirm it fails for the right reason, then write the smallest code that passes. Run the full suite to catch regressions, refactor only while green, and repeat one behaviour per cycle.

How do I fix a bug using test-driven development?▼

Write a test that reproduces the bug and fails with exactly the reported symptom before touching the fix. Then fix the code and watch the test go green, which proves both that the bug was real and that it will be caught if it returns.

What should I do if a new test passes on the first run?▼

A test that passes immediately either means the behaviour already exists or the test asserts nothing. Break the production code deliberately; if the test stays green, rewrite it because it is not testing anything meaningful.

When should I not use test-driven development?▼

Skip TDD for throwaway experiments, generated code, and configuration changes. For exploratory spikes, use a spike approach and discard the result rather than retrofitting tests onto it afterwards.

Why does my test error instead of failing during the red phase?▼

An error usually means an import problem, typo, or missing fixture rather than a genuine assertion failure. Fix the error and re-run until you get a real failure that names the missing behaviour before writing any production code.