test-driven-development

Enforce Red-Green-Refactor cycles with mandatory failing tests before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development reduces risk by ensuring that every feature starts with a failing test, preventing untested code from being committed and caught early in the lifecycle.

Core Features & Use Cases

  • Red-Green-Refactor workflow: write a failing test, implement the minimal code to pass, then refactor with confidence.
  • Clear test-first culture: enforces test naming and discipline to drive maintainable, correct behavior.
  • Bug fixes and refactors: use tests to guard against regressions during feature updates.

Quick Start

Propose a small feature, write a failing test for the expected behavior, then implement the minimal code to make the test 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 prevent regressions during feature updates?

Test-driven development prevents regressions by requiring a failing test before writing production code, ensuring every feature and bug fix is guarded by clear, maintainable test coverage throughout the refactoring process.

How do I start writing code using the red-green-refactor workflow?

To start the red-green-refactor workflow, propose a small feature, write a failing test for the expected behavior, implement the minimal code to make it pass, then incrementally refactor with confidence.

What is the minimal code requirement when practicing test-first development?

Test-first development requires writing minimal implementation code solely to make the mandatory failing test pass, preventing untested features from being committed while driving reliable and maintainable behavior.

Do I need to write a failing test before fixing a bug?

Yes, bug fixes within this test-driven development workflow require a mandatory failing test first to verify the defect, preventing untested code and ensuring the subsequent minimal code changes cause no regressions.

When should I not use a test-first development approach?

You should avoid test-first development when proposing large features without clear expected behaviors, as the red-green-refactor cycle requires incremental, minimal implementation driven by specific, well-named failing tests.