test-driven-development

Enforce a failing test-first workflow for each feature or bugfix.

3|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/pedropaulovc/agent-plugins --skill test-driven-development-pedropaulovc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/pedropaulovc/agent-plugins/tree/main/plugins/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/pedropaulovc/agent-plugins --skill test-driven-development-pedropaulovc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents bugs and regressions by forcing you to define expected behavior before writing production code.

Core Features & Use Cases

  • Test-first discipline: Establishes one failing test that proves the feature/bugfix requirement before any implementation.
  • Strict TDD cycle: Red → Green → Refactor with mandatory “watch it fail” and “watch it pass” verification.
  • Guardrails against anti-patterns: Rejects mocks-as-evidence, test-after rationalizations, and “reference/adapt existing code” shortcuts.

Use Case Example: You’re adding a new retry feature—write a test that demonstrates the exact retry behavior, verify it fails for the missing feature, implement the minimal retry logic, then refactor while keeping the tests green.

Quick Start

Use the skill when starting a feature or bugfix by asking it to guide you through writing the first failing test, implementing the minimal code to pass, and performing a final refactor step while keeping all tests green.

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 or bugfix?

Start test-driven development by writing one minimal failing test that defines the expected behavior, verify it fails for the right reason, implement the minimal production code to pass it, and then refactor safely.

What is the red green refactor cycle in unit testing?

The red green refactor cycle is a strict test-driven development workflow requiring you to watch a test fail, write minimal code to watch it pass, and then refactor without adding new behavior or breaking existing tests.

Can I use mocks as evidence when enforcing a test-first workflow?

No, enforcing a test-first workflow rejects mocks-as-evidence, test-after rationalizations, and reference shortcuts to ensure real behavior validation and maintain strict engineering rigor for regression prevention.

When do I need unit testing for regression prevention during refactoring?

You need unit testing for regression prevention during refactoring when changing behavior, ensuring you verify existing tests stay green while restructuring code without adding any new untested functionality.

What should I do if my test-driven development workflow hits an exception or edge case?

When your test-driven development workflow hits an exception or edge case, you should pause and validate the specific behavior with a human partner before continuing the implementation cycle.

Does strict test-driven development require writing tests after implementation?

No, strict test-driven development rejects test-after rationalizations, requiring you to establish one failing test proving the requirement before any production code implementation begins.