test-driven-development

Guides test-first development using the red-green-refactor cycle for code changes and bug fixes.

Updated May 13, 2026
One-click install
npx skills add https://github.com/sapatamuku-creator/mastersapatamuku --skill test-driven-development-sapatamuku-creator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/sapatamuku-creator/mastersapatamuku/tree/main/releases/v2.7/.agents/skills/test-driven-development
Command: npx skills add https://github.com/sapatamuku-creator/mastersapatamuku --skill test-driven-development-sapatamuku-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code changes and bug fixes often ship without proof they work, leading to regressions and untested behavior. This Skill enforces a test-first workflow where every behavior change is verified by a failing test before implementation. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test first, implement minimal code to pass it, then refactor with tests as a safety net. - Prove-It Pattern for Bug Fixes: Reproduce any reported bug with a failing test before attempting a fix, creating a permanent regression guard. - Test Design Guidance: Apply the test pyramid, test size classification, DAMP principles, and anti-pattern avoidance to write maintainable tests. - Use Case: A bug report says completing a task doesn't set the completedAt timestamp. Write a failing reproduction test, implement the fix, and confirm the test passes with no regressions. ## Quick Start Ask the agent to implement a new feature or fix a bug using test-driven development, starting with a failing test that proves the expected behavior.

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 for bug fixes?▼

Write a test that reproduces the bug first and confirm it fails, then implement the fix and verify the test passes. This Prove-It Pattern creates a permanent regression guard so the bug cannot silently return.

What is the red-green-refactor cycle in TDD?▼

Red means writing a failing test that defines the expected behavior. Green means writing the minimum code to make it pass. Refactor means cleaning up the implementation while keeping all tests green.

Should I use mocks or real implementations in unit tests?▼

Prefer real implementations first, then fakes, stubs, and finally mocks as a last resort. Mock only when dependencies are slow, non-deterministic, or have uncontrollable side effects like external APIs or email sending.

When should I not write tests for a change?▼

Skip tests only for pure configuration changes, documentation updates, or static content with no behavioral impact. Any change to logic, behavior, or edge case handling should have a corresponding test.

Why do my tests break when I refactor code?▼

Tests that verify internal method calls or implementation details break during refactoring even when behavior is unchanged. Test inputs and outputs instead, asserting on state and outcomes rather than interactions.