name: "bisect-regression"
description: "Use to plan and run a controlled Git bisect workflow to identify the commit that introduced a regression."
maturity-level: "L4"
risk-scope: "R0-R3"
version: "1.0.0"
Bisect Regression
Core Question
Which commit introduced a regression, and what evidence supports that conclusion?
When To Use
Use this skill when:
- the user has a known good and known bad commit or range
- a reproducible test command can identify pass/fail
- the user asks to bisect a regression
- manual or automated bisect is appropriate
When Not To Use
Do not use this skill when:
- debugging without a reproducible signal
- fixing the regression after identification
- running bisect on dirty user work
- rewriting history or pushing results
Route to:
- dirty current work routes to
worktree-management, stash-shelve, or atomic-commits - conflicts during checkout route to
undo-recover or stop - root-cause fix routes to coding workflow outside this library
Required Evidence
Before action, inspect or establish:
- known bad commit or current bad state
- known good commit
- test command and expected signal
- clean or isolated worktree state
- flakiness indicators
- generated files or build artifacts that may change during test
No-evidence rule:
- Do not make strong claims without observed evidence.
- State assumptions when proceeding under incomplete evidence.
- Stop when missing evidence affects safety, correctness, user work, remote state, or irreversible action.
Operating Contract
You MAY:
- inspect relevant repository state and project files.
- generate a plan, report, or local artifact within the declared risk scope.
- route to another skill when the requested action is outside this skill's owner boundary.
You MUST:
- inspect before acting.
- keep the task within the declared owner boundary.
- classify state and risk before any meaningful action.
- preserve unrelated user work.
- verify outcomes proportional to risk.
- report evidence, assumptions, actions, verification, and residual risk.
You MUST NOT:
- invent project policy.
- expose secrets or sensitive values.
- mutate unrelated files or refs.
- perform destructive, remote, shared, history-rewriting, or irreversible actions without explicit action-specific confirmation.
- continue after unexpected destructive output.
State / Risk Table
| State | Evidence | Risk | Default Action | Confirmation | Verification |
|---|
| Plan only | missing good/bad/test evidence | R1 | Ask for missing evidence or produce plan | no | plan states gaps |
| Clean bisect ready | good/bad/test evidence and clean tree | R3 | Run controlled bisect if explicit | yes | candidate verified |
| Dirty tree | status shows local work | R3 | Stop and isolate/preserve work first | yes | status unchanged |
| Flaky test signal | inconsistent results | R1/R3 | Do not claim culprit; require repeated verification | no | confidence caveat |
Workflow
- Identify the user goal and current owner boundary.
- Inspect required evidence.
- Classify repository/task state.
- Classify risk using the declared scope.
- Choose the minimal sufficient action or route.
- Execute only allowed actions, if any.
- Verify outcome or self-check the artifact.
- Report result, evidence, verification, assumptions, and residual risk.
Decision Rules
- Require clean or isolated worktree before checkout-based bisect.
- Always reset bisect state at the end or on stop.
- Do not claim root cause from one flaky run.
- Verify candidate with neighbor checks when feasible.
- May inspect logs, ranges, and status.
- May run bisect only after explicit plan and confirmation.
- Must not push or rewrite history.
- Must not leave repository in bisect state.
Verification
Minimum verification:
- Verify bisect reset occurred.
- Verify candidate commit with repeated or neighbor checks when feasible.
- Report test command and confidence.
Risk-based floor:
- R0-R1: evidence inspected and output self-checked.
- R2: inspect resulting diff or local state.
- R3: verify local state and report recovery limits.
- R4-R5: require explicit confirmation, preflight evidence, and post-action verification where this skill owns the action.
Output Contract
Final response must include:
## Result
- Decision, action, or artifact produced.
## Evidence
- Files, commands, diffs, refs, or assumptions used.
## Verification
- Checks performed and their result.
## Risks / Limitations
- Remaining uncertainty, blocked actions, or routed next steps.
Stop / Confirmation Rules
Stop when the repository state is dirty, conflicted, diverged, missing required evidence, or ambiguous in a way that could overwrite user work, invalidate the requested scope, or require a gated action.
Require explicit action-specific confirmation for:
- destructive local mutation.
- remote/shared mutation.
- history rewriting.
- security/secret/data impact.
- irreversible or hard-to-recover operation.
Broad approval such as "do whatever" is not enough for R4-R5 actions.
Lazy-load References
Load references/bisect-workflow.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.
Load references/flaky-tests.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.
Load references/worktree-isolation.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.