test-driven-development

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

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

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 one, with red flags that trigger a restart. - Subagent Integration: Provides templates for delegating implementation tasks to subagents with TDD requirements embedded in the goal. - 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 Ask the AI to implement a new feature or bug fix using strict test-driven development with the red-green-refactor cycle.

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 the desired behavior, run it with pytest to confirm it fails for the expected reason, then write the simplest code to make it pass. Finally refactor while keeping all tests green, and repeat the cycle for each new behavior.

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

Red means writing a failing test that defines the desired behavior. Green means writing the minimal code to make that test pass, even hardcoding values. Refactor means cleaning up duplication and names while keeping all tests passing.

Why should tests be written before production code?

Tests written after code pass immediately, which proves nothing about whether they test the right thing. Watching a test fail first confirms it actually exercises the missing behavior and catches 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 is allowed, but the exploratory code must be discarded and reimplemented with TDD.

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

A test that passes immediately is testing existing behavior and proves nothing. Fix the test so it targets the missing feature, verify it fails for the expected reason, then implement the code to make it pass.