test-driven-development

Enforces test-first development using the red-green-refactor cycle for features and bugfixes.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/ludotype/game-adventurertown --skill test-driven-development-ludotype
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ludotype/game-adventurertown/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/ludotype/game-adventurertown --skill test-driven-development-ludotype

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often passes tests immediately, proving nothing about correctness. This Skill enforces strict test-driven development so every feature and bugfix is backed by a test that was watched failing first, eliminating unverified production code and common testing anti-patterns. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides writing one failing test, verifying it fails for the right reason, implementing minimal code, and refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") and counters each with concrete reasoning. - Testing Anti-Pattern Reference: Covers testing mock behavior, test-only methods in production classes, incomplete mocks, and mocking without understanding dependencies. - 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, and verify all tests pass before refactoring. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to make it pass.

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

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code to make it pass. After green, refactor while keeping tests passing, then 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 expected behavior, then run it to watch it fail. Implement the minimal fix, verify the test passes and no other tests break, which also prevents future regressions.

Why should tests be written before implementation 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 rather than implementation details or mocks.

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

Exceptions include throwaway prototypes, generated code, and configuration files, and even these should be confirmed with a human partner. Exploration is fine, but the exploratory code should be discarded and rewritten test-first.

What are common mocking anti-patterns in unit tests?▼

Common anti-patterns include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses.