test-driven-development

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

Updated Dec 7, 2025
One-click install
npx skills add https://github.com/harlanljones/dotfiles --skill test-driven-development-harlanljones
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/harlanljones/dotfiles/tree/main/dot_hermes/skills/software-development/test-driven-development
Command: npx skills add https://github.com/harlanljones/dotfiles --skill test-driven-development-harlanljones

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 Countermeasures: Provides a table of common excuses ("too simple to test", "I'll test after") with rebuttals, plus red flags that trigger deleting code and restarting. - Vertical Tracer Bullets: Prevents horizontal slicing by requiring one end-to-end behavior slice per cycle instead of writing all tests then all implementation. - 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 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. Run the full test suite afterward to check for regressions before refactoring.

What is the red-green-refactor cycle in TDD?▼

Red means writing a failing test, green means writing minimal code to make it pass, and refactor means cleaning up duplication and names while keeping tests green. Each cycle covers exactly one behavior before moving to the next.

Should I write all tests before implementing anything?▼

No, that is horizontal slicing and produces brittle tests designed before the implementation teaches you the real interface. Use vertical tracer bullets instead: alternate one test with one implementation slice end to end.

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 allowed, but the exploratory code must be discarded and the real work restarted test-first.

Why must I watch the test fail before writing code?▼

A test that passes immediately proves nothing; it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and fails for the expected reason, not a typo.

What should I do if I already wrote code before tests?▼

Delete it and start over with TDD. Keeping it as reference or adapting it while writing tests biases the tests toward the implementation, which defeats the purpose of test-first development.