test-driven-development

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes made without tests ship unverified behavior, and bug fixes without reproduction tests leave regressions unguarded. This Skill enforces a write-the-failing-test-first workflow so every behavior change is proven by an executable test. ## Core Features & Use Cases - Red-Green-Refactor Loop: Write a failing test, 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, then verify the fix and run the full suite. - Stack Discovery: Detects the repository's own test framework and commands (npm, Gradle, pytest, go test, Cargo) instead of assuming defaults. - Use Case: A bug report says completing a task doesn't set its timestamp. Write a failing test asserting completedAt is set, confirm it fails, implement the fix, and watch the test pass with 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 when fixing a bug?

Write a test that reproduces the bug first and confirm it fails, then implement the fix and confirm the test passes. Finish by running the full test suite to check for regressions before considering the bug resolved.

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

Red means writing a failing test for the desired behavior, green means writing the minimal code to make it pass, and refactor means cleaning up the implementation while keeping tests green. The cycle repeats for each new behavior.

Should I use mocks or real implementations in unit tests?

Prefer real implementations first, then fakes, stubs, and finally mocks as a last resort. Reserve mocks for dependencies that 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 pass but production still breaks?

Over-mocking is the usual cause: tests verifying method calls instead of outcomes pass even when real behavior is broken. Test state and outputs rather than internal interactions, and use real dependencies where practical.