test-driven-development

Enforce test-first workflows for unit and integration testing in software projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/JoaoPedroAmaral/backBarbearia --skill test-driven-development-joaopedroamaral
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/JoaoPedroAmaral/backBarbearia/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/JoaoPedroAmaral/backBarbearia --skill test-driven-development-joaopedroamaral

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a test-first development discipline that prevents regressions, reduces debugging time, and ensures features are specified by observable behavior rather than implementation details.

Core Features & Use Cases

  • Test-first workflow: Write a minimal failing test, confirm it fails for the expected reason, implement the smallest change to pass, then refactor while keeping tests green.
  • Verification and guardrails: Guidance for verifying failures versus errors, avoiding mocks that hide behavior, and ensuring tests prove real behavior.
  • Use Cases: Ideal for adding new features, fixing bugs, refactoring code, and changing behavior where confidence and regression prevention are required.

Quick Start

Write a single failing test that expresses the desired behavior, run the test to confirm it fails for the expected reason, implement the minimal code to make it pass, and rerun the test suite.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a test-first workflow where you write a minimal failing test, confirm it fails for the expected reason, implement the smallest code change to pass, then refactor while keeping tests green. This enforces observable behavior specification and prevents regressions.

How do I start writing unit tests for a new feature using TDD?

To start unit testing with TDD, write a single failing test expressing the desired behavior. Run it to verify the failure reason, implement the minimal code to make it pass, and rerun the test suite to ensure it stays green during refactoring.

Can I use test-driven development for bug fixes and refactoring existing code?

Yes, test-driven development applies to bug fixes, refactors, and behavior changes. You write a failing test that captures the bug or desired behavior change, confirm the failure, implement the fix, and keep tests green throughout the refactoring process.

Why should I verify that my failing test fails for the expected reason?

Verifying failure reasons in test-driven development distinguishes true failures from errors or false positives. This guardrail prevents mocks from hiding behavior and ensures your tests prove real, observable behavior rather than implementation details.

What's the best way to prevent regressions when changing software behavior?

The best way to prevent regressions is applying test-driven development. By requiring failing tests first before implementing minimal passing code, you ensure features are specified by observable behavior, reducing debugging time and preventing future regressions.