test-driven-development

Implements code changes using the red-green-refactor test-driven development loop.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/visdomtech/skills --skill test-driven-development-visdomtech
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/visdomtech/skills/tree/main/test-driven-development
Command: npx skills add https://github.com/visdomtech/skills --skill test-driven-development-visdomtech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes made without tests are unproven, and bug fixes without reproduction tests can silently regress. This Skill enforces a disciplined test-first workflow so every behavior change is verified by a failing-then-passing test. ## Core Features & Use Cases - Red-Green-Refactor Loop: Write a failing test first, implement the minimal code to pass it, then refactor with tests green. - Prove-It Pattern for Bugs: Reproduce any reported bug with a failing test before attempting a fix, guaranteeing the fix actually works. - Stack Discovery: Detects the repository's own test framework and commands (npm, Gradle, pytest, Cargo, Go) instead of assuming defaults. - Use Case: A bug report says completing a task doesn't set its timestamp. Write a failing test that proves the bug exists, implement the fix, watch the test pass, then run the full suite to confirm no regressions. ## Quick Start Use test-driven development to implement this feature, starting with a failing test before writing any implementation code.

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 bug fix?▼

Write a test that reproduces the bug and confirm it fails before touching the implementation. Then implement the fix, watch the test pass, and run the full test suite to verify no regressions were introduced.

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

Red means writing a test that fails because the behavior doesn't exist yet. Green means writing the minimum code to make it pass. Refactor means cleaning up the implementation while keeping all tests passing.

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 at boundaries where real dependencies are slow, non-deterministic, or have uncontrollable side effects like external APIs.

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 every time I refactor code?▼

Tests break during refactoring when they verify internal method calls instead of outcomes. Test state and behavior through inputs and outputs rather than interaction-based assertions on implementation details.