bug-fix-protocol

An eight-step method for fixing defects that have reached production, staging, or a customer, including reproducing the issue, adding a failing test, applying a minimal fix, and checking the wider system.

In plain words
What is it for?
It is for investigating production bugs, writing regression tests, implementing focused fixes, verifying the full test and lint suite, and documenting what went wrong.
Why use it?
It treats both the defect and the testing gap that allowed it through, reducing the chance of the same type of problem returning.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/codealive-ai/ai-driven-development/bug-fix-protocol
Any agent
npx skills add CodeAlive-AI/ai-driven-development --skill bug-fix-protocol
Clone the repo
git clone --depth 1 https://github.com/CodeAlive-AI/ai-driven-development

Made for: Claude Code, Codex.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.00588
Opus 5 $0.00047 $0.00294
Sonnet 5 $0.00019 $0.00118
Haiku 4.5 $0.00009 $0.00059

Measured yesterday against content hash 1ff10d9c5903, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bug-fix-protocol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bug-fix-protocol/SKILL.md · 40 lines

How it starts

The opening of the file, as written. The whole thing — 40 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bug Fix Protocol

A bug fix is two fixes in one: fix the code, and fix the testing system that let the bug through. Skipping the second step means the same class of bug ships again.

The full protocol (philosophy, eight steps with examples, audit checklist, anti-patterns) lives in PROTOCOL.md. Read it before applying.

When to apply

Use this protocol whenever a defect reaches production, staging, or a customer environment. Do not use it for bugs caught locally during normal development — those are part of the writing process, not testing-system failures.

The eight steps (summary)

  1. Analyze and reproduce requirements. Understand exact actual vs expected behaviour; identify minimal repro path; ask the user before guessing on ambiguities.
  2. Write a failing test (red). Encode the bug as a test that fails for the right reason. No code change yet.
  3. Trace root cause. Walk the failing test back through the system. Stop at the smallest place that, if changed, makes the test pass.
  4. Apply the minimal fix. Smallest possible change. No drive-by refactors.
  5. Verify green locally. Failing test now passes; no other tests regressed.
  6. Run the full suite + lints + types. Catch indirect regressions.
  7. Document the fix. Commit message and PR description name the symptom, the root cause, and the fix in one sentence each.
  8. Audit the testing system (the most important step). Ask: which layer should have caught this, and why didn't it? Then change that layer so it would catch the next instance — new test type, new fixture, new lint rule, new property test, new contract assertion. A fix without step 8 is incomplete.

Output expectations

When applying the protocol, return:

  • The repro test (red, then green).
  • The minimal code fix.
  • A one-paragraph step-8 audit naming the missed coverage layer and the change made to close the gap.

If step 8 produces "we couldn't have caught this," investigate further — that answer is almost always wrong, and accepting it is how the testing system stagnates.

Read the full file on GitHub · 40 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 40 lines · 94 tokens per session scan A 1ff10d9c5903

Subscribe to this mod's changes

bug-fix-protocol is a skill published in the GitHub repository CodeAlive-AI/ai-driven-development (131 stars, last pushed 3d ago), licensed MIT. It adds 94 tokens to every session and 588 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

map-debug

Structured MAP debugging via task-decomposer, actor, and monitor agents. Use when reproducing a bug, isolating a regression, or diagnosing an error with specialized agents — including failing or flaky tests (pytest AssertionError), crashes and segmentation faults, memory-corruption or memory errors in native/C…

azalio/map-framework · 213 tokens

map-learn

Capture reusable lessons after a completed MAP workflow. Use when a MAP run has finished and you want rules written to .claude/rules/learned/ from a workflow summary or handoff. Do NOT use during active implementation.

azalio/map-framework · 51 tokens

map-task

Execute a single subtask from an existing MAP plan via Actor and Monitor. Use when map-plan has decomposed work and you want fine-grained control over one subtask. Do NOT use without an existing plan; run map-plan first.

azalio/map-framework · 51 tokens

map-explain

Deep walkthrough of code, a diff, or the whole project — problem, entities, flow, load-bearing-line rationale, side effects, assumptions, breakage. Use when learning unfamiliar code or auditing a diff.

azalio/map-framework · 46 tokens

map-auto

Single-entry autonomous autopilot: routes a task through the existing MAP workflows via routetask, then drives the selected chain (map-plan -> map-efficient -> map-check -> map-review, as routed) end-to-end to a committed feature branch in one session, auto-approving routine workflow-control holds and hard-stopping on…

azalio/map-framework · 165 tokens

map-resume

Resume an interrupted MAP workflow from .map/ /stepstate.json checkpoint. Use when returning after context exhaustion, /clear, or a session crash mid-workflow. Do NOT use to start new work; use map-plan or map-efficient.

azalio/map-framework · 53 tokens