agentleFS
rmstdopermstdope/cerebro/skills/fix-bug/SKILL.md

fix-bug

Skill2 starsChanged 24 days agoMITView on GitHub

The bug-fix role — take one bug bead, reproduce it with a failing test of the agent's choice, fix the implementation, and merge once the new and existing tests are green.

40 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use improvement, build-feature and 10 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.
  • kiminmonacoSkill

    improvement

    Guide for making improvements to existing ClaudeBar functionality using TDD. Use this skill when: (1) Enhancing existing features (not adding new ones) (2) Improving UX, performance, or code quality (3) User asks "improve X", "make Y better", or "enhance Z" (4) Small enhancements that don't require full architecture design For NEW features, use implement-feature skill instead.

    Also in 4 projects that use this

  • sirakinbSkill

    build-feature

    Autonomous task loop that picks ready tasks, implements them, updates progress.txt, commits, and repeats. Use when asked to 'build feature', 'run the loop', or 'implement these tasks'.

    Also in 5 projects that use this

  • kiminmonacoSkill

    implement-feature

    Guide for implementing features in ClaudeBar following architecture-first design, TDD, rich domain models, and Swift 6.2 patterns. Use this skill when: (1) Adding new functionality to the app (2) Creating domain models that follow user's mental model (3) Building SwiftUI views that consume domain models directly (4) User asks "how do I implement X" or "add feature Y" (5) Implementing any feature that spans Domain, Infrastructure, and App layers

    Also in 7 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 6 projects that use this

  • JetBrainsSkill

    create-plan

    Research the codebase and create an implementation plan with architecture notes, design document, and track decomposition. Use when starting a new feature or large change.

    Also in 4 projects that use this

  • JasonPaffSkill

    implement-plan

    Execute implementation plan with structured tracking and validation using subagent architecture

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 40 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Start from the bead's bug claim: Read the bead, and for a gh-<n> bead the issue.

    line 26
  2. Very specific:

    Keep existing behaviour green: Run the new test and the existing relevant tests, then the fast gate produce-bead *Building* names.

    line 35
  3. Distinctive:

    Write it for someone who has not read the code: the verifier turns *How to trigger it by hand* into the manual check, and a test name alone …

    line 62
  4. Very specific:

    Use the second-look form of that block when a verification:failed bug has nothing left to fix: the behaviour the navigator saw is already …

    line 76
  5. Distinctive:

    When handing back, append notes that name what you tried, what test surface you attempted, and what decision or missing information blocks …

    line 79

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

Fixing a bug bead

Take one bugfix bead from report to merge. The route is fixed: reproduce first, then fix. A bug bead never went through UX and never will: it carries no ux:agreed, no ux:none and no mockup, and scripts/bugfix-candidates is the one queue it is handed from.

Follow skills/produce-bead/SKILL.md for everything that is not the contract below, with these readings: the State file and its phases (design while you read the bead and decide the test, then build, gate, review, ci, rebase, merge); Workspace and its ports; Building, whose fast gate you run before the PR; Waiting, without ending your run; The review loop, where the reviewer reads the diff against the bead's bug claim and your reproduction test, since a bug bead has no plan, and your posted review says so in place of "the plan"; Red CI; Merging; The retrospective; Finishing, the parent walk included; and The navigator's gates, where your plan gate puts the reproduction test and the fix you intend to the navigator before you touch the implementation, and review and merge read as written. You write no design and add no planned: the reproduction test is the plan. Known traps from .cerebro/traps.md are read before you touch the code.

The bug-fix contract

  1. Start from the bead's bug claim. Read the bead, and for a gh-<n> bead the issue; identify the concrete behaviour that is wrong. A bead carrying verification:failed is a fix the navigator saw fail: read the dated failure note first, and what shipped (git log origin/main -F --grep "(<id>):"), before choosing the test.
  2. Reproduce with a test before touching implementation code. Choose the test type yourself: unit, integration, end-to-end, or another existing test shape in the repository.
  3. Make the reproduction test fail for the right reason. The failure must be the bug the bead describes, not an unrelated setup or fixture failure.
  4. Fix the implementation with the smallest coherent change that makes the new test pass.
  5. Keep existing behaviour green. Run the new test and the existing relevant tests, then the fast gate produce-bead Building names.
  6. Log the bug on the bead before you open the pull request, so the reviewer reads it and the verifier later decides from it how to check the fix by hand (below).
  7. Merge only through the pull request, after review and green checks (produce-bead Merging), then close the bead, close its parent if you were the last child, and end the pass. A bead is never closed without its bug log.

Logging the bug

One note, appended when the fix is green and before the pull request, under this heading so the verifier finds it:

bd update <id> --append-notes "## The bug, as fixed

**What was wrong:** <the wrong behaviour as a person or a caller met it, and its cause in the code>

**How the test triggers it:** <the test's file and name; the input, state or sequence of actions it
sets up; what it asserted, and what it got before the fix>

**How to trigger it by hand:** <the steps in the running application that showed the bug, taken
from the test's setup: where to start, what to do, what you saw before and should see now; or
\"Not reachable by hand:\" and why>"
bd dolt push

Write it for someone who has not read the code: the verifier turns How to trigger it by hand into the manual check, and a test name alone tells them nothing. If review changes the cause or the test, append a corrected note under the same heading; the last one is the one that stands.

When to hand back instead of forcing a fix

A bug is never parked for UX: producer-park refuses a bugfix bead, since the UX queue excludes it. Hand it back through produce-bead Handing back, the human form, when:

  • the bead does not describe a reproducible bug,
  • the bead's expected behaviour is ambiguous enough to need a product decision,
  • or reproducing it would require a test surface that does not exist and cannot reasonably be added within the bead's scope.

Use the second-look form of that block when a verification:failed bug has nothing left to fix: the behaviour the navigator saw is already gone from main, or another bead carries it.

When handing back, append notes that name what you tried, what test surface you attempted, and what decision or missing information blocks a correct fix.

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.