obra-superpowers-test-driven-development

Enforce a RED-GREEN-REFACTOR workflow with failing tests before production code.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/cpa03/blueprintify --skill obra-superpowers-test-driven-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: obra-superpowers-test-driven-development
Source: https://github.com/cpa03/blueprintify/tree/main/.opencode/skill/obra-superpowers-test-driven-development
Command: npx skills add https://github.com/cpa03/blueprintify --skill obra-superpowers-test-driven-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill codifies and enforces a test-driven development workflow, ensuring that production code is only implemented after a failing, well-scoped test is written, leading to safer, more maintainable software.

Core Features & Use Cases

  • Red-Green-Refactor: Follow the strict RED-GREEN-REFACTOR loop to drive minimal, testable implementations.
  • Mandatory Red Phase: Require at least one failing test before any production code is written.
  • Verification & Quality: Provides a clear guideline for running tests and validating results during refactoring.
  • Use Case: When implementing a new feature or fixing a bug, describe the expected behavior, write a failing test, then write the minimal code to pass the test, and refactor for readability.

Quick Start

Write a failing test first, then implement the minimal production code to make it pass, and finally refactor for readability and maintainability.

Frequently Asked Questions about obra-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 process work?

Test-driven development is a workflow where you write a failing test, implement minimal production code to pass it, then refactor. The red-green-refactor loop enforces this sequence to ensure reliable, maintainable software.

How do I start writing failing tests before implementing production code?

To start test-driven development, first describe the expected behavior of a new feature or bug fix, then write a well-scoped failing test. Only after the test fails should you write the minimal production code required to make it pass.

Can I use test-driven development for refactoring existing software projects?

Yes, test-driven development applies to refactoring across software projects. You verify existing behavior with tests, then carefully refactor the production code for readability and maintainability while running tests to validate results.

What's the best way to enforce a strict test-driven development workflow for feature development?

The best way to enforce test-driven development is to mandate at least one failing test before any production code is written. This strict red-green-refactor discipline drives minimal, testable implementations for reliable feature delivery.

Why does test-driven development require a mandatory failing test before writing production code?

Test-driven development requires a mandatory failing test to confirm the test actually validates the expected behavior. This ensures you only write minimal production code needed to pass, preventing over-engineering and improving software quality.

When should I not use the red-green-refactor approach for software quality?

The red-green-refactor approach may not suit exploratory prototyping where behavior is undefined. It requires a clear understanding of expected behavior to write well-scoped tests, making it less ideal for early-stage feature discovery.