test-driven-development

Enforce a test-first workflow with failing tests before implementation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures that software features are implemented only after their behavior is specified by tests, preventing regressions and guiding design.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement minimal code to pass, and refactor for quality.
  • Behavior-driven development: tests express intended behavior and guard against regressions during feature changes.
  • Safe refactoring: regression tests accompany every change to ensure existing functionality remains intact.

Quick Start

Write a failing test for the intended feature, then implement minimal code to 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 the red-green-refactor cycle work?

Test-driven development enforces a test-first workflow by writing a failing test, implementing minimal code to pass it, and refactoring for quality. The red-green-refactor cycle ensures software features are implemented only after their behavior is specified by tests, preventing regressions.

How do I start writing tests before implementation for a new feature?

To start test-driven development, write a small, verifiable failing test for the intended feature behavior. Once the test fails, implement minimal production code to make it pass, then refactor the code while keeping the test green.

Can I use test-first workflows for bug fixes and refactoring existing code?

Yes, test-driven development applies to feature development, bug fixes, and refactoring. For safe refactoring, regression tests accompany every change to ensure existing functionality remains intact and behavior is validated against tests.

Why should I write failing tests before coding instead of testing after implementation?

Writing failing tests before coding ensures software features are implemented only after their behavior is specified. This behavior-driven development approach prevents production code without tests and guards against regressions during future feature changes.

When should I avoid enforcing a test-first workflow in software engineering?

Avoid test-driven development when building exploratory prototypes or throwaway scripts where behavior is not yet defined and writing small, verifiable tests would impose unnecessary overhead without guiding design or preventing regressions.