test-driven-development

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

1|1|Updated Dec 28, 2025
One-click install
npx skills add https://github.com/ssimhan/meal-planner --skill test-driven-development-ssimhan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ssimhan/meal-planner/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/ssimhan/meal-planner --skill test-driven-development-ssimhan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams avoid ambiguous functionality by requiring tests before implementing production code, reducing bugs and drift.

Core Features & Use Cases

  • Red-Green-Refactor: Write a failing test, make it pass, then refactor.
  • Minimal, Maintainable Code: Ensure production code only exists to satisfy tests.
  • Safe Refactoring: Refactor with confidence as tests validate behavior.

Quick Start

Start by writing a failing test for the feature you plan to implement, then run your test suite to observe the failure. Implement the smallest amount of production code to pass the test, run tests again, and finally refactor for readability and maintainability while keeping all tests green.

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 it help fix uncertain code behavior?

Test-driven development is an approach requiring tests before implementation to reduce bugs and ambiguous functionality. It enforces a red-green-refactor workflow to drive minimal production code and validate behavior through automated tests.

How do I apply the red-green-refactor workflow for feature development?

To apply the red-green-refactor workflow, write a failing test for your planned feature, implement the minimal production code to pass it, and then refactor for readability while keeping all tests green. This ensures reliable, regression-free behavior.

Can I use test-driven development for safe code refactoring?

Yes, you can use test-driven development for safe refactoring across projects. By validating code behavior through automated tests, you can refactor with confidence knowing that existing functionality remains regression-free and maintainable.

What is the best way to ensure minimal and maintainable code during bug fixes?

The best way to ensure minimal, maintainable code during bug fixes is to write a failing test first, then implement only the production code needed to satisfy that test. This prevents code drift and reduces bugs.

Does test-driven development require specific testing frameworks to work?

No, test-driven development does not depend on specific frameworks. It applies across any projects requiring reliable behavior by enforcing the red-green-refactor workflow and validating code behavior through whatever automated test suite you use.

When should I not use test-driven development for software engineering?

You should avoid test-driven development when exploring experimental spikes where behavior is undefined, as the workflow requires writing failing tests first to drive minimal production code and validate specific, predictable functionality.