test-driven-development

Enforces red-green-refactor test-driven development workflow for features and bugfixes.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/bilacchi/agents-skills --skill test-driven-development-bilacchi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/bilacchi/agents-skills/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/bilacchi/agents-skills --skill test-driven-development-bilacchi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing code before tests leads to unverified implementations, biased tests written after the fact, and bugs discovered only in production. This Skill enforces a strict test-first discipline so every behavior change is proven by a failing test before any production code exists. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle—write a failing test, verify it fails for the right reason, write minimal code to pass, then refactor while staying green. - Rationalization Detection: Lists common excuses ("I'll test after", "too simple to test") with counterarguments, plus red flags that signal you should delete code and start over. - Testing Anti-Pattern Reference: Covers testing mock behavior, test-only methods in production classes, incomplete mocks, and mocking without understanding dependencies. - Use Case: When fixing a bug like an empty email being accepted, write a failing test reproducing it, watch it fail, implement the minimal validation fix, and confirm all tests pass. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written first.

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 on a new feature?▼

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code that passes. Refactor only while tests stay green, then repeat the cycle for the next behavior.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and confirm the test passes along with all existing tests.

Why should tests be written before implementation code?▼

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature and catches real bugs.

When is it acceptable to skip test-driven development?▼

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Rationalizing a one-time skip is treated as a red flag requiring you to start over.

Why does my test pass when I remove the mock?▼

This signals you were testing mock behavior rather than real component behavior. Unmock the component and assert on real behavior, or mock at a lower level so the side effects your test depends on still occur.