test-driven-development

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

1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/stefaniuk/loadout --skill test-driven-development-stefaniuk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/stefaniuk/loadout/tree/main/.github/skills/test-driven-development
Command: npx skills add https://github.com/stefaniuk/loadout --skill test-driven-development-stefaniuk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code written before tests often ships untested or with tests that pass immediately and prove nothing. This Skill enforces a strict test-first workflow so every behavior change 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 production code is written. - Rationalization Countermeasures: Provides a table of common excuses ("too simple to test", "I'll test after") with rebuttals, plus red flags that trigger a restart of the cycle. - Test Quality Rules: A companion reference defines how to write honest tests: name the break each test catches, assert on real behavior instead of mocks, and run a mutation check before finishing. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection error, watch it fail, implement the minimal validation, verify it passes, then refactor. ## Quick Start Ask the agent to implement a new feature or bugfix using strict test-driven development with a failing test written and verified 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 that names the desired behavior, run it and confirm it fails because the feature is missing, then write the simplest code that passes. Refactor only while all tests stay green, then repeat with the next failing test.

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

Write a test that reproduces the bug by asserting the correct behavior, such as expecting an error for empty input. Run it to confirm it fails against current code, then implement the minimal fix and verify the test passes without breaking others.

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

The Skill lists throwaway prototypes, generated code, and configuration files as possible exceptions, but only with explicit approval from your human partner. Choosing to skip TDD on your own is treated as rationalization.

Should tests assert on mocks or real behavior?▼

Tests should assert on real component behavior, never on the mock itself. Mock only slow or external dependencies after learning their side effects, mirror the complete real data structure, and prefer integration tests with real components when mock setup grows large.

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

Delete the implementation and start over with a failing test. Keeping it as reference or adapting it while writing tests counts as testing after, which never proves the test can catch the bug.