Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze…
Pins this version in aipm.package.json and aipm-lock.json.
aipm add @affaan-m/safety-guard@1.0.0
Without project tracking
Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.
aipm add @affaan-m/safety-guard@1.0.0 --no-init
How to use
Install the skill above, then run this in your AI tool:
/safety-guard <your description>
About
## When to Use
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both. Advisory: the agent appl...
Skill instructions
Safety Guard — Prevent Destructive Operations
When to Use
When working on production systems
When agents are running autonomously (full-auto mode)
When you want to restrict edits to a specific directory
During sensitive operations (migrations, deploys, data changes)
How It Works
Three modes of protection. They are instructions the agent follows, not enforced blocks (see Enforcement).
Mode 1: Careful Mode
Before it runs a destructive command, the agent stops and warns:
code
Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify
When detected: shows what the command does, asks for confirmation, suggests safer alternative.
Mode 2: Freeze Mode
Locks file edits to a specific directory tree, for example: "freeze edits to src/components/".
The agent does not Write/Edit outside src/components/, and explains why when a change would need it. Useful when you want an agent to focus on one area without touching unrelated code.
Mode 3: Guard Mode (Careful + Freeze combined)
Both protections active, for example: "guard mode, write only to src/api/, read anything".
The agent can read anything but only writes to src/api/, and asks before any destructive command.
Unlock
Tell the agent to stop applying the rules.
Enforcement
This skill is advisory. ECC ships no /safety-guard command and no hook for it, so nothing blocks a tool call that breaks these rules. For blocking that does not depend on the agent, use Claude Code permission deny rules (for example Bash(rm -rf *)) or a PreToolUse hook.
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/affaan-m/safety-guard/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@affaan-m/safety-guard@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard combines both. Advisory: the agent appl...
Preview a UI component mockup in a local browser canvas where the human directly edits it (move, resize, edit text, delete, restyle), switches mobile/desktop/custom viewports, tests it, chats with you, and clicks Save and Finish. You the...
Run aipm add @affaan-m/safety-guard@1.0.0 in a project that has AIPM initialized.
Supported tools
@affaan-m/safety-guard@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.