bug-fix-protocol

Pair minimal code fixes with failing tests and testing-system audits.

119|10|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill bug-fix-protocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bug-fix-protocol
Source: https://github.com/CodeAlive-AI/ai-driven-development/tree/main/skills/bug-fix-protocol
Command: npx skills add https://github.com/CodeAlive-AI/ai-driven-development --skill bug-fix-protocol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of recurring production defects by requiring every bug fix to address not only the code symptom but also the testing-system blind spot that allowed the defect to ship.

Core Features & Use Cases

  • Two-fix discipline (code + testing system): Treats each production bug as both a software defect and an incomplete quality net.
  • Test-first repair workflow: Forces creation of a failing test (red) before implementing the minimal fix (green).
  • Testing-system audit (step 8): Diagnoses why coverage missed the issue and prescribes concrete improvements to prevent the next occurrence.
  • Use cases: Applying the protocol to production incidents, regression investigations, post-mortems, and defect-driven test gap audits.

Quick Start

Use the bug-fix-protocol skill when you are told to fix a production bug, and ask the AI to follow the eight steps from reproduction and failing test through an explicit step-8 testing-system audit.

Frequently Asked Questions about bug-fix-protocol

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

FAQPage Schema
How do I fix a production bug and prevent it from happening again?

Fix a production bug by pairing a minimal code correction with a targeted test-system improvement. Generate a failing test reproducing the defect, apply the smallest root-cause fix, verify locally, and audit coverage gaps to prevent recurrence.

What is the best way to write a failing test before fixing a regression?

The best way to write a failing test for a regression is using a test-first repair workflow. Create a red test reproducing the exact defect across unit or integration layers before implementing the minimal code change to turn it green.

Why do I need a post-mortem testing-system audit after resolving customer-reported defects?

A post-mortem testing-system audit is needed because customer-reported defects reveal quality-net blind spots. Diagnosing why coverage missed the issue and prescribing concrete improvements ensures the testing system catches similar regressions next time.

How do I trace a regression to its smallest root-cause change?

Trace a regression to its smallest root-cause change by reproducing the defect with a failing test, then analyzing the code path to isolate the exact minimal modification required to resolve the symptom and restore expected behavior.

Can I use this bug fixing protocol for both unit and integration test gaps?

Yes, you can use this bug fixing protocol for both unit and integration test gaps. It applies to regressions, customer-reported defects, post-mortems, and explicit test-gap investigations across both testing layers to ensure comprehensive coverage.

When should I not use a test-first repair workflow for bug fixing?

Avoid a test-first repair workflow when a production bug cannot be reliably reproduced in a test environment, or when the defect stems from external infrastructure failures rather than actionable code-level root causes within your system.