rollback-guard
Skill10 starsChanged todayMITView on GitHub
Automated git and filesystem rollback guard with atomic state recovery. Use when executing risky modifications, self-refinement iterations, or autonomous driver loops to automatically snapshot clean baselines and restore them on test or verification failure.
- Deletes or force-pushes
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- code-frugalitySkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- context-pruningSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hook-gatingSkill
- hybrid-semantic-searchSkill
- kimi-code-agent-integrationSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- swarm-dagSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use before initiating risky automated code changes, multi-agent autonomous iterations, or self-refinement loops to snapshot clean workspace …
- Distinctive: line 13
Verify git status / clean tree state.
- Very specific: line 15
Create lightweight filesystem or stash snapshot in .autoharness/snapshots/<id>/.
- Distinctive: line 19
Run test suite (e.g. pytest).
- Distinctive: line 20
Run AST Anti-Shim sentinel to ensure no empty stubs or mocks were introduced.
- Distinctive: line 21
Check blast radius and syntax validity.
- Very specific: line 23
If tests or AST checks fail, immediately invoke rollback().
- Distinctive: line 27
If verification passes, finalize snapshot as verified baseline.
- Distinctive: line 30
Test clean snapshot capture: verify snapshot file is created with valid tree hash.
- Distinctive: line 31
Test rollback recovery: introduce broken code or stub in workspace, trigger rollback, verify file is restored to pre-flight snapshot.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.
Files
Rollback Guard
When to use
Use before initiating risky automated code changes, multi-agent autonomous iterations, or self-refinement loops to snapshot clean workspace state and restore it immediately if post-flight tests, AST checks, or syntax validations fail.
Steps
- Pre-flight Snapshot:
- Verify git status / clean tree state.
- Record HEAD commit hash and working tree state SHA256 (
evidence.tree_state). - Create lightweight filesystem or stash snapshot in
.autoharness/snapshots/<id>/.
- Execute Changes:
- Perform code modifications, agent tasks, or refactoring.
- Post-flight Verification:
- Run test suite (e.g. pytest).
- Run AST Anti-Shim sentinel to ensure no empty stubs or mocks were introduced.
- Check blast radius and syntax validity.
- Automated Rollback on Failure:
- If tests or AST checks fail, immediately invoke
rollback(). - Restore modified tracked files (
git restore .) and remove untracked artifacts (git clean -fdor snapshot overlay). - Log the regression failure and revert status to
.autoharness/sentinel.json.
- If tests or AST checks fail, immediately invoke
- Success Confirmation:
- If verification passes, finalize snapshot as verified baseline.
How to verify
- Test clean snapshot capture: verify snapshot file is created with valid tree hash.
- Test rollback recovery: introduce broken code or stub in workspace, trigger rollback, verify file is restored to pre-flight snapshot.
Facts found here
- Combining
git restorewith untracked artifact cleaning provides deterministic zero-leakage rollback across Windows and Unix platforms. - Pre-flight test baselines prevent attributing pre-existing broken tests to current task changes.
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.

