agentleFS
tejastn10tejastn10/workbench/skills/quality/bisect/SKILL.md

bisect

Skill1 starsChanged 2 months agoMITView on GitHub

Find the commit that introduced a regression with git bisect — pin a known-good and known-bad commit, automate the test where possible, land on the culprit, then understand why. Use when something worked before and doesn't now, the cause isn't obvious from a recent diff, and you can name a commit/tag where it was fine.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    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. Distinctive:

    Verify the bug is *absent* there.

    line 16
  2. Distinctive:

    Automate it: when the test is scriptable:

    line 30
  3. Very specific:

    Use exit 125 (git bisect skip) for commits that don't build — don't let them score as good or bad.

    line 37
  4. Very specific:

    If the repro needs a fresh install per step, do it in the script (npm ci / go mod download).

    line 39
  5. Distinctive:

    If the culprit is a merge commit, bisect *within* it (git bisect start with its parents).

    line 48

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

Bisect a regression

Binary search over history. Fast when you can name a good commit and script the check.

Setup

  1. Reproduce the bad behaviour on HEAD — a concrete check (a failing test, a command, a script that exits non-zero on the bug). This is your test.
  2. Find a known-good point — a tag, a release, a commit/date where it worked. Verify the bug is absent there.

Run

git bisect start
git bisect bad                 # HEAD is bad
git bisect good v1.4.0         # this was good
# git checks out the midpoint; test it:
git bisect good   # or: git bisect bad   (per your test result)
# repeat until: "<sha> is the first bad commit"
git bisect reset

Automate it when the test is scriptable:

git bisect start HEAD v1.4.0
git bisect run ./scripts/repro.sh   # exit 0 = good, non-zero = bad, 125 = skip
  • Use exit 125 (git bisect skip) for commits that don't build — don't let them score as good or bad.
  • If the repro needs a fresh install per step, do it in the script (npm ci / go mod download).

After

  • You have the first bad commit. Read its diff with the bug in mind — usually the mechanism is now obvious.
  • Hand to incident/investigate-bug to confirm the mechanism and write the regression test (name it for the bug).
  • If the culprit is a merge commit, bisect within it (git bisect start with its parents).

Anti-patterns

  • ❌ Starting without verifying the "good" commit is actually good.
  • ❌ Marking a non-building commit good or bad instead of skip.
  • ❌ A flaky test as the bisect check — you'll land on the wrong commit.
  • ❌ Stopping at the commit without understanding why it broke things.

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.