test-driven-development

Define a test-driven development workflow with explicit Red-Green-Refactor steps.

70|6|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/earchibald/vsc-superpowers --skill test-driven-development-earchibald
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/earchibald/vsc-superpowers/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/earchibald/vsc-superpowers --skill test-driven-development-earchibald

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a disciplined, test-first workflow to prevent regressions by requiring tests before code and guiding teams through the Red-Green-Refactor cycle.

Core Features & Use Cases

  • Enforces writing a failing test first to define expected behavior.
  • Guides through the Red-Green-Refactor cycle for features, bug fixes, and refactors.
  • Includes guardrails to keep tests small, focused, and maintainable.

Quick Start

Run a failing test first to reveal the current behavior, then implement the minimum code to pass and refactor.

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 workflow requiring a failing test before production code. The red-green-refactor cycle defines expected behavior, implements minimum code to pass, and refactors while keeping tests reliable.

How do I start using test-driven development for bug fixes and feature work?

Start test-driven development by running a failing test first to reveal current behavior. Implement the minimum code required to pass the test, then refactor the implementation while maintaining reliable test validation.

Does test-driven development work for refactoring existing code and behavior changes?

Test-driven development applies to refactoring and behavior changes by enforcing a test-first sequence. It specifies validation criteria and guardrails to ensure tests fail before production code modifications, preventing regressions.

Why does test-driven development require tests to fail before writing production code?

Test-driven development requires failing tests first to validate that the test accurately targets undefined behavior. This guardrail prevents false positives and ensures production code implementation directly addresses the expected behavior.

What are the limitations of test-driven development for maintaining unit tests?

Test-driven development requires strict discipline to keep tests minimal and focused. Without adhering to guardrails, unit tests can become bloated and unmaintainable, reducing the reliability of the quality assurance workflow.

Can I use test-driven development for quality assurance without a specific testing framework?

Test-driven development standardizes a workflow agnostic to specific frameworks. It defines required action sequences and validation criteria for unit testing, ensuring tests fail first and pass after implementation across any platform.