test-driven-development

Write failing tests first to guide feature development through a red-green-refactor workflow.

8|Updated Sep 7, 2021
One-click install
npx skills add https://github.com/frap129/dotfiles --skill test-driven-development-frap129
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/frap129/dotfiles/tree/main/.config/opencode/skills/test-driven-development
Command: npx skills add https://github.com/frap129/dotfiles --skill test-driven-development-frap129

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams deliver reliable software by requiring tests before code, reducing defects and clarifying expected behavior.

Core Features & Use Cases

  • Enforces a red-green-refactor workflow across feature work, bug fixes, and refactors.
  • Improves design by validating assumptions through tests and guiding incremental implementation.
  • Provides a practical framework for teams to adopt TDD with minimal friction and clear criteria for success.

Quick Start

Write a failing test for the feature you plan to implement, then write the minimal production code to pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development guide code implementation?

Test-driven development guides implementation by writing a failing test first, then creating minimal production code to pass it, validating assumptions through tests and clarifying expected behavior.

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

To start writing tests before code, write a failing test for the planned feature, then write the minimal production code required to make the test pass, repeating this cycle across feature work, bug fixes, and refactors.

Can I apply TDD to bug fixes and refactoring existing software?

Yes, you can apply TDD to bug fixes and refactoring across software projects. The workflow clarifies expected behavior and guides incremental implementation by validating assumptions through failing tests before writing production code.

What is the red-green-refactor workflow in software engineering?

The red-green-refactor workflow in software engineering is a test-driven discipline where you write a failing test, implement minimal code to pass it, and then refactor, reducing defects and clarifying expected behavior incrementally.

Why use a tests-first discipline for software engineering quality assurance?

Use a tests-first discipline for quality assurance to deliver reliable software by requiring tests before code, which reduces defects, improves design by validating assumptions, and enforces clear criteria for success.

When should I not use test-driven development for my project?

You should reconsider test-driven development when minimal production code and failing tests cannot validate your implementation, or when the overhead of writing tests first creates excessive friction for your specific software engineering context.