test-driven-development

Enforce test-first development through red-green-refactor cycles and bug fixes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams ensure software correctness by enforcing a test-first approach, preventing production code from being written without failing tests first.

Core Features & Use Cases

  • Define small, focused tests before implementing functionality to drive design and catch regressions early.
  • Guide through the RED-GREEN-REFACTOR cycle: write a failing test, make it pass with minimal code, then refactor for clarity and maintainability.
  • Include explicit patterns for bug fixes and incremental improvements, ensuring reproducible results and safer deployments.

Quick Start

Write a failing test for the new feature, then implement just enough code to make the test 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 (TDD) is a software development process where you write failing tests before production code. The red-green-refactor cycle guides you to write a failing test, implement minimal code to pass it, then refactor for maintainability.

How do I fix bugs using a test-first development workflow?

To fix bugs using a test-first workflow, you write a focused, reproducible unit test that fails and captures the bug, then implement the minimal production code required to make that test pass, ensuring correctness and preventing future regressions.

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

To start writing unit tests before implementing features, define a small, focused test that specifies the desired behavior and initially fails. Then, write just enough production code to satisfy the test's requirements and make it pass.

Does test-driven development enforce deterministic test execution for quality assurance?

Yes, test-driven development enforces deterministic test execution by requiring explicit test-first patterns and disciplined workflow steps. This quality assurance approach ensures code correctness, reproducible results, and safer deployments through strict testing.

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

You should avoid a test-first approach when exploring rapid prototypes where requirements are highly volatile, as the strict red-green-refactor cycle and deterministic unit tests require clear, defined specifications before writing production code.