test-driven-development

Enforces red-green-refactor test-driven development workflow for features and bugfixes.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/ttphats/project-detedxs26 --skill test-driven-development-ttphats
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ttphats/project-detedxs26/tree/main/.augment/skills/superpowers/test-driven-development
Command: npx skills add https://github.com/ttphats/project-detedxs26 --skill test-driven-development-ttphats

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing code before tests leads to unverified implementations, tests that pass immediately without proving anything, and regressions discovered only in production. This Skill enforces a strict test-first discipline so every behavior change is proven by a failing test before implementation begins. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification that each test fails for the right reason before writing minimal code to pass it. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") with concrete rebuttals and red flags that trigger a restart. - Testing Anti-Pattern Reference: Covers mock-behavior testing, test-only production methods, incomplete mocks, and over-mocking, with gate functions to catch each mistake. - Use Case: When fixing a bug like an empty email being accepted, write a failing test reproducing it, verify the failure, implement the minimal validation fix, and confirm all tests pass before refactoring. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to make it pass.

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 to pass. Refactor only while tests stay green, then repeat with the next failing test.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and confirm the test passes along with all existing tests.

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 a typo or existing behavior.

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

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Exploration is allowed, but the exploratory code must be discarded before restarting with TDD.

Why does my test pass when I remove the mock?▼

This signals you were testing mock behavior instead of real component behavior. Unmock the component and assert on real outputs, or mock at a lower level so the side effects your test depends on still occur.