test-driven-development

Enforce a Red-Green-Refactor workflow for feature development, bug fixes, and refactoring.

1|1|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/BumpyClock/dotfiles --skill test-driven-development-bumpyclock
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/BumpyClock/dotfiles/tree/main/.ai_agents/skills_archive/test-driven-development
Command: npx skills add https://github.com/BumpyClock/dotfiles --skill test-driven-development-bumpyclock

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests before code helps prevent regressions and clarifies expected behavior, reducing debugging time and defects.

Core Features & Use Cases

  • Red-Green-Refactor cycle: Write a failing test, make it pass with minimal code, then clean up.
  • Guardrails for changes: Applies to new features, bug fixes, and refactors to ensure behavior is observable via tests.
  • Documentation via tests: Tests serve as living documentation for intended behavior and edge cases.

Quick Start

Write a failing test for the desired feature, then implement the smallest amount of production code to make it pass and iterate.

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 enforcing a Red-Green-Refactor cycle that clarifies expected behavior before production code is written, reducing debugging time and defects.

How do I apply the Red-Green-Refactor cycle when adding new features?

To apply the Red-Green-Refactor cycle, write a failing test for the desired feature, implement the minimal production code to make it pass, then refactor while keeping all tests green.

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

Yes, test-driven development applies to bug fixes and refactors by establishing guardrails that ensure observable behavior via tests before modifying the codebase.

What is the best way to document intended software behavior and edge cases?

The best way to document intended behavior is through test-driven development, where unit tests serve as living documentation for expected outcomes and edge cases.

Why write unit tests before implementing production code?

Writing unit tests before production code clarifies expected behavior upfront and establishes immediate feedback loops, preventing defects and reducing overall debugging time.