test-driven-development

Enforces red-green-refactor test-driven development workflow before writing implementation code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write production code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. 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 tests fail for the right reason before any implementation code is written. - Rationalization Detection: Lists common excuses for skipping TDD (manual testing, sunk cost, "too simple to test") and counters each with concrete reasoning. - 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 violations. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, verify green, then refactor. ## Quick Start Ask the assistant 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 when writing new features?▼

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the expected reason, then write the simplest code that passes. Refactor only after all tests are green, and repeat the cycle for each new 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 watch it fail against the current code. Implement the minimal fix, verify the test passes, and confirm no other tests broke.

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 and catches the bug it targets.

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.

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

Never assert on mock existence, never add test-only methods to production classes, and never mock methods whose side effects the test depends on. Mocks must mirror the complete real API structure, not just the fields your test uses.

What should I do if an existing test fails after my change?▼

Never weaken, skip, or delete an existing test to reach green, since changing its assertions is a spec change. Stop and consult your human partner about whether the test or the new code is wrong.