test-driven-development

Enforce a test-first workflow using Red-Green-Refactor and Prove-It Pattern.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of shipping buggy, hard-to-maintain code by enforcing a test-first development workflow, removing guesswork about code correctness and preventing regressions when modifying existing functionality.

Core Features & Use Cases

  • TDD Cycle Guidance: Step-by-step instructions for the Red-Green-Refactor workflow to build new logic safely.
  • Prove-It Pattern for Bug Fixes: Framework to write failing tests that reproduce bugs before fixing them, ensuring fixes work and regressions don't return.
  • Test Strategy Optimization: Guidance on the test pyramid, test sizing, and anti-patterns to avoid to build a fast, reliable test suite.
  • Use Case: When adding a new user notification feature, use this Skill to write failing tests for the expected notification behavior first, implement the minimal code to pass the tests, then refactor the code safely knowing existing functionality remains unbroken.

Quick Start

Use the test-driven-development skill to write failing tests that reproduce the reported bug in the user login flow before implementing the fix to make them pass.

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 it prevent code regressions?

Test-driven development prevents regressions by enforcing a test-first workflow where you write automated tests before implementation. This removes guesswork about code correctness and maintains reliable behavioral specifications across the software lifecycle.

How do I fix a bug using the test-driven development workflow?

To fix a bug using test-driven development, apply the Prove-It Pattern by writing a failing test that reproduces the reported bug before implementing the fix. This ensures the remediation works and prevents the regression from returning.

What are the steps to implement new features using the Red-Green-Refactor cycle?

The Red-Green-Refactor cycle for new features involves writing a failing test for expected behavior, implementing the minimal code required to pass the test, and then safely refactoring the codebase knowing existing functionality is protected.

Can I use test-driven development for refactoring existing codebases?

Yes, you can use test-driven development for refactoring existing codebases. It provides a framework to modify code safely while ensuring existing behavioral specifications and automated test suites validate that functionality remains unbroken.

How do I optimize my test suite to avoid slow automation and anti-patterns?

Optimize your test suite by following test strategy guidance on the test pyramid and test sizing. This helps identify anti-patterns to avoid, resulting in a fast, reliable automated test suite that prevents regressions.

When should I not use a test-first development approach?

Test-first development might be unnecessary for trivial throwaway scripts or exploratory spikes where maintaining automated test suites provides no regression prevention value. It is most effective for new features, bug fixes, and maintainable refactoring.