test-driven-development

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

Updated May 13, 2026
One-click install
npx skills add https://github.com/superfhp/lumi-agent-body --skill test-driven-development-superfhp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/superfhp/lumi-agent-body/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/superfhp/lumi-agent-body --skill test-driven-development-superfhp

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 full cycle of writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Provides a checklist of common excuses and red flags that signal TDD is being skipped, with instructions to delete code and restart. - Use Case: When fixing a bug, write a failing test that reproduces it first, verify the failure with pytest, implement the minimal fix, and confirm the whole suite stays green. ## Quick Start Ask the agent to implement a new feature using strict test-driven development with the red-green-refactor cycle and pytest.

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 and 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 describes the 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 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 detects the missing behavior and is not biased by the existing implementation.

When is it acceptable to skip test-driven development?▼

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit user permission. Exploratory code is allowed but must be discarded and rewritten test-first.

What should I do if I already wrote code before the test?▼

Delete the code and start over with a failing test. Keeping it as reference or adapting it while writing tests is effectively testing after implementation, which undermines the verification TDD provides.