superpowers-test-driven-development

Guide Red-Green-Refactor cycles for features and bugfixes.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/fegome90-cmd/fork_agent --skill superpowers-test-driven-development-fegome90-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: superpowers-test-driven-development
Source: https://github.com/fegome90-cmd/fork_agent/tree/main/.kilocode/skills/superpowers-test-driven-development
Command: npx skills add https://github.com/fegome90-cmd/fork_agent --skill superpowers-test-driven-development-fegome90-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the risk of undetected regressions by enforcing a test-first workflow that requires a failing test before you write production code.

Core Features & Use Cases

  • Red-Green-Refactor workflow: Write a failing test, verify it fails, implement the minimal code to pass, verify green, and refactor for clarity.
  • Clear guidance for common tasks: new features, bug fixes, and refactors, all under a test-first discipline.
  • Safe and auditable practice: maintains evidence of testing and design decisions throughout development.

Quick Start

Begin by writing a failing test for the feature you plan to add, then implement the smallest amount of code to make it pass, and finally refactor for clarity.

Frequently Asked Questions about superpowers-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 test-first workflow requiring a failing test before writing production code. The Red-Green-Refactor cycle involves writing a failing test, implementing the minimal code to pass it, and refactoring for clarity to ensure reliable delivery.

How do I apply test-driven development to fix bugs without introducing regressions?

To apply test-driven development for bug fixes, write a failing test that reproduces the bug, verify the failure, implement the smallest solution to make it pass, and refactor safely. This test-first discipline maintains evidence of testing and prevents undetected regressions.

When should I use a test-first workflow for new software features?

You should use a test-first workflow for every new feature to drive reliable delivery and mitigate the risk of undetected regressions. By enforcing a failing test before implementation, you maintain safe and auditable practice throughout development.

What is the best way to refactor code safely while maintaining quality assurance?

The best way to refactor safely is to perform a final refactor during the test-driven development cycle after verifying green. With guardrails in place, you refactor for clarity once the minimal implementation passes the failing test.

Does test-driven development require verifying the failing test before writing implementation code?

Yes, test-driven development requires verifying the failing test before writing implementation code. This minimal step ensures the test accurately captures the missing functionality before you implement the smallest solution to make it pass.

Why does writing tests after implementation lead to undetected regressions in software engineering?

Writing tests after implementation leads to undetected regressions because it skips the failing test verification step. Test-driven development solves this by enforcing a test-first workflow that requires a failing test before production code is written.