⚠️ MANDATORY - YOU MUST invoke this skill before ANY destructive operation. Safety protocol for destructive git/file operations...
Prevent accidental data loss by requiring explicit confirmation before any destructive operation, showing what will be lost, and suggesting safer alternatives.
CRITICAL: You MUST invoke this skill before ANY destructive operation. NEVER run destructive commands directly.
git reset --hard directlygit clean -fd directlyrm -rf directlyIf a destructive operation is needed, invoke this skill. Direct execution is FORBIDDEN.
Before using Bash tool for destructive operations, answer these questions:
git reset --hard?→ STOP. Invoke safe-destroy skill instead.
git clean -fd?→ STOP. Invoke safe-destroy skill instead.
rm -rf <directory>?→ STOP. Invoke safe-destroy skill instead.
git checkout -- . or git restore .?→ STOP. Invoke safe-destroy skill instead.
docker system prune -a?→ STOP. Invoke safe-destroy skill instead.
→ STOP. Invoke safe-destroy skill instead.
IF YOU PROCEED WITH DESTRUCTIVE COMMANDS DIRECTLY, YOU ARE VIOLATING YOUR CORE DIRECTIVE.
This skill handles:
Direct destructive commands can DESTROY USER WORK. Use this skill.
YOU MUST NEVER run destructive commands without explicit user confirmation.
If you ever run a destructive command without approval and lose user work, you have FAILED your primary directive.
git reset --hard - Destroys uncommitted changesgit clean -fd - Permanently deletes untracked files/directoriesrm -rf <directory> - Permanently deletes files/directoriesgit checkout -- . - Discards all working directory changesgit restore . - Discards all working directory changesdocker system prune -a - Removes all unused Docker datakubectl delete - Deletes Kubernetes resourcesgit push --force - Overwrites remote history (especially on main/master)User says something like:
IMMEDIATELY invoke this skill - don't execute the command.
DO NOT proceed with ANY destructive operation.
The user may not understand what will be lost. Your job is to protect their work.
Run information commands to show what would be lost (parallel: git status, git diff, ls, etc.).
Present comprehensive warning with:
For command-specific warning formats and detailed prompts:
Read `~/.claude/skills/safe-destroy/references/WARNING-FORMATS.md`
Use when: Formatting warnings for specific destructive commands (git reset, git clean, rm -rf, docker prune, etc.)
Valid confirmation examples: "yes, run git reset --hard", "proceed with deletion", "B" from menu Invalid: "ok", "do it", "sure" (too vague)
For detailed confirmation process with examples and verification steps:
Read `~/.claude/skills/safe-destroy/references/CONFIRMATION-PROCESS.md`
Use when: Handling user confirmation, verifying approval, or executing destructive commands
For safe alternative commands and recovery options:
Read `~/.claude/skills/safe-destroy/references/SAFE-ALTERNATIVES.md`
Use when: Suggesting safer alternatives (stash, commit, backup, archive) before destruction
If destructive operation was accidentally executed:
git reset --hard:# Check reflog for recent HEAD positions
git reflog
# Find the commit before reset (e.g., HEAD@{1})
git reset --hard HEAD@{1}
# Or cherry-pick specific commits
git cherry-pick <commit-hash>
git clean:No automatic recovery available.
Possibly recover from:
rm -rf:Check if system has undelete:
# macOS Time Machine
# Linux: check if trash-cli used
trash-list
# Otherwise: file recovery tools
# extundelete, testdisk, photorec, etc.
Destructive command requested
/cleanup - Safe cleanup of merged branches and artifacts with confirmationRemember: It's better to annoy the user with confirmations than to lose their work.