test-driven-development

Guide software development through the Red-Green-Refactor testing cycle.

Updated Oct 20, 2025
One-click install
npx skills add https://github.com/pierregueroult/dot-files --skill test-driven-development-pierregueroult
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/pierregueroult/dot-files/tree/main/opencode/skills/test-driven-development
Command: npx skills add https://github.com/pierregueroult/dot-files --skill test-driven-development-pierregueroult

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures code quality and reliability by enforcing a rigorous testing methodology, preventing bugs before they are introduced and enabling confident refactoring.

Core Features & Use Cases

  • Test-First Development: Write tests before implementation code to define behavior.
  • Red-Green-Refactor Cycle: Follow a structured process of writing failing tests, minimal code to pass, and then cleaning up.
  • Use Case: When developing a new feature, use this Skill to guide you in writing a failing test that specifies the desired outcome, then write just enough code to make that test pass, ensuring the feature works as intended from the start.

Quick Start

Follow the Red-Green-Refactor cycle for all new code.

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 improve code quality?

Test-driven development is a software development methodology where you write failing tests before implementation code, ensuring behavior is defined upfront and preventing bugs before they are introduced to enable confident refactoring.

How do I implement the Red-Green-Refactor cycle for new features?

To implement the Red-Green-Refactor cycle, write a failing test that specifies the desired outcome, write minimal code to make that test pass, and then clean up the implementation while ensuring the test still passes.

Why should I write failing tests before writing the implementation code?

Writing failing tests before implementation forces you to define expected behavior clearly, prevents regressions by ensuring code quality from the start, and enables confident refactoring without breaking existing functionality.

How does TDD address common anti-patterns and rationalizations in software development?

TDD addresses common rationalizations and anti-patterns by enforcing a rigorous testing methodology that requires minimal code to pass tests, preventing over-engineering and ensuring software reliability throughout the development process.

Can I use test-driven development for agile refactoring of existing code?

Yes, test-driven development enables confident refactoring by ensuring existing tests validate behavior before and after code changes, preventing regressions while improving code quality and structure during agile software development.

What are the limitations of using TDD for software development?

TDD requires strict adherence to the Red-Green-Refactor cycle, which may slow initial feature delivery, and demands rigorous discipline to avoid common anti-patterns that compromise the testing methodology's effectiveness.