test-driven-development

Implement a test-first workflow with failing tests and minimal production code.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill test-driven-development-enigmaicon-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill test-driven-development-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents unreliable changes by forcing a disciplined test-first workflow, so bugs and regressions are caught before production code is added.

Core Features & Use Cases

  • Failing-test-first implementation: Write a minimal test that fails for the right reason, then implement only enough code to make it pass.
  • Tight edit loop (Red-Green-Refactor): Verify the failing test truly fails, confirm it passes after the smallest change, then refactor without changing behavior.
  • Anti-pattern guardrails: Avoid testing mock behavior, adding test-only methods to production code, and mocking without understanding required side effects.
  • Use Case: When fixing a bug, reproduce the expected behavior as a failing test first, implement the smallest fix, and ensure the entire test suite remains green.

Quick Start

Use test-driven-development when you need to implement a new feature or bugfix by writing a failing test before writing the implementation code.

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 test-driven-development for a new feature?

Test-driven-development begins by writing a minimal failing unit test that defines the desired behavior, verifying it fails for the correct reason, and then implementing only enough production code to make it pass.

What is the red-green-refactor workflow in software engineering?

The red-green-refactor workflow is a test-first cycle where you verify a failing test, write the smallest code implementation to pass it, and then safely refactor the codebase without altering the confirmed behavior.

How do I fix a bug using a test-first workflow?

To fix a bug using a test-first workflow, you reproduce the expected behavior as a failing test first, implement the smallest possible fix to turn the test green, and ensure the entire unit testing suite remains regression-free.

What are common mocking anti-patterns in unit testing?

Common mocking anti-patterns include testing the mock behavior itself rather than the production code, adding test-only methods to production classes, and mocking components without understanding their required side effects.

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

Yes, test-driven-development supports refactoring by keeping behavior unchanged. You verify existing tests pass, refactor the production code safely, and rely on the test suite for regression prevention throughout the edit loop.

Why does my unit test fail for the wrong reason during test-driven-development?

A unit test might fail for the wrong reason if it lacks strict red-green verification or contains mock-focused anti-patterns. You must verify the failing test correctly targets the missing production code before implementing the minimal fix.