tdd:test-driven-development

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

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill tdd-test-driven-development-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd:test-driven-development
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/test-driven-development
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill tdd-test-driven-development-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with unverified behavior, and tests written after implementation pass immediately without proving they actually catch bugs. This Skill enforces a strict test-first discipline so every behavior change is backed by a test that was watched failing before any production code exists. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full cycle of writing a failing test, verifying it fails for the right reason, writing minimal code to pass, and refactoring while staying green. - Testing Anti-Pattern Detection: Identifies and corrects common mistakes such as testing mock behavior, adding test-only methods to production classes, incomplete mocks, and mocking without understanding dependencies. - Rationalization Countermeasures: Provides concrete rebuttals to common excuses for skipping TDD, plus a verification checklist and red-flag list that trigger starting over. - 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 minimal validation, and confirm the suite passes before refactoring. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development, writing the failing test first before any production code.

Frequently Asked Questions about tdd: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 and confirm it fails for the expected reason, then write the simplest code that makes it pass. Refactor only while all tests stay green, then repeat with the next failing test.

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 confirm it fails because the bug exists. Implement the minimal fix, verify the test passes, and keep it as a regression guard.

Why should tests be written before implementation code?

Tests written after code pass immediately, which proves nothing about whether they catch real bugs. Watching a test fail first confirms it actually verifies the intended behavior rather than the implementation details.

When is it acceptable to skip test-driven development?

The Skill lists throwaway prototypes, generated code, and configuration files as possible exceptions, but only with explicit approval from your human partner. Exploration is allowed if the exploratory code is discarded and the real work restarts with TDD.

Why does my test pass when I remove the mock?

That usually means the test was asserting mock behavior rather than real component behavior. Unmock the component or assert on real outputs, and mock only at the lowest level whose side effects the test does not depend on.