test-driven-development

Guide the Red-Green-Refactor cycle for Test-Driven Development.

1|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/nimeshgurung/artifact-hub-collections --skill test-driven-development-nimeshgurung
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/nimeshgurung/artifact-hub-collections/tree/main/skills/raw/obra/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/nimeshgurung/artifact-hub-collections --skill test-driven-development-nimeshgurung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces the Test-Driven Development (TDD) methodology to ensure that code is written with robust, verifiable tests from the outset, preventing bugs and improving code quality.

Core Features & Use Cases

  • Enforces TDD Cycle: Guides users through the Red-Green-Refactor process.
  • Mandatory Failing Test: Ensures tests actually verify behavior by requiring failure first.
  • Use Case: When starting any new feature or bug fix, use this Skill to write a failing test before writing any implementation code, ensuring the test accurately reflects the desired outcome.

Quick Start

Follow the Red-Green-Refactor cycle for all new code development.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the test-driven development cycle and how does it work?

Test-driven development is a coding methodology enforcing the Red-Green-Refactor cycle. It requires writing a failing test before implementation to verify behavior, prevent regressions, and improve code quality.

How do I start writing code for a new feature using TDD?

To start a new feature using TDD, first write a failing test that reflects the desired outcome. Then write the minimum implementation code to pass the test, and finally refactor the code while ensuring tests remain green.

When do I need to write a failing test before writing implementation code?

You need to write a failing test before writing implementation code whenever starting any new feature, bug fix, or refactoring task. This ensures tests accurately verify desired behavior and prevent future regressions.

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

Yes, test-driven development is applicable to refactoring tasks. By ensuring existing tests pass before and after code modifications, you maintain code quality and prevent regressions during structural improvements.

Why does test-driven development require a failing test first?

Test-driven development requires a failing test first to guarantee the test actually verifies behavior and reflects the desired outcome. This principle prevents false positives and ensures code quality.

What are the limitations of enforcing the Red-Green-Refactor cycle?

Enforcing the Red-Green-Refactor cycle strictly prohibits writing any production code without a failing test first. This limitation requires adherence to the methodology for all development, bug fixes, and refactoring tasks.