agentleFS
fusebase-devfusebase-dev/fusebase-flow/.agents/skills/git-history-diagnostic/SKILL.md

git-history-diagnostic

Skill9 starsChanged 28 days agoMITView on GitHub

Use when something worked before and is now broken (a regression), or the operator asks "when did this break", "find the commit that caused X", "it used to work", "compare to a previous version". Locates where a regression entered by comparing commits / bisecting history. Do NOT use for net-new bugs that never worked, for routine rollback (workflows/git-discipline.md), or as a substitute for reproduce-before-fix (FR-10).

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Capture: If the regression class is recurring, note it in docs/problem-catalog/.

    line 55
  2. Distinctive:

    Do not fix in this skill (diagnosis only).

    line 107
  3. Distinctive:

    Do not bisect without a deterministic signal (false culprit).

    line 108
  4. Distinctive:

    Do not auto-revert the causing commit — zoom out first (it may be load-bearing).

    line 109
  5. Distinctive:

    Do not leave the repo in bisect state — git bisect log for evidence, then git bisect reset before any handoff or fix work.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Git History Diagnostic

Style: Mode-B-lite.

Purpose

Regression archaeology: when behavior that previously worked is now broken, locate where it broke by comparing commits / bisecting history — so the fix targets the actual causing change, not a guess. Read-only diagnosis; the fix is handed to zoom-out + validation-and-qa.

When to invoke

  • "It used to work" / "this is a regression" / "when did X break".
  • A test that passed at an earlier commit now fails.
  • Operator points to a known-good prior state and a now-broken current state.

Do not invoke when

  • The behavior never worked (net-new bug → normal debugging).
  • Routine rollback of a known commit → workflows/git-discipline.md.
  • Reproduction isn't established yet → run FR-10 reproduce-before-fix first (you need a reliable signal to bisect against).

Required inputs

InputWhere it livesIf missing
A reliable broken/works signal (test or repro)test suite / repro stepsestablish via FR-10 first; bisecting needs a yes/no test
Last-known-good reference (commit/tag/date)operator / git historysearch backward from HEAD for the transition
Current broken stateHEAD—

Procedure

  1. Pin the signal. Define a deterministic check that returns good/bad (a test command, a repro). Bisection is only as reliable as this signal.
  2. Bracket. Identify a known-good commit (or tag/date) and a known-bad commit (usually HEAD). Verify the signal at both ends.
  3. Bisect. Narrow the range with git bisect run on the pinned signal (see § Bisect mechanics; manual good/bad stepping or binary search when the signal is not scriptable) until the first bad commit is found.
  4. Explain. Show that commit's diff; identify the specific change that introduced the regression (file:line).
  5. Hand off. Pass the finding to zoom-out (root-cause vs revert decision) and validation-and-qa for the fix + regression test. Do not fix here.
  6. Capture. If the regression class is recurring, note it in docs/problem-catalog/.

Bisect mechanics

git bisect start
git bisect bad HEAD                  # or the known-bad commit
git bisect good <known-good>         # tag/sha; by date: git rev-list -1 --before="2026-06-01" main
git bisect run <signal-cmd>          # automated walk — exit codes below
# manual mode: run the signal yourself, then `git bisect good` / `git bisect bad` each step
git bisect skip                      # this commit unbuildable / signal not evaluable
git bisect log > state/bisect-<slug>.log   # capture evidence BEFORE reset
git bisect reset                     # ALWAYS — returns to pre-bisect HEAD

git bisect run exit-code contract (the signal command MUST encode it):

Exit codeMeaning
0good
1–124, 126–127bad
125cannot test this commit → auto-skip
≥128aborts the whole bisect — wrap signals that can be signal-killed

Wrap non-conforming signals: git bisect run sh -c '<build> || exit 125; <test> || exit 1'.

Pickaxe shortcut — before (or instead of) a full bisect, when the regression plausibly traces to a known string/symbol: git log -S '<symbol>' --oneline -- <path> (or -G '<regex>') lists only commits that added/removed it — often pins the culprit in one command.

Output artifacts

ArtifactPath or locationMode
Regression-origin findingchat (Mode A) + optional ticket noteMode A / Mode-B-lite
Causing-commit diff excerptchat / handoffMode A

Failure cases

Failure modeDetectionResponse
No deterministic signalbisect gives inconsistent resultsgo back to FR-10; build a stable repro/test
Regression spans multiple commitseach end behaves inconsistentlyreport the range; treat as design issue via zoom-out
"Good" reference also brokenstep 2 verify failssearch further back for the true good state
Signal still bad N brackets back (2–3 extensions: N → 2N → 4N commits, all bad)step 2 verify keeps failing ever further back, incl. commits the operator KNOWS workedStop bisecting — history is likely not the cause. Suspect environment/CLI/dependency drift: diff the lockfile (git diff <good>..HEAD -- package-lock.json), compare fusebase --version + Node version against the last-known-working session, check whether fusebase update rewrote CLI-managed files (see fusebase-flow-health-check for CLI_LAYER_DRIFT). Re-verify the signal in a clean checkout/fresh install; resume bisect only once a genuinely good state reproduces.

Escalation path

  • Cause spans many commits / cross-cutting → workflows/architect-escalation.md.
  • Fix design → flow-skills/zoom-out/SKILL.md then validation-and-qa.
  • Ambiguous good-reference → ask operator in chat (FR-19).

Anti-patterns

  • Do not fix in this skill (diagnosis only).
  • Do not bisect without a deterministic signal (false culprit).
  • Do not auto-revert the causing commit — zoom out first (it may be load-bearing).
  • Do not leave the repo in bisect state — git bisect log for evidence, then git bisect reset before any handoff or fix work.

Clean-room note

Original Fusebase Flow content. Designed after reviewing public AI coding workflow patterns; no third-party code, prompts, skill files, or hook scripts are copied. See docs/source-map.md.

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.