agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/bisect/SKILL.md

bisect

Skill2 starsChanged 4 months agoMITView on GitHub

Find the commit that introduced a regression using git bisect, guided by a description of what broke and a way to test it. Use when the user says "find the commit that broke this", "bisect this regression", "when did this stop working", "git bisect", or "what change caused this bug".

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

9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Confirm the working tree is clean: If there are uncommitted changes, stop and tell the user to stash or commit first — bisect checks out …

    line 23
  2. Very specific:

    Start: git bisect start, then git bisect bad <bad> and git bisect good <good>.

    line 29
  3. Very specific:

    Prefer git bisect run <command>: when a deterministic test command exists — it automates the whole search.

    line 30
  4. Distinctive:

    If the test must be manual, check out each step, have the user test, and relay git bisect good / git bisect bad per step.

    line 31
  5. Very specific:

    When bisect names the first bad commit, git bisect reset to restore the original HEAD — always clean up, even if interrupted.

    line 32
  6. Very specific:

    If the cause is subtle, hand off to the debug skill to drive the fix.

    line 38
  7. Distinctive:

    Never run bisect with a dirty working tree.

    line 42
  8. Distinctive:

    Keep the pass/fail test deterministic and fast — flaky tests give wrong answers.

    line 43
  9. Distinctive:

    Don't modify code during the bisect.

    line 44

“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

Repo state

!git log --oneline -15 2>/dev/null || echo "Not a git repository"

!git tag --sort=-creatordate 2>/dev/null | head -10

!git status --short 2>/dev/null

Instructions

Locate the commit that introduced the regression described in $ARGUMENTS using git bisect. If the symptom or a way to reproduce it isn't clear, ask before touching the repo.

Before starting

  1. Confirm the working tree is clean. If there are uncommitted changes, stop and tell the user to stash or commit first — bisect checks out old commits and would clobber or be blocked by them.
  2. Establish a "bad" and a "good" ref. "Bad" is usually HEAD. For "good", use the ref the user named, or help find a plausible older commit/tag where the behavior worked. Verify the assumption if cheap (e.g. note when the relevant code was last touched).
  3. Define a precise pass/fail test. A single command that exits 0 when good and non-zero when bad is ideal (a failing test, a build, a script, a grep on output). Pin this down — a fuzzy "it looks broken" makes bisect unreliable.

Running the bisect

  1. Start: git bisect start, then git bisect bad <bad> and git bisect good <good>.
  2. Prefer git bisect run <command> when a deterministic test command exists — it automates the whole search. Make sure the command's exit code reflects pass/fail (use exit code 125 to skip un-testable commits, e.g. ones that don't build for unrelated reasons).
  3. If the test must be manual, check out each step, have the user test, and relay git bisect good / git bisect bad per step.
  4. When bisect names the first bad commit, git bisect reset to restore the original HEAD — always clean up, even if interrupted.

After finding it

  1. Show the offending commit: git show <sha> --stat, then read the actual diff to explain why it caused the regression.
  2. Summarize: the first bad commit, what it changed, the likely mechanism of the break, and a suggested fix or revert (git revert <sha> for a clean undo).
  3. If the cause is subtle, hand off to the debug skill to drive the fix.

Rules

  1. Never run bisect with a dirty working tree. Always git bisect reset when done or on any error.
  2. Keep the pass/fail test deterministic and fast — flaky tests give wrong answers. Use git bisect skip for commits that genuinely can't be tested.
  3. Don't modify code during the bisect; this is diagnosis. Propose the fix separately once the commit is found.

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.