Detect accidental reverts of recently-merged PRs in the working tree before commit. Catches stale-buffer / bad-stash-pop scenarios that would silently undo landed bug fixes.
/revert-check [--strict|--advisory]
git stash pop, a branch switch, or an editor session that may have restored stale buffers/revert-check
What you’ll see: either ✓ No suspected reverts. Working tree changes look like genuine new work. or a table of flagged files showing the net line delta and the recently-merged PRs that touched each file, with verification commands.
/revert-check # advisory (default) — warn but never block
/revert-check --advisory # same as default
/revert-check --strict # exit non-zero on any suspected revert — for pre-commit hooks / CI
| Flag | Values | Default | What it does |
|---|---|---|---|
--advisory |
— | on | Warn only; always exits 0 |
--strict |
— | off | Exit 1 when any suspected revert is found — use as a blocking gate |
origin/main or equivalent), fetched fresh.git diff / gh pr view / git restore commands to verify or discard. The human decides — the skill never modifies anything.The check is entirely read-only: no files written, no watchers registered, no refs touched.
--strict mode| Problem | Fix |
|---|---|
| A genuine refactor or test consolidation is flagged | Expected false positive — review the diff, then proceed in advisory mode and document the intentional deletion in your commit message (e.g., “Refactor: removing dead code #123”) |
skipped: no remote baseline |
No remote or default branch detectable (offline, no origin) — the check skips gracefully with exit 0 |
| A subtle one-line revert wasn’t caught | Below the heuristic’s threshold by design — /qa’s test execution is the second line of defense |
| Lockfile or generated artifact gets flagged | These should be filtered automatically — if one slips through, it’s safe to ignore and proceed (advisory mode never blocks you) |