test-driven-development

Write failing tests before implementation using a red-green-refactor workflow.

Updated May 3, 2026
One-click install
npx skills add https://github.com/kevindree/geehoo-gateway --skill test-driven-development-kevindree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/kevindree/geehoo-gateway/tree/main/.github/skills/test-driven-development
Command: npx skills add https://github.com/kevindree/geehoo-gateway --skill test-driven-development-kevindree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents unreliable code changes by requiring tests to define expected behavior before implementation begins, so bugs are caught early and regressions are harder to introduce.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Start with a failing test, implement the smallest fix, then clean up while keeping the suite green.
  • Bug Reproduction: Turn reported issues into failing tests first, so every fix is verified and protected against recurrence.
  • Behavior-Focused Validation: Emphasizes state-based assertions, deterministic test design, and clear test names that describe outcomes.
  • Use Case: A developer changes task completion logic and uses this Skill to write a reproduction test, confirm the bug, fix the code, and validate that the completed timestamp now behaves correctly.

Quick Start

Use the test-driven-development skill to write a failing test for this bug, implement the minimal fix, and verify the full test suite passes.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I write unit tests before code to prevent regressions?

Unit tests written before code prevent regressions by defining expected behavior upfront. You start with a failing test, implement the minimal fix, then refactor while keeping the suite green.

What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow is a test-driven development cycle where you write a failing test, implement the smallest code fix to pass it, then clean up the code while maintaining a green test suite.

How to write a reproduction test for bug fixing?

To write a reproduction test for bug fixing, translate the reported issue into a failing test first. This verifies the bug, confirms the fix resolves it, and protects against future recurrence.

When do I need state-based assertions in unit tests?

State-based assertions are needed in unit tests to emphasize deterministic test design and behavior-focused validation. They ensure clear test names describe outcomes rather than implementation details.

Does test-driven development work for refactoring existing code?

Test-driven development works for refactoring existing code by requiring tests to prove behavior before making changes. This catches bugs early and ensures modifications do not break existing software behavior.

What are the limitations of test-driven development for edge cases?

Test-driven development for edge cases requires deterministic state-based assertions and failing reproduction tests. It may not suit non-deterministic systems where establishing a reliable failing test is impossible.