rollback-safe
Skill12 starsChanged 46 days agoMITView on GitHub
Undo the last AI change without losing user work. Use when the latest AI-applied change broke something, the user says "desfaz", "volta", "undo", "estraga tudo", or after `bug-triage-agent` selects a revert as the safest fix. Designed for vibe coders who don't yet trust git.
- Deletes or force-pushes
- Commits and pushes
In this repository28 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- business-plan-impact-reviewSkill
- codemapSkill
- cost-watchdogSkill
- daily-standupSkill
- decision-logSkill
- deploy-vercel-supabaseSkill
- feature-scaffoldSkill
- first-100-usersSkill
- grow-sustainablySkill
- multi-ai-reviewSkill
- os-self-testSkill
- pitchSkill
- plain-portuguese-explainerSkill
- privacy-auditSkill
- processizeSkill
- product-briefSkill
- project-genesisSkill
- prototype-labSkill
- registry-pickSkill
- release-checkSkill
- research-wavesSkill
- secrets-disciplineSkill
- secrets-scanSkill
- sprint-managementSkill
- sprint-roadmapSkill
- usage-monitorSkill
- verify-build-worksSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Very specific: line 22
Use git restore <file> for unstaged changes, git restore --staged <file> for staged.
- Distinctive: line 40
Use git revert (not git reset --hard) so collaborators / CI / Vercel pick up the undo cleanly.
- Distinctive: line 47
Before running ANY rollback command:
- Very specific: line 75
Add a one-liner to session-log/ explaining why we rolled back.
≈ “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.
Files
Rollback Safe
When to run this skill
- The user says "desfaz isso" / "volta o que você fez" / "anda pra trás" / "tira essa última mudança".
bug-triage-agentrecommends a revert.- A change just shipped and broke something obvious.
- The user pasted a wrong thing into a config / env file.
Mental model for the vibe coder
Pensa numa máquina do tempo do projeto. Cada commit é uma foto do projeto inteiro. "Desfazer" não apaga a foto — ele só te leva pra foto de antes. Se mudar de ideia, você pode voltar pra foto atual a qualquer momento. Nada que você fez se perde.
Rollback levels (always try the smallest first)
Level 0 — Nothing committed yet
Use git restore <file> for unstaged changes, git restore --staged <file> for staged.
Safe and instant.
Level 1 — Last commit is the bad one
git revert HEAD --no-editCreates a new commit that undoes the previous one. History stays linear, nothing lost.
Level 2 — Several commits to undo
Pick the last good commit hash and:
git revert <last-good-commit>..HEAD --no-editThe range excludes its left end, so it reverts every commit after the last good one. Each bad commit gets its own undo commit.
Level 3 — Already pushed and remote needs cleaning
Use git revert (not git reset --hard) so collaborators / CI / Vercel pick up the undo cleanly.
Level 4 — DO NOT default to this
git reset --hard <hash> rewrites local history. Only use after explicitly asking the user, AND backing up untracked files first. Never on a shared branch.
Pre-flight checklist (mandatory)
Before running ANY rollback command:
- Snapshot uncommitted work.
Even if it looks like "nothing important", stash it. Stashes can be popped back.git stash push -u -m "rollback-safe-snapshot-$(date +%s)" - Confirm the target. Show the user the exact commit (hash, message, date) you're about to undo.
- Show the blast radius. List which files will change.
- Confirm with the user in plain Portuguese.
Vou voltar o projeto pro estado antes de [commit msg]. Isso vai mudar [N] arquivos. Seu trabalho não-commitado tá guardado e dá pra voltar. Posso prosseguir? - Apply.
- Verify build still works (use
verify-build-works).
After rollback
- Show the user the new commit log (
git log --oneline -5). - Tell them: "se quiser voltar, é só me pedir 'desfaz o desfaz' — eu reverto o revert".
- Add a one-liner to
session-log/explaining why we rolled back.
Anti-patterns
- ❌
git reset --hard HEAD~1without snapshot. - ❌
git push --forceto "clean up" remote history on a shared branch. - ❌ Deleting files manually because "they shouldn't be there" without checking what they were.
- ❌ Skipping the snapshot because "the user has nothing important uncommitted" — you don't know that.
Output
↩️ Rollback safe report
Snapshot: stash@{0} (rollback-safe-snapshot-1714329600) — seu rascunho tá aqui se precisar.
Voltei o projeto pra: 7604d32 ("docs: prepare public release metadata")
Arquivos afetados: 11
Build: ✅ ainda passa
Próximo passo: testar o fluxo que estava quebrando.
Se quiser desfazer esse desfazer: me pede "rebobina o rebobina".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.

