test-driven-development

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

Updated May 18, 2026
One-click install
npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill test-driven-development-fts-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/fts-pro/FTS-MMIS-AFRIKA/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill test-driven-development-fts-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and tests that pass immediately without proving anything. This Skill enforces a strict test-first discipline so every line of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle—write a failing test, verify it fails for the right reason, write minimal code to pass, then refactor while staying green. - Anti-Rationalization Guardrails: Provides explicit rebuttals to common excuses like "I'll test after" or "deleting code is wasteful", with red flags that trigger starting over. - 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, and refactor—ensuring the fix is proven and regression-protected. ## 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 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 tests stay 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. Implement the minimal fix, verify the test passes and no other tests break, which proves the fix and prevents regression.

Why should tests be written before implementation code?▼

Tests written after code pass immediately, which proves nothing—they may test the wrong thing or mirror the implementation. Watching a test fail first confirms it actually exercises the missing behavior and catches real bugs.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only after confirming with your 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.

What should I do if a test is too complicated to write?▼

A hard-to-write test signals a complicated design—simplify the interface or use dependency injection to reduce coupling. Extract helpers for large setups, and if everything must be mocked, reconsider the design before proceeding.