test-driven-development

Enforce a failing test before implementing any feature or bug fix.

3|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/seanGSISG/crispy-claude --skill test-driven-development-seangsisg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/seanGSISG/crispy-claude/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/seanGSISG/crispy-claude --skill test-driven-development-seangsisg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing code without tests, or writing tests after implementation, often leads to untested edge cases, fragile code, and a lack of confidence in refactoring. This skill enforces the rigorous TDD cycle to ensure every piece of code is verified.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Guides through writing a failing test, implementing minimal code to pass, and then refactoring.
  • Iron Law Enforcement: Mandates "NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST," preventing common shortcuts and rationalizations.
  • Quality Assurance: Ensures tests truly verify behavior by requiring them to fail first, catching bugs early and preventing regressions.

Quick Start

Use the test-driven-development skill to implement a new feature that retries failed network operations 3 times.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development in my workflow?

Test-driven development enforces writing a failing test before any production code. Write the test first to define expected behavior, watch it fail, implement minimal code to pass, then refactor. This cycle—red-green-refactor—ensures every feature is verified and catches bugs early.

Why should I write tests before implementing code?

Writing tests first prevents untested edge cases and fragile code. A failing test confirms your implementation actually solves the problem. This approach builds confidence in refactoring and reduces regressions by catching issues before they reach production.

What counts as a failing test before implementation?

A failing test must verify the specific behavior you're about to build—for new features, bug fixes, refactoring, or behavior changes. Exceptions exist only for throwaway prototypes, generated code, or configuration files. The test documents what "done" means before you write production code.

Can I use test-driven development for bug fixes and refactoring?

Yes. Test-driven development applies to bug fixes, refactoring, and behavior changes, not just new features. Write a test that reproduces the bug or specifies the refactored behavior, verify it fails, then fix or refactor minimal code to pass. This prevents regressions.

How does the red-green-refactor cycle improve code quality?

Red-green-refactor creates three distinct phases: write a failing test (red), implement minimal code to pass (green), then improve without changing behavior (refactor). This separation ensures tests truly verify behavior, code stays lean, and quality improvements don't introduce bugs.

What's the minimal code needed to pass a test in TDD?

In test-driven development, implement only the code required to make the failing test pass—no extra features or premature optimization. This keeps code focused and testable. Once the test passes, the refactor phase improves design and performance safely.