test-driven-development

Enforce test-driven development with a red-green-refactor workflow.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/steltz/skill-factory --skill test-driven-development-steltz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/steltz/skill-factory/tree/main/references/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/steltz/skill-factory --skill test-driven-development-steltz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD reduces risk by ensuring tests define expected behavior before coding and by guiding design decisions with concrete feedback.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write failing tests first, implement minimal code, then refactor.
  • Early bug detection: catch regressions before they reach production.
  • Clear design guidance: tests specify intended behavior, enabling safer refactoring.

Quick Start

Start by writing a failing test for your new feature, then implement the minimal code to make it pass, and finally refactor for clarity.

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 practice where you write failing tests to define expected behavior before coding. The red-green-refactor cycle means writing a failing test, implementing minimal code to pass it, then refactoring for clarity and safer design.

How do I start writing unit tests before production code for a new feature?

Start writing unit tests before production code by creating a failing test that specifies the intended behavior of your new feature. Next, implement the minimal code required to make that test pass, and finally refactor the code for clarity.

Do I need a specific test framework to enforce test-driven development practices?

You need an automated test framework to enforce test-driven development practices, but no specific one is required. The workflow relies on your existing testing framework to run unit tests and verify that production code meets defined behavior.

Does test-driven development work for bug fixes and refactoring existing code?

Test-driven development works for bug fixes and refactoring existing code. By writing tests that define expected behavior before changing code, you catch regressions early and enable safer refactoring with concrete feedback on design decisions.

Why should I write failing tests first instead of writing code and tests together?

Writing failing tests first reduces risk by ensuring tests define expected behavior before implementation. This approach guides design decisions with concrete feedback and enables early bug detection, catching regressions before they reach production.