test-driven-development

Write a failing test before implementing production code.

2|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/LisztVan/subcli-cpp --skill test-driven-development-lisztvan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/LisztVan/subcli-cpp/tree/main/.pi/skills/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/LisztVan/subcli-cpp --skill test-driven-development-lisztvan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents implementation work from outrunning verification, so features and bug fixes are proven by a failing test before production code is written.

Core Features & Use Cases

  • Fail-First Workflow: Guides you through red-green-refactor so every behavior change starts with a test that captures the requirement.
  • Real Behavior Testing: Encourages tests that validate actual code paths instead of mock behavior or test-only shortcuts.
  • Regression Protection: Helps you lock in fixes for bugs, refactors, and interface changes with repeatable, reviewable checks.
  • Use Case: When adding a retry helper, you write the failure case first, confirm it fails, implement the smallest passing solution, and keep the test as a regression guard.

Quick Start

Ask the AI to help you write the first failing test for the behavior you want to add, then implement only enough code to make that test pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start writing unit tests before implementing new features?

To start writing unit tests before implementation, write a failing test that captures the specific behavior requirement, confirm it fails, then add only enough production code to make it pass.

What is the red-green-refactor workflow for deterministic verification?

The red-green-refactor workflow requires writing a failing test first to prove the requirement, implementing minimal code to pass it, and then refactoring safely while maintaining regression protection.

How do I use unit tests to prevent regression when fixing bugs?

To prevent regression when fixing bugs, write a failing unit test that reproduces the specific bug, implement the fix to turn the test green, and keep the test as a repeatable regression guard.

When do I need real-behavior tests instead of mock behavior tests?

You need real-behavior tests when validating actual code paths to ensure deterministic verification, avoiding test-only shortcuts or mock behavior that might hide integration failures.

Can I apply test-driven development to refactoring existing code?

Yes, you can apply test-driven development to refactoring by writing failing tests that lock in current interface changes and behavior, ensuring your structural modifications have strict regression protection.

What is the best way to enforce fail-first discipline in software engineering?

The best way to enforce fail-first discipline is to prevent production code from being written until a failing test proves the requirement, requiring strict verification that each test fails before code is added.