test-driven-development

Guides implementation of features and bug fixes using the red-green-refactor test cycle.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes often ship without proof they work, and bug fixes regress silently. This Skill enforces a disciplined test-driven workflow where every behavior change is proven by a failing test first, so fixes and features are verified rather than assumed. ## Core Features & Use Cases - Red-Green-Refactor Loop: Write a failing test, implement 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. - Test Quality Guidance: Covers the test pyramid, DAMP vs DRY, state-based assertions over mocks, and anti-patterns to avoid. - Use Case: A bug report says completing a task doesn't set its timestamp. Write a reproduction test that fails, implement the fix, watch it pass, then run the full suite to confirm no regressions. ## 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 bug fix?▼

Write a test that reproduces the bug and confirm it fails before touching the fix. Then implement the fix, watch the test pass, and run the full suite to confirm no regressions. This is the Prove-It Pattern.

How do I find the right test command for a repository?▼

Inspect the build files like package.json, pom.xml, pyproject.toml, go.mod, or Cargo.toml, and prefer checked-in wrappers like ./gradlew or make test. README, CONTRIBUTING, and CI workflows show the commands that actually gate merges.

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

Prefer real implementations first, then fakes, stubs, and mocks last. Mock only when the real dependency is too slow, non-deterministic, or has uncontrollable side effects like external APIs or email sending.

When should I not use test-driven development?▼

Skip TDD for pure configuration changes, documentation updates, or static content changes with no behavioral impact. Any change that alters logic or behavior should go through the red-green-refactor cycle.

Why do my tests break every time I refactor code?▼

Tests that assert on internal method calls or implementation details break during refactoring even when behavior is unchanged. Assert on inputs and outputs (state-based testing) instead of interaction sequences.