test-driven-development

Enforces red-green-refactor TDD workflow with failing tests before production code.

Updated May 28, 2026
One-click install
npx skills add https://github.com/patty-chow/the-stable --skill test-driven-development-patty-chow
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/patty-chow/the-stable/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/patty-chow/the-stable --skill test-driven-development-patty-chow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. This Skill enforces strict test-driven development so every behavior is verified by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Mandates writing one failing test, verifying the failure, writing minimal code to pass, then refactoring with tests green. - Rationalization Detection: Lists common excuses ("too simple to test", "I'll test after") and red flags that signal TDD was skipped, requiring a restart. - Subagent Integration: Provides delegate_task templates and pytest terminal commands so dispatched subagents follow the same TDD discipline. - Use Case: When fixing a bug, write a failing test that reproduces it first, then implement the minimal fix and confirm the full suite passes without regressions. ## Quick Start Ask the agent to implement a new feature using strict TDD with pytest, writing and running a failing test before 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 practice test-driven development with pytest?▼

Write one minimal failing test for a single behavior, run it with pytest to confirm it fails for the expected reason, then write the simplest code to pass. Re-run the test and the full suite, then refactor while keeping all tests green.

Why should tests be written before production 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 and catches the intended bug.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user first. Exploratory code is allowed but must be deleted and rewritten test-first before becoming production code.

What should I do if a test passes immediately on the first run?▼

A test that passes immediately is testing existing behavior, not new functionality. Fix the test so it targets the missing feature, verify it fails for the expected reason, then proceed with implementation.

How does TDD apply to bug fixes?▼

Write a failing test that reproduces the bug before changing any code. The test proves the fix works and acts as a regression guard so the same bug cannot return undetected.