test-driven-development

Enforces a write-tests-first red-green-refactor workflow before implementing features or bugfixes.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/ttnhan18062000/rpg-based-simulation --skill test-driven-development-ttnhan18062000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ttnhan18062000/rpg-based-simulation/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/ttnhan18062000/rpg-based-simulation --skill test-driven-development-ttnhan18062000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by requiring a failing test before any implementation, eliminating the false confidence of tests written after the fact. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test, verify it fails for the right reason, implement minimal code to pass, then refactor while staying green. - Anti-Rationalization Rules: Explicit counterarguments for common excuses like "I'll test after" or "deleting code is wasteful," with a mandatory delete-and-restart policy. - Testing Anti-Patterns Reference: Companion guide covering mock behavior testing, test-only production methods, incomplete mocks, and over-mocking. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection error first, watch it fail, then implement the validation and confirm the suite passes. ## Quick Start Ask the AI 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 describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code to pass. Refactor only while all tests stay green, then repeat for the next behavior.

How do I fix a bug using TDD?

Write a failing test that reproduces the bug first, then implement the minimal fix until the test passes. This proves the fix works and creates a regression test preventing the bug from returning.

Why must I watch the test fail before writing code?

A test that passes immediately proves nothing—it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and would catch regressions.

When is it acceptable to skip test-driven development?

Only for throwaway prototypes, generated code, or configuration files, and only with explicit approval from your human partner. Exploration is fine, but the exploratory code must be discarded and rewritten test-first.

What are common testing anti-patterns to avoid?

Avoid asserting on mock existence 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.