test-driven-development

Guide teams to write failing tests before production code in red-green-refactor cycles.

141|20|Updated Dec 19, 2025
One-click install
npx skills add https://github.com/julianromli/opencode-template --skill test-driven-development-julianromli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/julianromli/opencode-template/tree/main/skill/test-driven-development
Command: npx skills add https://github.com/julianromli/opencode-template --skill test-driven-development-julianromli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides teams to adopt a test-first mindset, ensuring that new features and bug fixes are driven by failing tests that define expected behavior before any implementation.

Core Features & Use Cases

  • Enforces Red-Green-Refactor cycles to surface correctness early and encourage clean, maintainable code.
  • Provides a structured workflow for feature development, bug fixes, and refactoring with predictable validation.
  • Improves confidence and reduces regressions by requiring automated tests accompany code changes.

Quick Start

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

Test-driven development is a test-first approach where you write a failing test defining expected behavior, implement minimal code to pass it, then refactor safely. The red-green-refactor cycle surfaces correctness early and encourages clean, maintainable code.

How do I start writing unit tests before production code for a new feature?

To start writing unit tests before production code, write a failing test for the intended behavior, verify the failure, then implement the simplest code to make it pass. This structured workflow provides predictable validation for feature development.

Can I use test-driven development for bug fixes and refactoring existing code?

Yes, test-driven development supports bug fixes and refactoring by requiring a failing test that reproduces the bug or locks in current behavior before making incremental code changes. This improves confidence and reduces regressions across typical software projects.

What is the best way to ensure code quality and prevent regressions during software engineering?

The best way to ensure code quality and prevent regressions is adopting a test-first mindset with disciplined red-green-refactor cycles. Requiring automated tests to accompany code changes provides structured validation and reduces regressions for new features.

When should I not use a test-first approach for my software project?

A test-first approach requires writing real tests first and verifying failures before implementation. If a project cannot support automated unit testing or lacks a predictable validation environment, the strict red-green-refactor cycle may not be suitable.