test-driven-development

Enforces red-green-refactor test-first workflow for features, bugfixes, and refactoring.

1|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com --skill test-driven-development-ratnesh-maurya
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/ratnesh-maurya/tracker.ratnesh-maurya.com --skill test-driven-development-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write production code before tests, producing tests that pass immediately and prove nothing about correctness. This Skill enforces a strict test-driven development cycle so every behavior change is verified by a failing test first, catching regressions and design flaws early. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides writing one minimal failing test, verifying it fails for the right reason, implementing minimal code, and refactoring while staying green. - Rationalization Countermeasures: Provides explicit rebuttals to common excuses like "I'll test after" or "too simple to test", plus red flags that signal restarting with TDD. - Testing Anti-Pattern Reference: Details how to avoid testing mock behavior, adding test-only methods to production classes, incomplete mocks, and mocking without understanding dependencies. - 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 validation, and confirm all tests pass before refactoring. ## Quick Start Ask the AI to implement your next 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 expected reason, then write the simplest code to pass. Refactor only after all tests are green, and repeat the cycle for each new behavior.

How to write a failing test before implementation code?▼

Define the wished-for API in the test first, using a clear behavior-focused name and real code instead of mocks. Run the test and confirm it fails because the feature is missing, not because of typos or errors.

Why should tests be written before code instead of after?▼

Tests written after code pass immediately, proving nothing about whether they test the right thing. Watching a test fail first confirms it actually exercises the missing behavior and catches real bugs.

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 fine, but the exploratory code should be discarded and rewritten with TDD.

What testing anti-patterns should I avoid with mocks?▼

Avoid asserting on mock elements, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields the real API returns. Test real behavior and mock minimally at the correct level.