test-driven-development

Enforce a failing test before implementing production code using Red-Green-Refactor.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides teams to adopt Test-Driven Development by ensuring tests drive implementation, reducing bugs and improving maintainability.

Core Features & Use Cases

  • Red-Green-Refactor workflow: write a failing test, implement minimal code to pass, then refactor for clarity and reliability.
  • Strong verification discipline: use tests to validate features, bug fixes, and refactors before code is merged.
  • Real-world scenario: when starting a new feature, begin with a failing test that specifies the behavior, then implement just enough code to satisfy it.

Quick Start

  1. Write a failing test that encodes the desired behavior.
  2. Run the test suite and observe the failure.
  3. Implement the minimal production code to make the test pass, then refactor for readability.

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 means writing a failing test, implementing minimal production code to pass it, then refactoring for clarity. It verifies behavior before changes are committed to reduce bugs and improve maintainability.

How do I start a new feature using test-driven development?

To start a new feature using test-driven development, write a failing test that encodes the desired behavior. Run the test suite to observe the failure, then implement just enough production code to satisfy the test before refactoring.

When should I use TDD for bug fixes and refactoring?

You should use TDD for bug fixes and refactoring to verify behavior before changes are committed. Writing a failing test first specifies the expected behavior, ensuring your bug fix or refactor is validated before the production code is merged.

Does test-driven development require writing tests before any production code?

Test-driven development requires writing a failing test before implementing production code. You must implement only enough production code to satisfy the tests, ensuring strong verification discipline drives the implementation rather than writing tests afterward.

What is the best way to ensure quality assurance when adding new software features?

Test-driven development ensures quality assurance by applying the red-green-refactor workflow to new features. It drives implementation through tests, reducing bugs and improving maintainability by validating that production code satisfies specified behavior.