test-driven-development

Enforce red-green-refactor workflows with failing-test verification before production code.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/Poseidoncode/superpowers-mcp --skill test-driven-development-poseidoncode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Poseidoncode/superpowers-mcp/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/Poseidoncode/superpowers-mcp --skill test-driven-development-poseidoncode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents unreliable implementations by enforcing a disciplined test-first workflow that validates requirements before production code is written.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Guides developers to write failing tests, implement minimal code, and refactor only after tests pass.
  • Test Quality Enforcement: Helps avoid weak tests, mock-driven testing, unnecessary test-only production code, and incomplete validation.
  • Use Case: Apply this Skill when building new features, fixing bugs, or changing behavior to ensure every implementation is backed by verified tests.

Quick Start

Ask the AI to use the test-driven-development skill before implementing a new feature or bug fix.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development for new features and bug fixes?

Test-driven development enforces a red-green-refactor workflow to validate requirements before production code is written. You write a failing test, implement minimal code to pass it, and refactor only after test verification.

What is the red-green-refactor workflow in unit testing?

The red-green-refactor workflow in unit testing requires writing a failing test first, creating a minimal implementation to make it pass, and then refactoring the code safely only after test verification succeeds.

How does test-first development prevent weak tests and unverified production code?

Test-first development prevents unverified production code by enforcing test quality standards that avoid weak tests, mock-driven testing, unnecessary test-only production code, and incomplete validation during software development.

Can I use test-driven development for refactoring and behavior changes?

Test-driven development applies to refactoring and behavior changes by requiring regression validation through automated tests. This ensures every behavior modification is backed by verified tests before implementation changes are introduced.

Do I need to write failing tests before implementing bug fixes?

Writing failing tests before implementing bug fixes is required by this test-first workflow. It validates the bug exists, ensures your fix resolves it, and prevents future regressions through reliable automated tests.

When should I not use a test-first workflow for software development?

A test-first workflow should not be used when minimal implementations cannot be validated or when automated tests are impossible. It enforces failing-test verification, making it unsuitable for scenarios lacking clear behavior expectations.