destructive-action
/destructive-action
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.
- Author
- moah0911 ↗
- Repository
- aftermath ↗
- Licence
- MIT
- Last repository change
- 07.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 07.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
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.
Original author description
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.
How it works
- Before any destructive command
- High-risk catalog and safer alternatives
- Enforcement and allowlist
- Forward-edit freeze
- Scope-creep check (same skill, same caution)
SKILL.md preview
---
name: destructive-action
description: >
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.
license: MIT
---
# 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
| 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`; `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.
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · moah0911/aftermath | 100 | MIT |
| moah0911/aftermath | 90 | MIT |
Database snapshot: 13.11.2026 · package version 269820c65213 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90git-safety
Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations. - 100git-guard
Ask before a destructive git write and summarize the diff first. Use before git push --force, git push --force-with-lease, push or amend of main, master, or release/*, git push --delete, git push origin :branch, git reset --hard, git clean -fdx, git filter-repo, git remote… - 100git-guardrails
Install a PreToolUse hook that vetoes destructive git: no-verify, branch -D, clean -f, reset --hard, history rewrite, force-push. Meant for any repo or agent that the hub guard misses. Use it to protect a project from destructive git, or to enforce no-force-push outside the hub, at the tool layer. - 100git-guardrails
Install a hook that blocks destructive git commands before an AI agent runs them. Use when an agent force-pushed or ran reset --hard, when adding git safety hooks, or when protecting main from agent pushes. - 100git-workflow
Writes commit messages, manages branches, and opens pull requests with summaries. Use when the user asks to commit, push, branch, or create a PR, and before any destructive git operation such as reset, rebase, or force-push. - 100backup-code
Create a safety backup before potentially destructive actions. Use when running risky git commands (reset, rebase, clean, restore, checkout with overwrite, force push), applying large sweeping edits, mass refactors, broad search-and-replace, generator rewrites, or any operation…