destructive-action
Skill14 starsChanged 6 days agoMITView on GitHub
Use when the next action is irreversible: force push, reset --hard, clean, drop, delete, rm, overwrite, schema migration, or permission change. Confirm current state explicitly and never proceed on assumption. Also covers scope creep and the forward-edit freeze that follows an unresolved failure.
- Deletes or force-pushes
- Commits and pushes
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aftermathSkill
- aftermathSkill
- build-failureSkill
- dependency-failureSkill
- flaky-testSkill
- merge-conflictSkill
- retry-loopSkill
- test-regressionSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- could be automatic: a setting could enforce it
- Distinctive: line 17
Stop. Name the command and what it destroys, in plain terms.
- Distinctive: line 19
Check cheapness: uncommitted / one file / cheap to undo?
- Distinctive: line 21
After running, report what changed and how to verify it.
- Very specific: line 39
Run aftermath init / /aftermath-init to record the project's safePaths (disposable artifacts) and protectedPaths (source, VCS, secrets, …
- Very specific: line 53
Never force-push, drop, or rm -rf on a guessed path.
≈ “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
Destructive Action
Irreversible means unrecoverable. Slow down to the speed of verification.
Before any destructive command
- Stop. Name the command and what it destroys, in plain terms.
- Confirm current state explicitly:
git status --short,git diff --stat, remote/branch/database target. No proceeding on assumption. - Check cheapness: uncommitted / one file / cheap to undo? If not cheap, require explicit user confirmation with the target named back.
- At
full, ask before running. Atultra, still ask — ultra auto-reverts cheap damage only, never auto-destroys. - After running, report what changed and how to verify it.
High-risk catalog and safer alternatives
| Risk | Examples | Safer first move |
| History rewrite | git push --force, git reset --hard | New commit; git revert; back up the branch |
| Worktree wipe | git clean -fd, git checkout -- ., git restore . | git clean -n, git stash -u, revert specific files |
| Data loss | DROP TABLE, DELETE FROM, TRUNCATE, dropdb | Dump first; run in a transaction; target a copy |
| Filesystem | rm -rf, shred, dd of=, mkfs, find -delete, xargs rm | Name the absolute path; ls it first; move to trash |
| Infrastructure | terraform apply/destroy, kubectl delete, helm uninstall, docker system prune | terraform plan, --dry-run=client, inspect the target |
| Migrations | prisma migrate reset | migrate status, back up, apply forward |
| Permissions | chmod -R 777 | Narrow the mode and the path |
Enforcement and allowlist
- OpenCode blocks matching commands at
full/ultra;liteonly flags them. - Claude Code / Codex block them through
PreToolUse(exit 2) with the same policy. - Run
aftermath init//aftermath-initto record the project'ssafePaths(disposable artifacts) andprotectedPaths(source, VCS, secrets, manifests). Deletes under safe paths are allowed; protected, unknown, dynamic, and outside-project targets stay blocked. - Intentional exceptions:
{"destructiveAllowlist": ["rm -rf ./dist"]}in the global or project config. Entries are command substrings; keep them narrow. - A blocked command is a stop sign, not a puzzle. Confirm state or ask the user; do not rephrase to slip past the matcher.
Forward-edit freeze
After a test regression or an escalated repeat error, OpenCode and Claude Code / Codex block edit/write at full/ultra until a test passes, /aftermath-revert runs, or the level drops. Reverting through Bash is allowed. Do not bypass the freeze by editing through another tool or path.
Scope-creep check (same skill, same caution)
git diff --name-onlyagainst task start. List every file outside the stated scope.- Revert or justify each one out loud. "While I was here" is not a justification.
- Fix only the breaking diff. Move everything else to the audit (
/aftermath-audit), not into this fix.
Never force-push, drop, or rm -rf on a guessed path. A destructive command with an unverified target is rung 5 (guessing) plus rung 4 (irreversible) — stop on both.
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.

