test-driven-development

Enforces red-green-refactor test-first workflow for features, bugfixes, and refactoring.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/ByronWilliamsCPA/plugin --skill test-driven-development-byronwilliamscpa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ByronWilliamsCPA/plugin/tree/main/plugins/wff-code/skills/test-driven-development
Command: npx skills add https://github.com/ByronWilliamsCPA/plugin --skill test-driven-development-byronwilliamscpa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and tests that pass immediately without proving anything. This Skill enforces a strict test-driven development discipline so every line of production code is backed by a failing test written first. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing a failing test, verifying it fails for the right reason, implementing minimal code, and refactoring while staying green. - Anti-Rationalization Rules: Counters common excuses like "I'll test after" or "deleting work is wasteful" with concrete reasoning and mandatory restart rules. - Testing Anti-Pattern Reference: Covers pitfalls like testing mock behavior, test-only methods in production classes, incomplete mocks, and HTTP/mock library mismatches (requests+responses, httpx+respx, aiohttp+aioresponses). - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, verify it passes, then refactor. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to pass it.

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 it. Refactor only while tests stay green, then repeat for the next behavior.

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

Write a test that reproduces the bug by asserting the correct behavior, then run it to watch it fail. Implement the minimal fix, verify the test passes and no other tests break, which proves the fix and prevents regression.

Which mock library works with httpx in Python tests?▼

Use respx with httpx. The responses package only works with requests, and aioresponses pairs with aiohttp. Mismatched HTTP and mock libraries cause ConnectError or real network calls at test execution time.

Why is writing tests after implementation a problem?▼

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. They are biased by the implementation and only verify remembered edge cases rather than discovering missing ones.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking your human partner. Exploration is fine, but the exploratory code must be discarded and rewritten test-first.