test-driven-development

Orchestrate a test-first workflow enforcing the Red-Green-Refactor cycle.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing code without automated tests makes behavior uncertain and regression-prone. This skill advocates a tests-first approach to ensure every feature, bugfix, or refactor is guided by failing tests and incremental validation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement just enough code to pass, then refactor safely.
  • Behavior-first discipline: ensures you cannot ship code without validated expectations.
  • Wide applicability: useful for features, bug fixes, refactors, or behavior changes across projects.

Quick Start

Run failing tests first to drive the minimal implementation and validate behavior before coding.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development is a workflow where you write a failing test, implement minimal production code to pass it, and then refactor safely.

How do I use TDD for bug fixes and refactoring?

To use TDD for bug fixes and refactoring, you first write a failing test that captures the expected behavior, then implement just enough code to fix the issue and validate the change.

When should I use a test-first approach instead of test-last development?

You should use a test-first approach instead of test-last development whenever you are implementing features, fixing bugs, or refactoring, ensuring behavior is validated before coding begins.

Does test-driven development require writing more code than necessary?

No, test-driven development requires writing minimal production code just enough to pass the failing tests, preventing over-engineering while ensuring every feature is verifiable.

What are the limitations of using TDD for software development?

A limitation of TDD is that it forbids test-last approaches, requiring strict discipline to write failing tests before any production code for features, bug fixes, or behavioral changes.