test-driven-development

Enforces test-first development using the red-green-refactor cycle for features and bug fixes.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/Ab0umar/selrs.cc.BU --skill test-driven-development-ab0umar
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Ab0umar/selrs.cc.BU/tree/main/.codex/plugins/cache/openai-curated/superpowers/dc902811/skills/test-driven-development
Command: npx skills add https://github.com/Ab0umar/selrs.cc.BU --skill test-driven-development-ab0umar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and no regression safety net. This Skill enforces a strict test-first workflow so every feature and bugfix is proven by a failing test before any production code exists. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle—write a failing test, verify it fails for the right reason, write minimal code to pass, then refactor while staying green. - Rationalization Detection: Lists common excuses for skipping TDD (e.g., "I'll test after", "too simple to test") and explains why each one fails, keeping the workflow honest. - Testing Anti-Pattern Reference: Ships a companion guide covering mock-behavior testing, test-only production methods, incomplete mocks, and over-mocking, with gate functions to catch violations. - Use Case: When fixing a bug like an empty email being accepted, write a failing test reproducing it first, watch it fail, implement the minimal validation fix, and confirm the suite stays green. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development on a new feature?▼

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code that makes it pass. Refactor only after the test is green, and repeat the cycle for each new behavior.

How do I fix a bug using TDD?▼

Write a failing test that reproduces the bug first, then implement the minimal fix until the test passes. The test proves the fix works and prevents the bug from regressing in future changes.

Why should tests be written before implementation code?▼

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature rather than existing code or a typo.

When is it acceptable to skip test-driven development?▼

Possible exceptions include throwaway prototypes, generated code, and configuration files, but only with explicit approval from your human partner. Exploration is allowed if the exploratory code is discarded and the real work restarts with TDD.

What are common testing anti-patterns with mocks?▼

Common anti-patterns include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses.