agentleFS
moah0911moah0911/aftermath/skills/destructive-action/SKILL.md

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

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
  1. Distinctive:

    Stop. Name the command and what it destroys, in plain terms.

    line 17
  2. Distinctive:

    Check cheapness: uncommitted / one file / cheap to undo?

    line 19
  3. Distinctive:

    After running, report what changed and how to verify it.

    line 21
  4. Very specific:

    Run aftermath init / /aftermath-init to record the project's safePaths (disposable artifacts) and protectedPaths (source, VCS, secrets, …

    line 39
  5. Very specific:

    Never force-push, drop, or rm -rf on a guessed path.

    line 53

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

Destructive Action

Irreversible means unrecoverable. Slow down to the speed of verification.

Before any destructive command

  1. Stop. Name the command and what it destroys, in plain terms.
  2. Confirm current state explicitly: git status --short, git diff --stat, remote/branch/database target. No proceeding on assumption.
  3. Check cheapness: uncommitted / one file / cheap to undo? If not cheap, require explicit user confirmation with the target named back.
  4. At full, ask before running. At ultra, still ask — ultra auto-reverts cheap damage only, never auto-destroys.
  5. After running, report what changed and how to verify it.

High-risk catalog and safer alternatives

RiskExamplesSafer first move
History rewritegit push --force, git reset --hardNew commit; git revert; back up the branch
Worktree wipegit clean -fd, git checkout -- ., git restore .git clean -n, git stash -u, revert specific files
Data lossDROP TABLE, DELETE FROM, TRUNCATE, dropdbDump first; run in a transaction; target a copy
Filesystemrm -rf, shred, dd of=, mkfs, find -delete, xargs rmName the absolute path; ls it first; move to trash
Infrastructureterraform apply/destroy, kubectl delete, helm uninstall, docker system pruneterraform plan, --dry-run=client, inspect the target
Migrationsprisma migrate resetmigrate status, back up, apply forward
Permissionschmod -R 777Narrow the mode and the path

Enforcement and allowlist

  • OpenCode blocks matching commands at full/ultra; lite only flags them.
  • Claude Code / Codex block them through PreToolUse (exit 2) with the same policy.
  • Run aftermath init / /aftermath-init to record the project's safePaths (disposable artifacts) and protectedPaths (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)

  1. git diff --name-only against task start. List every file outside the stated scope.
  2. Revert or justify each one out loud. "While I was here" is not a justification.
  3. 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.

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.