git-bisect
Finds the commit that introduced a regression by driving git bisect with an automated test command and reporting the culprit with its diff. Use when a test that used to pass now fails, when the user asks which commit broke something, or mentions bisecting, regression hunting, or 'when did this start'.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- git-bisect
- metadata
- { "tier": "universal", "status": "active", "version": "0.1.0" }
- description
- Finds the commit that introduced a regression by driving git bisect with an automated test command and reporting the culprit with its diff. Use when a test that used to pass now fails, when the user asks which commit broke something, or mentions bisecting, regression hunting, or 'when did this start'.
02 资源文件 1
- 参考文档references/edge-cases.md443 B
03 SKILL.md 正文
git-bisect
Purpose
Find the first bad commit between a known-good and a known-bad ref by letting git bisect run drive the search with a test command, then report the culprit commit with its diff and the reasoning.
Inputs to establish first
- A
goodref where the behavior was correct (a tag, a sha, or "the last release"). If the user does not know one, proposegit log --oneline -30and ask them to pick the oldest commit they trust. - A
badref (defaultHEAD). - A command that exits 0 when the behavior is correct and non-zero when it is broken. Prefer the narrowest test: one test file, one test name. If none exists, write a throwaway script under
/tmpthat reproduces the report and exits by its outcome, and show it to the user before running.
Procedure
- Confirm the working tree is clean (
git status --porcelain); stash or refuse if it is not, because bisect checks out commits. - Sanity-check the endpoints before bisecting: run the command at
bad(must fail) and atgood(must pass). If either check does not behave, stop and say so; bisecting on a flaky or mis-specified command wastes every step. - Run
git bisect start <bad> <good>thengit bisect run <command>. Usegit bisect skipsemantics via exit code 125 when a commit cannot be built. - Read the "is the first bad commit" line. Capture
git show --stat <sha>and the relevant hunk. - Always run
git bisect resetafterwards, even on failure, so the user is back on their branch.
Report
- The culprit sha, author, date, and subject.
- The hunk most likely responsible, with one sentence on why.
- The exact commands used, so the user can reproduce.
- If the culprit is a merge commit, say so and offer to bisect the merged branch with
--first-parentoff.
See edge cases for flaky tests, submodules, and untestable ranges.
04 同仓库更多 Skills
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
fx-demo
A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests/unit/self-consistency.test.mjs.
sf-caller
Calls the worker subagent to do a thing. Use when delegating work to sf-worker.
sf-do-thing
Converts CSV input into a formatted summary. Use when the user asks to summarize or tabulate spreadsheet data.
root-skill-plugin
Summarizes a changelog section into one release-note sentence. Use when the user asks to condense a list of changelog bullets into a single announcement line.