test-driven-development

Enforce red-green-refactor cycles by writing failing tests before code.

Updated May 26, 2026
One-click install
npx skills add https://github.com/koolerkx/vibe-react-2d-map-editor-yaml --skill test-driven-development-koolerkx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/koolerkx/vibe-react-2d-map-editor-yaml/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/koolerkx/vibe-react-2d-map-editor-yaml --skill test-driven-development-koolerkx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing code without verified tests often leads to undetected regressions and brittle behavior. Test-driven development enforces a tests-first mindset that exposes defects early and clarifies intended behavior before implementation.

Core Features & Use Cases

  • RED-GREEN-REFACTOR workflow: write a failing test first, implement the minimal code to pass, then refactor safely.
  • Bug reproduction for fixes: create tests that reproduce issues to guard against regressions.
  • Documentation through tests: tests serve as living documentation of expected behavior and edge cases.
  • Use Case: when adding a new feature, begin with a failing spec and iterate until the test passes.

Quick Start

Write a failing test that reproduces 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 the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development involves writing a failing test first, implementing the minimal code required to pass that test, and then safely refactoring the codebase without changing its behavior.

How do I use unit testing to reproduce a bug fix and prevent regressions?

To use unit testing for bug fixes, write a failing test that reproduces the specific issue first. Once you implement the code to pass this test, it guards against future regressions by validating the corrected behavior.

When should I write failing tests before implementing new software features?

You should write failing tests before implementing new software features to clarify intended behavior and expose defects early. This test-driven approach validates edge cases and serves as living documentation throughout development.

Does test-driven development work for refactoring existing code?

Yes, test-driven development works for refactoring existing code by ensuring test coverage validates behavior before changes. You write tests to document expected behavior, then refactor safely knowing the tests will detect unvalidated code changes.

What's the best way to start a test-driven development workflow?

The best way to start a test-driven development workflow is to write a failing test that reproduces the desired behavior. Then implement the minimal code required to make the failing test pass, followed by safe refactoring.