test-driven-development

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

Updated May 4, 2026
One-click install
npx skills add https://github.com/Junkfooooood/hermes-governance --skill test-driven-development-junkfooooood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Junkfooooood/hermes-governance/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/Junkfooooood/hermes-governance --skill test-driven-development-junkfooooood

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 piece of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the AI through writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") and counters each with concrete reasoning. - Verification Checklist: Provides a completion checklist covering test failure verification, minimal implementation, regression checks, and edge case coverage. - Use Case: When fixing a bug, the Skill requires writing a failing test that reproduces the bug first, then implementing the fix, ensuring the regression is permanently covered. ## Quick Start Implement the new retry feature using strict test-driven development with pytest, writing the 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. Finally run the full test 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 the minimal code to make it pass, even hardcoding values. Refactor means cleaning up duplication and names while keeping all tests green.

Why should tests fail before writing production code?

A test that passes immediately proves nothing since it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and will catch real bugs.

When is it acceptable to skip test-driven development?

Exceptions include throwaway prototypes, generated code, and configuration files, but only with explicit user permission. Exploration spikes are allowed if the code is discarded and rewritten with TDD afterward.

Should TDD tests use mocks or real code?

Tests should exercise real code whenever possible, using mocks only when truly unavoidable such as external services. Testing mock behavior instead of real behavior is a listed anti-pattern that produces misleading results.