agentleFS
Cor-IncorporatedCor-Incorporated/claude-code-skills/skills/bugfix/SKILL.md

bugfix

Skill5 starsChanged 2 months agoMITView on GitHub

Investigate, fix, and regression-proof bugs across the codebase. Invoke with: /bugfix [bug description]. Performs root cause analysis with full codebase grep, applies fixes to ALL instances (not just the first match), adds regression tests, and generates a structured report. Uses web search for unknown error patterns and library-specific issues. Use when: user reports a bug, error log needs investigation, fixing a GitHub Issue labeled 'bug'. Do NOT use for: new feature implementation, refactoring without a bug, performance optimization, or UI styling changes.

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use feature, refactor and 8 more.

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.
  • bradtraversySkill

    feature

    Manage current feature workflow - start, review, explain or complete

    Also in 7 projects that use this

  • 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 6 projects that use this

  • SentrySkill

    spec

    Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.

    Also in 4 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 8 projects that use this

  • Microsoft AzureSkill

    docs

    Also in 3 projects that use this

  • MicrosoftSkill

    pr-review

    Verify the technical accuracy of a vscode-docs pull request against the VS Code source code in microsoft/vscode. Use when reviewing a docs PR for factual correctness: setting names, command IDs, default values, API shapes, keybindings, versioned availability, and described behavior.

    Also in 3 projects that use this

  • +1 more from getsentry

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search related code and logs with Grep/Read.

    line 20
  2. Distinctive:

    Keep changes minimal -- no over-engineering.

    line 41
  3. Very specific:

    Follow immutable patterns: return { ...obj, field }.

    line 42
  4. Distinctive:

    Run lint and type-check -- zero errors.

    line 51
  5. Distinctive:

    Add a regression test that fails WITHOUT the fix.

    line 52
  6. Distinctive:

    Run tests -- all pass.

    line 53

“Common” is measured: kept by at least 6 in 10 of the 31 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

Bugfix Specialist

Fix bugs with full codebase coverage: investigate -> root cause -> fix ALL instances -> verify -> test -> report.

Workflow

<important if="investigating a bug report or diagnosing an error from logs">

Phase 1: Investigation

  1. Parse the bug description from $ARGUMENTS.
  2. Search related code and logs with Grep/Read.
  3. Web search for the error message: "exact error message" framework_name.
  4. Web search for library bugs: "package@version known issues".
</important><important if="performing root cause analysis or grepping for all instances of a bug pattern">

Phase 2: Root Cause Analysis

  1. Grep the entire codebase for the causal pattern.
  2. List ALL instances (file:line).
  3. Confirm root cause with code evidence.
</important><important if="applying bug fixes across the codebase">

Phase 3: Fix

  1. Apply the fix to EVERY instance found in Phase 2.
  2. Keep changes minimal -- no over-engineering.
  3. Follow immutable patterns: return { ...obj, field }.
</important><important if="verifying a bugfix or generating regression tests">

Phase 4: Verification

  1. Re-grep the pattern -- confirm zero remaining instances.
  2. Run lint and type-check -- zero errors.
  3. Add a regression test that fails WITHOUT the fix.
  4. Run tests -- all pass.
</important>

Phase 5: Report

Generate the report below and present to user.

<important if="writing a bugfix report or documenting a completed fix">

Report Format

# Bugfix Report: [Title]

## Bug
- **Symptom**: [What happens]
- **Impact**: [Scope of affected users/features]

## Root Cause
- **Cause**: [Technical explanation]
- **Location**: [file:line]
- **All instances**: [grep results]
- **External research**: [Web search findings, if any]

## Changes
| File | Change | Lines |
|------|--------|-------|
| path/to/file | description | +/-N |

## Verification
- [ ] Grep: zero remaining instances
- [ ] Lint: zero errors
- [ ] Types: zero errors
- [ ] Regression test added
- [ ] All tests pass

## Regression Prevention
- Test: [description of added test]
</important>

Error Handling

SituationAction
Cannot reproduceAsk user for exact steps, env, and logs
Root cause unclear after grepWiden search to dependencies and config files
Web search returns no resultsTry alternative error message fragments
Fix breaks other testsRevert, re-analyze, apply narrower fix
Multiple root causes foundFix each separately, report all
<important if="linking a bugfix to a GitHub Issue or creating a new bug issue">

GitHub Issue Integration

gh issue list --state open --label bug
gh issue create --title "fix: [title]" --label bug --body "[details]"  # if none exists
git commit -m "fix: [description] #ISSUE_NUMBER"
</important>

Prohibited

  • Fixing only the first match without grepping for all instances.
  • Skipping web search and assuming "not a known issue".
  • Completing without adding a regression test.
  • Completing without a GitHub Issue reference.
  • Guessing "no other instances exist" without grep proof.

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.