Bisect

From drn/dots · View interactive version

Bisect is an AI agent skill from the GitHub repository drn/dots. Find which commit introduced a bug using git bisect with automatic test verification. Use when tracking down which commit introduced a bug.

How to use this skill

Skill file

Git Bisect

Find the exact commit that introduced a bug using binary search with automatic test verification.

Arguments

Context

Instructions

Step 0: Validate state

Step 1: Determine boundaries

The "bad" commit is HEAD (current state where the bug exists).

For the "good" commit, ask the user or infer:

Step 2: Start bisect

git bisect start
git bisect bad HEAD
git bisect good <good-commit>

Report how many commits are in the range and the estimated number of steps (log2).

IF the range exceeds 1000 commits, warn the user: "This is a large range (<N> commits, ~<steps> steps). Consider narrowing the boundaries."

Step 3: Run bisect

IF the user provided a test command:

IF the user described the bug (manual mode):

Step 4: Present the result

Once bisect identifies the offending commit:

  1. Record the commit hash from bisect output.
  2. Run git bisect reset to restore the original state.
  3. IF changes were stashed in Step 0, run git stash pop.
  4. Show the offending commit details:
git show <hash> --stat
git show <hash>
  1. Check if the commit is associated with a PR:
git log --merges --ancestry-path <hash>..HEAD --oneline
  1. Present a summary:
## Bisect Result

**Offending commit:** <hash>
**Author:** <name> (<date>)
**Subject:** <commit message>

### Changed files
<list of files changed>

### Diff
<relevant diff excerpts>

### Related
- Merge commit: <if found>
- PR: <if identifiable from merge commit message>

Step 5: Cleanup

Verify that bisect state is fully cleaned up:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.