superpowers-test-driven-development

Write failing tests before implementing features to enforce the red-green-refactor cycle.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/qq824045252-ship-it/erp --skill superpowers-test-driven-development-qq824045252-ship-it
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: superpowers-test-driven-development
Source: https://github.com/qq824045252-ship-it/erp/tree/main/.agents/skills/superpowers-test-driven-development
Command: npx skills add https://github.com/qq824045252-ship-it/erp --skill superpowers-test-driven-development-qq824045252-ship-it

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establish a disciplined test-driven development workflow by writing failing tests before implementing any feature.

Core Features & Use Cases

  • Red-Green-Refactor cycle: implement tests first, verify failure, then implement minimal code to satisfy tests and refactor for clarity.
  • Clear naming and minimalism: ensure tests describe expected behavior with small, focused scopes.
  • Applicability: suitable for features, bug fixes, refactors, and behavioral changes across software projects.

Quick Start

Write a failing test that captures the desired behavior, run the tests to see the failure, implement the smallest production code to pass, and then refactor while all tests stay green.

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 workflow where you write a failing test first, implement the minimal code to make it pass, and then refactor. The red-green-refactor cycle enforces this sequence to catch regressions early and maintain clear test names.

How do I apply test-driven development to bug fixes and refactoring?

To apply test-driven development to bug fixes and refactors, write a failing test that captures the desired behavior change first. Implement the smallest production code to pass the test, then refactor for clarity while ensuring all tests stay green.

Can I use test-driven development for any software engineering project?

Yes, test-driven development is suitable for new features, bug fixes, refactors, and behavioral changes across software projects. It enforces clear test names, minimal implementations, and automated verification of tests during development regardless of project scope.

What is the best way to start writing unit tests using TDD?

The best way to start TDD is to write a failing test that captures the desired behavior, run the tests to see the failure, implement the smallest production code to pass, and then refactor while all tests stay green to establish a disciplined workflow.

Why does test-driven development require minimal implementations?

Test-driven development requires minimal implementations to ensure tests describe expected behavior with small, focused scopes. Writing only enough production code to satisfy tests prevents over-engineering and maintains fearless regression catching across software projects.

When should I not use test-driven development for writing unit tests?

Test-driven development is broadly applicable to features, bug fixes, refactors, and behavioral changes across software projects. However, it may not suit exploratory spikes where immediate behavior validation is unnecessary and writing failing tests first provides no regression value.