test-driven-development

Enforces RED-GREEN-REFACTOR test-first workflow for writing production code.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/loteiron/ZeusAgent --skill test-driven-development-loteiron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/loteiron/ZeusAgent/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/loteiron/ZeusAgent --skill test-driven-development-loteiron

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by requiring a failing test before any implementation, eliminating the false confidence of tests written after the fact. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Guides each cycle with mandatory verification steps—watch the test fail, write minimal code, watch it pass, then refactor. - Rationalization Countermeasures: Provides a table of common excuses ("too simple to test", "I'll test after") with direct rebuttals and red flags that trigger a restart. - Subagent Integration: Shows how to enforce TDD when delegating implementation tasks via delegate_task and how to pair with systematic-debugging for bug fixes. - Use Case: When fixing a bug, write a failing test that reproduces it first, then implement the minimal fix and run the full suite to confirm no regressions. ## Quick Start Ask the agent to implement a new feature using strict TDD: write one failing test, verify it fails, write minimal code to pass, then run the full test suite.

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 specific test plus the full suite to check for regressions before refactoring.

What is the RED-GREEN-REFACTOR cycle in TDD?▼

RED means writing a failing test that defines desired behavior, GREEN means writing minimal code to make it pass, and REFACTOR means cleaning up duplication and names while keeping tests green. Each cycle covers one behavior at a time.

Should I write all tests before implementing anything?▼

No. Writing all tests first is horizontal slicing and produces brittle tests designed before the implementation teaches you the real interface. Use vertical tracer bullets: alternate one failing test with one minimal implementation.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user first. Exploration is fine, but the exploratory code must be discarded and the real implementation restarted test-first.

Why does my test pass immediately on the first run?▼

An immediately passing test means you are testing existing behavior, not new functionality, so it proves nothing. Fix the test to target the missing feature and confirm it fails before writing any implementation code.

How do I fix a bug using test-driven development?▼

Write a failing test that reproduces the bug first, then implement the minimal fix and verify the test passes. The test proves the fix works and prevents the bug from regressing later.