test-driven-development

Guide Red-Green-Refactor cycles with failing tests before implementation.

Updated May 25, 2026
One-click install
npx skills add https://github.com/Chieji/my-skills --skill test-driven-development-chieji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Chieji/my-skills/tree/main/test-driven-development
Command: npx skills add https://github.com/Chieji/my-skills --skill test-driven-development-chieji

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams define expected behavior by writing tests before code, reducing bugs and guiding design.

Core Features & Use Cases

  • Encourages a Red-Green-Refactor cycle to catch regressions early.
  • Ensures production code is driven by explicit requirements.
  • Useful for features, bug fixes, and refactors across projects.

Quick Start

Write a failing test for the feature, then implement the minimal code needed to make it pass.

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 workflow improve feature implementation?

Test-driven development enforces a Red-Green-Refactor cycle that starts with a failing test to define expected behavior, reducing bugs by ensuring production code is explicitly driven by requirements. It guides teams through writing minimal code to pass tests and careful refactoring that preserves behavior.

How do I start writing failing tests before coding a new feature?

To start test-driven development, write a failing unit test that defines the desired feature behavior, then implement the minimal production code needed to make that test pass, and finally refactor the code while preserving the verified behavior.

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

Yes, test-driven development is applicable to bug fixes and refactors across any tech stack. It guides teams through Red-Green-Refactor cycles to catch regressions early and maintain real tests that validate explicit requirements.

What is the best way to maintain real tests and avoid test cheats during refactoring?

The best way to maintain real tests is to follow careful refactoring practices that preserve behavior while avoiding test cheats or over-engineering. This ensures production code remains driven by explicit requirements without artificial test passes.

When should I not use the Red-Green-Refactor cycle for unit testing?

You should avoid test-driven development when over-engineering risks outweigh behavior validation benefits, or when writing minimal production code to pass failing tests becomes impractical for the specific feature scope.

Why does test-driven development require a failing test before writing production code?

Test-driven development requires a failing test first to explicitly define the expected behavior before coding. This ensures the production code written is minimal and directly driven by the actual requirements, reducing bugs and guiding design.