agentleFS
thixpinthixpin/claude-config/skills/bug-fix/SKILL.md

bug-fix

Skill8 starsChanged 4 months agoMITView on GitHub

Regression-first workflow for fixing a defect whose cause is known. Reproduce the confirmed defect, fix the root cause minimally, protect it with a regression test, and verify. If the root cause is still unknown, use the debugging skill first.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use refactor and code-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    This skill begins once the root cause is identified: If the cause is still unknown, use debugging first, then return here with it.

    line 14
  2. Distinctive:

    Verify: Run the regression test, then the smallest relevant surrounding test suite to catch collateral damage.

    line 28
  3. Distinctive:

    Check for siblings: Search for other call sites or copies of the same pattern that share the defect.

    line 29
  4. Distinctive:

    If the "bug" is actually intended behavior, stop and explain before changing anything.

    line 33
  5. Distinctive:

    If the correct fix requires a breaking change or wide refactor, present the minimal safe fix and the larger fix as options rather than …

    line 34
  6. Very specific:

    If the fix touches security-sensitive code (auth, permissions, input handling), also apply the security-audit skill's checklist to the …

    line 35

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bug Fix

Fix bugs regression-first: prove the bug exists, fix the cause minimally, prove it cannot return.

Scope

Use for any defect with observably wrong behavior and a known cause — crashes, incorrect output, regressions.

This skill begins once the root cause is identified. If the cause is still unknown, use debugging first, then return here with it.

Do not use for:

  • Writing or restructuring tests against working code — use testing.
  • Improving healthy code that has no defect — use code-quality-review.

A vulnerability is a bug: use this workflow and the security-audit checklist together.

Workflow

  1. Reproduce first. Confirm the bug with a concrete failing case — a command, request, or input that demonstrably misbehaves. If you cannot reproduce it, use debugging to establish a reliable trigger before continuing here.
  2. Confirm the root cause. State it in one sentence before fixing, and check the fix targets it rather than the symptom (no null check where the real problem is that the value should never be null). If tracing from symptom to cause is still open work, finish that in debugging first.
  3. Write the regression test before the fix whenever the project has a test suite and the bug is testable. The test must fail on the current code for the same reason the bug occurs. If an automated test is infeasible (environment-dependent, UI-only, timing), state why and describe the manual verification used instead.
  4. Fix minimally. The smallest change that removes the root cause. No drive-by refactoring, renames, or style changes in the same edit — propose those separately if worthwhile.
  5. Verify. Run the regression test, then the smallest relevant surrounding test suite to catch collateral damage.
  6. Check for siblings. Search for other call sites or copies of the same pattern that share the defect. Fix or report them — a bug that exists in three places and is fixed in one is still open.

Judgment calls

  • If the "bug" is actually intended behavior, stop and explain before changing anything.
  • If the correct fix requires a breaking change or wide refactor, present the minimal safe fix and the larger fix as options rather than choosing the invasive one unilaterally.
  • If the fix touches security-sensitive code (auth, permissions, input handling), also apply the security-audit skill's checklist to the change.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.