test-driven-development

Enforce Red-Green-Refactor cycles with failing tests before production code.

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

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 pitfalls of writing tests after implementation, ensuring that every feature and bug fix is verified by a failing test before a single line of production code is written.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the user through the mandatory TDD cycle to ensure high-quality, testable code.
  • 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 implementing a complex retry mechanism for a network request, this skill forces the creation of a failing test case that simulates failure scenarios, ensuring the implementation is minimal and robust.

Quick Start

Apply the test-driven-development skill to the current feature implementation by writing a failing test case that reproduces the desired behavior before writing any production 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 enforce a strict test-driven development workflow for feature implementation?

To enforce test-driven development, follow a strict Red-Green-Refactor cycle that requires writing a failing test case verifying desired behavior before writing any production code. This ensures all features and bug fixes are validated by tests first.

What is the Red-Green-Refactor cycle in software engineering?

The Red-Green-Refactor cycle is a test-driven development process where you write a failing test (Red), implement minimal production code to pass the test (Green), and then improve code structure (Refactor) while maintaining passing tests.

How do I avoid common anti-patterns when writing unit tests for refactoring?

To avoid unit testing anti-patterns during refactoring, prohibit mocking behavior instead of testing real logic, and never add test-only methods to production classes. This maintains strict separation between test suites and production code.

Can I use test-driven development for fixing bugs and refactoring tasks?

Yes, you can use test-driven development for both bug fixes and refactoring tasks. It requires creating a failing test case that reproduces the bug or verifies existing behavior before applying any production code changes.

When should I not use mocks during unit testing?

You should not use mocks to test behavior during unit testing if it replaces the verification of real logic. The test-driven development workflow prohibits testing mock behavior and requires validating actual production code outcomes.