test-driven-bugfix

Write a failing test to reproduce a bug, then implement the minimal fix.

6|1|Updated Apr 26, 2025
One-click install
npx skills add https://github.com/edobry/minsky --skill test-driven-bugfix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-bugfix
Source: https://github.com/edobry/minsky/tree/main/.claude/skills/test-driven-bugfix
Command: npx skills add https://github.com/edobry/minsky --skill test-driven-bugfix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Fixing bugs without tests leads to regressions and unreliable software. This skill enforces a test-driven approach where a failing test is written first to prove the bug exists, then a minimal code change is implemented to make the test pass.

Core Features & Use Cases

  • Write a failing test that reproduces the exact bug to establish a verifiable failure.
  • Implement the smallest possible fix that makes the test pass, preserving existing behavior.
  • Document the bug and reproduction steps in the test to guard against regressions and support hermeticity.

Quick Start

Begin by writing a failing test that reproduces the bug, then implement the minimal change to make the test pass.

Frequently Asked Questions about test-driven-bugfix

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

FAQPage Schema
How do I fix a bug using test-driven development?

To fix a bug using test-driven development, you write a failing test that reproduces the exact bug, implement the minimal code change to make the test pass, and validate the fix through your project's test suite to prevent regressions.

What is the best way to write a test that reproduces a race condition or data integrity issue?

Reproducing a race condition or data integrity issue requires writing a hermetic failing test first. You define the test following your project's existing testing patterns to establish a verifiable failure before applying any code fix.

Why should I write a failing unit test before fixing a behavioral regression?

Writing a failing unit test before fixing a behavioral regression proves the bug exists and establishes a verifiable failure. Implementing the smallest possible fix to make the test pass preserves existing behavior and guards against future regressions.

Can I use this test-driven bugfix approach for codebases that require test-backed validation?

Yes, this test-driven bugfix approach extends to codebases requiring test-backed validation. It enforces defining a failing test first, following project testing patterns, and validating the fix through the test suite before committing.

What are the limitations of fixing bugs without writing a failing test first?

Fixing bugs without writing a failing test first leads to unreliable software and regressions. Without a hermetic test documenting the reproduction steps, you lack verifiable validation that the minimal code change preserves existing behavior.