fix-one-bug

Guides narrow bug fixes with regression tests and preserved surrounding behavior.

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/0xMuluh/package-development-skills --skill fix-one-bug-0xmuluh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fix-one-bug
Source: https://github.com/0xMuluh/package-development-skills/tree/main/fix-one-bug
Command: npx skills add https://github.com/0xMuluh/package-development-skills --skill fix-one-bug-0xmuluh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug-fix pull requests often balloon into unrelated refactors, formatting churn, or speculative generalizations, making them hard to review and risky to merge. This Skill enforces a disciplined workflow that corrects exactly one defect with regression evidence while leaving the rest of the codebase untouched. ## Core Features & Use Cases - Structured Bug Statement: Requires a precise When/Actual/Expected bug statement and a scope contract defining non-goals before any code changes. - Regression-Test-First Workflow: Guides writing a minimal failing test that reproduces the defect, then making the narrowest sufficient correction. - Specialized Bug Guidance: Covers error bugs, numerical bugs, alignment bugs, metadata bugs, compatibility bugs, and private-API breakage with tailored testing advice. - Use Case: A numeric selection function errors due to a misspelled accessor. Use this Skill to write a failing regression test, fix the one-line accessor call, verify nearby behavior is preserved, and produce a clean single-purpose diff. ## Quick Start Use the fix-one-bug skill to fix the numeric selection error in my package with a regression test and no unrelated changes.

Frequently Asked Questions about fix-one-bug

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

FAQPage Schema
How do I write a good regression test for a bug fix?▼

Write a minimal test that reproduces the defect, expresses the expected behavior, fails on the buggy version, and passes after the fix. Test behavior through the public API rather than encoding implementation details, so the test survives future refactors.

How do I keep a bug fix PR small and reviewable?▼

Define a scope contract with explicit non-goals before coding, make the narrowest sufficient correction, and inspect the final diff line by line. Remove any change that would not be needed if the bug did not exist, including unrelated formatting or cleanup.

Should I refactor code while fixing a bug?▼

Generally no. Fix the bug in one pull request and refactor the now-tested area in a separate one. Combine them only when the current structure prevents a safe narrow fix, and explain that necessity explicitly.

What should I do when a bug fix reveals multiple defects?▼

Classify them by root cause. Defects sharing one root cause and one behavioral correction can be fixed together, such as the same misspelled accessor in three methods. Independent defects should be split into separate pull requests.

How do I handle a bug caused by a dependency's private API?▼

Characterize the required behavior, search for a public replacement API, and use it if suitable. Otherwise implement the minimal local behavior while preserving existing package semantics, and never replace one private call with another private call.