superpowers:test-driven-development

Enforce a Red-Green-Refactor cycle with failing tests before implementation.

6|Updated May 25, 2026
One-click install
npx skills add https://github.com/zhentingWu-wzt/wgenty-code --skill superpowers-test-driven-development-zhentingwu-wzt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: superpowers:test-driven-development
Source: https://github.com/zhentingWu-wzt/wgenty-code/tree/main/.wgenty-code/skills/superpowers/test-driven-development
Command: npx skills add https://github.com/zhentingWu-wzt/wgenty-code --skill superpowers-test-driven-development-zhentingwu-wzt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the uncertainty of untested code and prevents the common pitfall of writing implementation before verifying requirements, ensuring high-quality, regression-proof software.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the agent through the mandatory cycle of writing a failing test, implementing minimal code, and refactoring.
  • Anti-Pattern Detection: Provides strict guardrails against common testing mistakes like mocking behavior instead of real logic or polluting production code with test-only methods.
  • Use Case: When tasked with fixing a bug or adding a feature, this Skill forces the agent to first write a test that reproduces the issue or defines the new behavior, ensuring the solution is verified before it is considered complete.

Quick Start

Apply the test-driven development skill to implement the new user authentication feature by first writing a failing test case.

Frequently Asked Questions about superpowers:test-driven-development

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

FAQPage Schema
How do I enforce a test-driven development cycle for feature development?

Test-driven development prevents untested code by requiring you to write a failing test that defines new behavior before any implementation. This regression-proof approach ensures high code quality by verifying requirements upfront through the Red-Green-Refactor cycle.

Why does mocking behavior instead of real logic cause testing anti-patterns?

Mocking behavior instead of real logic creates testing anti-patterns by decoupling tests from actual production behavior and reducing validation accuracy. Strict test-first principles provide guardrails against improper mocking and prevent polluting production code with test-only methods.

Can I use test-first principles for both bug fixes and refactoring tasks?

Yes, test-first principles apply directly to bug fixes and refactoring tasks. For bug fixes, you first write a failing test reproducing the issue, then implement the solution. This maintains high code quality and prevents regressions across all task types.

What is the best way to start TDD when adding a new authentication feature?

The best way to start TDD for a new authentication feature is to write a failing test case that defines the expected authentication behavior. This initial failing test verifies requirements before you implement any production code for the feature.

How do I avoid test-only production code when following Red-Green-Refactor?

To avoid test-only production code during Red-Green-Refactor, rely on anti-pattern detection guardrails that prevent polluting production logic with test-specific methods. Maintain strict separation by testing real behavior rather than injecting test-only code paths.