test-driven-development

Enforce the red-green-refactor cycle with failing tests before implementation.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/2725244134/dotfiles --skill test-driven-development-2725244134
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/2725244134/dotfiles/tree/main/opencode/.config/opencode/skill/test-driven-development
Command: npx skills add https://github.com/2725244134/dotfiles --skill test-driven-development-2725244134

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the problem of uncertain software behavior by enforcing tests before implementation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, make it pass with minimal code, then refactor while keeping tests green.
  • Wide applicability: use for new features, bug fixes, refactors, and behavior changes across languages and stacks.
  • Quality assurance discipline: reduces risk by documenting intent through tests.

Quick Start

Create a failing test that describes the feature, run the tests, implement the minimal code to pass, and refactor while keeping tests green.

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 enforces writing tests before implementation using the red-green-refactor cycle: write a failing test, implement minimal code to pass it, then refactor while keeping tests green to ensure deterministic software behavior.

How do I start applying test-first development when fixing bugs or adding new features?

Start test-first development by creating a failing test that describes the intended feature or bug fix, run the tests to confirm failure, implement the minimal code required to pass, and refactor the code while maintaining green tests.

Can I use test-driven development for refactoring existing code across different tech stacks?

Yes, test-driven development is widely applicable for refactoring, feature work, and bug fixes across various languages and stacks, enforcing deterministic implementation and reducing risk by documenting intent through tests.

Why should I write a failing test before coding during software engineering?

Writing a failing test before coding solves the problem of uncertain software behavior by documenting intent upfront, ensuring you implement only the minimal code needed to pass the test, and providing a safety net for future refactoring.

Does test-driven development require specific testing frameworks or dependencies to work?

No, test-driven development requires no specific dependencies or frameworks. It is a discipline applicable across languages and stacks, relying solely on the red-green-refactor cycle to guide minimal, deterministic implementation.