test-driven-development

Write failing tests before implementation using the red-green-refactor cycle.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/lightxue/dotfiles --skill test-driven-development-lightxue
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/lightxue/dotfiles/tree/main/agent/skills/test-driven-development
Command: npx skills add https://github.com/lightxue/dotfiles --skill test-driven-development-lightxue

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams ensure features are driven by automated tests, catching regressions early and guiding design before implementation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement minimal code, then refactor.
  • Guardrails for code quality: prevents production code without tests and promotes safer refactors.
  • Use cases: new features, bug fixes, and behavior changes where you need confidence and maintainable code.

Quick Start

Write a failing test for the desired behavior, then implement the minimal code required 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
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a workflow where you write a failing test, implement minimal production code to pass it, then refactor. This red-green-refactor cycle ensures code correctness and guides design before implementation.

How do I start writing tests before implementation for a new feature?

To start test-driven development for a new feature, write a failing unit test defining the desired behavior, then implement the minimal code required to make that test pass, ensuring the feature is driven by automated tests.

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

Yes, test-driven development applies to bug fixes, refactors, and behavior changes. It establishes a test-driven workflow that catches regressions early and prevents production code without tests to ensure maintainable code.

Why does test-driven development require writing minimal production code?

Test-driven development requires minimal production code to enforce discipline in test creation and ensure the implementation strictly adheres to the test specifications, preventing over-engineering and promoting safer refactors.

Does test-driven development prevent regressions when refactoring?

Yes, test-driven development prevents regressions during refactoring by establishing guardrails for code quality. It ensures automated tests are written before implementation, catching regressions early and guiding design.