test-driven-development

Guide developers through the red-green-refactor cycle for test-driven development.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams adopt a strict test-first workflow, ensuring you fail fast and verify behavior before writing production code.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, confirm it fails, implement minimal code to pass, and refactor with confidence.
  • Always-on TDD discipline: apply to new features, bug fixes, and refactors to prevent regressions.
  • Pragmatic guidance: provides actionable steps that reinforce correct testing habits and measurable outcomes.

Quick Start

Write a failing test for the feature you are about to implement, then write the minimal production code to make it 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 it work?

Test-driven development is a workflow where you write a failing test before coding. You implement minimal code to pass the test, then refactor for clarity. This enforces correct behavior and prevents regressions across new features and bug fixes.

How do I start writing unit tests before coding new features?

To start writing unit tests before coding, write a failing test for the feature you are about to implement. Confirm it fails, implement the minimal production code to make it pass, and then refactor safely to maintain quality assurance.

When should I use test-driven development for refactoring?

You should use test-driven development for refactoring when you need to prevent regressions and ensure correct behavior. Applying TDD discipline allows you to refactor code with confidence by verifying existing functionality through tests.

Can I use test-driven development for fixing bugs?

Yes, you can use test-driven development for fixing bugs. You apply the test-first discipline by writing a failing test that reproduces the bug, then implementing the minimal code to pass the test and verify the correct behavior.

What is the best way to apply the Red-Green-Refactor cycle?

The best way to apply the Red-Green-Refactor cycle is to first write a failing test, confirm it fails, implement the minimal code to pass the test, and finally refactor the code for clarity to ensure strict quality assurance.