agentleFS
adamentwistleadamentwistle/fable-skills/data-loss-guard/SKILL.md

data-loss-guard

Skill98 starsChanged 2 months agoMITView on GitHub

Stop-and-check protocol before any destructive or hard-to-reverse operation. Use the moment a planned step would delete, overwrite, truncate, or rewrite state that cannot be trivially recreated — rm, file overwrites, git reset --hard, checkout/restore/clean of tracked files, force-push, rebasing pushed commits, branch deletion, DROP/TRUNCATE, DELETE or UPDATE without a tight WHERE, bulk API deletes, kill/pkill, terraform destroy, cache or volume wipes.

  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 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.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before any destructive action:

    line 10
  2. Distinctive:

    Uncommitted user work is sacred: If the working tree holds changes you didn't make, don't clean, checkout, stash, or overwrite them without …

    line 17

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

data-loss-guard

Almost every catastrophic agent failure is a destructive command run on a wrong assumption. Weak handling looks like rm -rf build/ typed from memory of what "should" be there. Strong handling predicts what the target contains, looks, and only then runs the narrowest command that does the job.

Before any destructive action:

  1. Predict, then look. Write down what you expect the target to contain (file count and names, row count, commits ahead of remote, which process owns the PID). Then check: ls -la before rm -rf; git status and git stash list before reset --hard, checkout ., restore, or clean; git log origin/branch..branch before force-push; SELECT COUNT(*) with the identical WHERE clause before DELETE or UPDATE; ps by PID before kill. If reality differs from the prediction — files you didn't create, more rows than expected, a PID you didn't start — stop and surface the difference. Don't reconcile it in your head and proceed.
  2. Distinguish recoverable from gone. Committed work is recoverable via reflog; uncommitted work is not. A dropped column or truncated table is gone. An overwritten file has no undo — including your own file-write tool on a file you did not create this session: read it first, and edit rather than replace. Rank the blast radius honestly before choosing convenience.
  3. Prefer the reversible variant: git stash over discard; move to a trash or backup path over rm; soft-delete or export-then-delete over hard delete; --dry-run wherever it exists (rsync, terraform, kubectl, many package and cloud CLIs) on the first pass, and paste its output before the real run.
  4. Scope the command tightly. Explicit paths over wildcards; absolute paths so a surprise cwd can't redirect the deletion; never rm -rf a variable-built path without first echoing the variable and checking it is non-empty and expected; kill by PID from a listing, never pkill/killall by name pattern on a shared machine; DELETE/UPDATE always with a WHERE that names specific keys, inside a transaction where the DB supports it.
  5. Destroy last. When replacing something — a file, a table, a branch, a service — the destructive step comes after the replacement is verified working, never before. A destructive command proposed as the fix for a problem you don't yet understand ("delete the cache / reset and start over") is a diagnosis shortcut: stop, find the cause, then decide whether deletion is needed at all.
  6. Uncommitted user work is sacred. If the working tree holds changes you didn't make, don't clean, checkout, stash, or overwrite them without the user's explicit say-so. Same for files, rows, or resources that exist and that you did not create.
  7. Force-push and history rewrites on shared branches need explicit user authorization, every time, and the push uses --force-with-lease.
  8. Report every destructive command. The final report lists each one you ran, what it removed, and how to recover it — or that it cannot be recovered.

Rule of thumb: cheap check, irreversible mistake — the one-command look-before-delete is always worth it.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.