test-driven-development

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

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

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 line of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full cycle of writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD (sunk cost, manual testing, tests-after) with concrete rebuttals and red flags that trigger a restart. - Verification Checklist: Provides a completion checklist covering test failure verification, minimal implementation, regression runs, and edge case coverage. - Use Case: When fixing a bug, write a failing test that reproduces it first, watch it fail, 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, 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 describing the desired 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.

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 real bugs.

When is it acceptable to skip TDD?

Exceptions include throwaway prototypes, generated code, and configuration files, and only with explicit user permission. Exploration is allowed, but the exploratory code must be discarded and rewritten test-first.

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

A test that passes immediately means it is testing existing behavior, not the new feature. Fix the test so it fails for the expected reason before writing any implementation code.

How do I handle code that is hard to test?

Hard-to-test code signals an unclear or overly coupled design. Simplify the interface, use dependency injection instead of heavy mocking, and extract helpers when test setup becomes large.