test-driven-development

Enforces red-green-refactor test-driven development workflow for features and bugfixes.

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill test-driven-development-cristoslc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/cristoslc/LLM-personal-agent-patterns/tree/main/L3-agents-core/.agents/skills/test-driven-development
Command: npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill test-driven-development-cristoslc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write production code before tests, producing tests that pass immediately and prove nothing. This Skill enforces a strict test-first discipline so every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification that each test fails for the right reason before any implementation code is written. - Rationalization Countermeasures: Provides a catalog of common excuses ("too simple to test", "I'll test after") with concrete rebuttals to keep the workflow honest. - Testing Anti-Pattern Reference: Ships a companion reference covering mock-behavior testing, test-only production methods, incomplete mocks, and over-mocking, with gate functions to catch each. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection error, watch it fail, implement the minimal validation, verify green, then refactor. ## Quick Start Ask the agent to implement a new feature or bugfix using strict test-driven development with a failing test written first.

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 on a new feature?▼

Write one minimal failing test describing the desired behavior, run it and watch it fail for the expected reason, then write the simplest code that makes it pass. After green, refactor while keeping all tests passing, and repeat for the next behavior.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug by asserting the correct behavior, then run it to confirm it fails because the bug exists. Implement the minimal fix, verify the test passes, and keep it as a regression guard.

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

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Exploration is allowed, but the exploratory code must be discarded and rewritten test-first.

Why should I avoid testing mock behavior in unit tests?▼

Asserting on mock elements verifies the mock exists rather than that the component works, giving false confidence. Test real component behavior instead, or unmock the dependency and assert on observable outcomes.

What are the risks of writing tests after implementation?▼

Tests written after code pass immediately, which proves nothing about whether they test the right thing. They are biased by the implementation, verify remembered edge cases only, and never demonstrate the test can catch the bug.