regression-guard
Skill1 starsChanged 6 months agoMITView on GitHub
Generate a Rust #[test] skeleton that anchors a refactor commit. Reads the commit's diff, auto-detects the refactor pattern (let-else / let-Ok-else / warn-continue / SAFETY-annot / graceful-degrade / struct-update / error-return), emits a test fn skeleton with REGRESSION-GUARD docstring back-ref so reverting the fix surfaces the commit in test output.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- pym96/skillstheir own version, first seen Oct 20, 2026
- future-mine/claude-skilltheir own version, first seen Oct 8, 2026
- fagemx/eddatheir own version, first seen Sep 1, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- fagemx/edda★ 36same name
- pym96/skills★ 2same name
- future-mine/claude-skill★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- audit-unused-depSkill
- checkpointSkill
- double-checkSkill
- file-adrSkill
- fleetSkill
- fmt-sweepSkill
- forge-mirror-scaffoldSkill
- forgeSkill
- gemini-pullSkill
- loop-from-taskSkill
- loop-healthSkill
- loop-onSkill
- loopSkill
- loopsSkill
- restoreSkill
- workspace-testsSkill
The file
Files
/regression-guard — emit a REGRESSION-GUARD test stub for a refactor commit
Thin wrapper around the regression-guard binary (installed at
~/.local/bin/regression-guard; built by install.sh). Binary
owns: git show of the commit, diff pattern auto-detection, test
skeleton rendering. Agent fills in the test body.
Steps
Invoke the binary with the refactor commit hash:
regression-guard <commit-hash> \ [--pattern <override>] \ [--test-name <fn-name>] \ [--module-path <crate::path::to::mod>] \ [--git-dir <repo-path>]Stdout is a Rust source snippet (test fn + REGRESSION-GUARD docstring referencing the commit + the detected pattern).
- Paste the snippet into the test module of the file the
refactor touched (typically
src/<file>.rs's#[cfg(test)] mod testsblock). - Fill in the test body with the actual exercise of the pathological input the refactor defends against. Examples per pattern are listed in the snippet's TODO comment.
- Run the test:
cargo test <test_name>— it MUST pass on the post-refactor code (that's the point — it locks in the new behaviour). If it fails, the test isn't asserting the right thing; revisit. - Commit the test in the same PR / commit-chain as the
refactor, or in a
[REGRESSION-GUARD]-prefixed follow-up commit referencing the refactor hash.
Net visible tool calls per regression-guard
2–4 total: Bash (regression-guard) + Edit (paste snippet) +
Bash (cargo test) + optional Bash (commit).
Down from ~6 in the prior manual flow (read commit, identify pattern in head, write test from scratch, write docstring, copy hash, etc.).
Detected patterns
| Pattern | Trigger in diff |
let-else | .unwrap() removed + let Some(x) = ... else added |
let-ok-else | .unwrap_or_else(|_| panic!()) removed + warn!() + let Ok added |
warn-continue | if let Ok(x) = stream removed + match + warn + continue or .flatten() added |
safety-annot | // SAFETY: annotation added |
graceful-degrade | .expect() removed + ok_or_else / ? / Err / else { added |
struct-update | T::default(); x.f = v; removed + ..Default::default() added |
error-return | panic!() removed + return Err(...) added |
Auto-detection covers the common cases from the LFI 2026-05-19
doctrine sweep (31 violations cleared across 9 files). For
patterns not covered, pass --pattern unknown and edit the
docstring manually.
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
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.

