test-driven-development

Enforce Test-Driven Development by writing failing tests before production code.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/EanLee/article-write --skill test-driven-development-eanlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/EanLee/article-write/tree/main/.github/skills/test-driven-development
Command: npx skills add https://github.com/EanLee/article-write --skill test-driven-development-eanlee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) process to ensure code quality, prevent regressions, and build robust software by requiring tests to be written before implementation code.

Core Features & Use Cases

  • TDD Enforcement: Mandates writing failing tests before any production code.
  • Red-Green-Refactor Cycle: Guides users through the core TDD loop.
  • Use Case: When developing a new user authentication feature, you would first write a test for the login success scenario, ensure it fails, then write the minimal code to make it pass, and finally refactor.

Quick Start

Always write a failing test before writing any new production code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent software regressions?

Test-driven development prevents regressions by mandating the creation of failing tests before writing production code, ensuring all subsequent code changes are continuously verified against expected behavior.

What is the Red-Green-Refactor cycle in TDD?

The Red-Green-Refactor cycle in TDD is the core loop of writing a failing test, creating minimal production code to make it pass, and then refactoring the code while ensuring behavior remains verified.

How do I apply TDD when fixing bugs or adding new features?

To apply TDD when fixing bugs or adding new features, you must first write a failing test that defines the expected behavior, then implement the minimal code required to pass that test before refactoring.

Can I use test-driven development for agile refactoring tasks?

Yes, you can use test-driven development for agile refactoring tasks, as it enforces writing tests to verify existing behavior before modifying production code, thereby preventing regressions during structural improvements.

Why must I write a failing test before writing any production code?

You must write a failing test before production code to strictly enforce the TDD methodology, ensuring the test accurately captures requirements and validates behavior from the very start of development.