test-driven-development

Enforce red-green-refactor cycles with failing tests before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build features and fix bugs with higher confidence by forcing you to define expected behavior first, catch mistakes earlier, and avoid shipping unverified production code.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Write one failing test, implement the minimum code to pass it, and clean up without changing behavior.
  • Bug Fix Verification: Reproduce regressions with a test before changing code so the fix is proven and protected from future breakage.
  • Safe Refactoring: Use tests as a safety net while reorganizing code, improving design, or simplifying complex logic.
  • Use Case: When adding a retry mechanism, you first write a test that proves the third attempt succeeds, then implement only the logic required to make that test pass.

Quick Start

Use the test-driven-development skill to write a failing test for the next behavior, implement the minimum code needed to make it pass, and then refactor while keeping all tests green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I write unit tests before implementing new features?

Bug fix verification with TDD requires you to first reproduce the regression by writing a failing test, then modify the production code to make it pass, ensuring the fix is proven and protected from future breakage.

How does the red-green-refactor cycle work during software development?

The red-green-refactor cycle works by having you write one failing test, implement the minimal code to pass that test, and then clean up the code design without changing its validated behavior.

Can I use test-driven development for safe code refactoring?

Yes, you can use test-driven development for safe code refactoring by relying on existing unit tests as a safety net while you reorganize code, improve design, or simplify complex logic without altering behavior.

What is the best way to verify a bug fix without shipping unverified code?

The best way to verify a bug fix is to reproduce the regression with a failing test before changing any production code, ensuring you avoid shipping unverified logic and prove the fix works.

When should I not use the test-driven development approach?

You should not use the test-driven development approach for software workflows that do not require behavior-first validation or incremental implementation, as it strictly enforces the red-green-refactor cycle with no exceptions.