Activates destructive command warnings and directory-scoped edit restrictions to safely modify production code or debug live systems.
Install
mkdir -p .claude/skills/guard && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17933" && unzip -o skill.zip -d .claude/skills/guard && rm skill.zipInstalls to .claude/skills/guard
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Full safety mode: destructive command warnings + directory-scoped edits. Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with /freeze (blocks edits outside a specified directory). Use for maximum safety when touching prod or debugging live systems. Use when asked to "guard mode", "full safety", "lock it down", or "maximum safety". (gstack)Key capabilities
- →Warn before executing destructive commands
- →Restrict file edits to a specified directory
- →Combine `/careful` and `/freeze` functionalities
- →Resolve user-provided directory paths to absolute paths
- →Provide user feedback on active protections
How it works
This skill activates a full safety mode by combining destructive command warnings and directory-scoped edit restrictions, asking the user for the directory to restrict edits to and then configuring the system accordingly.
Inputs & outputs
When to use guard
- →Running commands on production databases
- →Debugging live infrastructure systems
- →Restricting AI file edits to specific project folders
- →Preventing accidental force-pushes or data deletion
About this skill
/guard — Full Safety Mode
Activates both destructive command warnings and directory-scoped edit restrictions.
This is the combination of /careful + /freeze in a single command.
Dependency note: This skill references hook scripts from the sibling /careful
and /freeze skill directories. Both must be installed (they are installed together
by the gstack setup script).
mkdir -p ~/.gstack/analytics
echo '{"skill":"guard","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
Setup
Ask the user which directory to restrict edits to. Use AskUserQuestion:
- Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
- Text input (not multiple choice) — the user types a path.
Once the user provides a directory path:
- Resolve it to an absolute path:
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
echo "$FREEZE_DIR"
- Ensure trailing slash and save to the freeze state file:
FREEZE_DIR="${FREEZE_DIR%/}/"
STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.gstack}"
mkdir -p "$STATE_DIR"
echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
echo "Freeze boundary set: $FREEZE_DIR"
Tell the user:
- "Guard mode active. Two protections are now running:"
- "1. Destructive command warnings — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
- "2. Edit boundary — file edits restricted to
<path>/. Edits outside this directory are blocked." - "To remove the edit boundary, run
/unfreeze. To deactivate everything, end the session."
What's protected
See /careful for the full list of destructive command patterns and safe exceptions.
See /freeze for how edit boundary enforcement works.
When not to use it
- →When full safety mode is not required
- →When only destructive command warnings are needed
- →When only directory-scoped edits are needed
Prerequisites
Limitations
- →Requires user input for the directory to restrict edits to
- →Relies on the `/careful` and `/freeze` skills for core functionality
- →Deactivation requires ending the session or running `/unfreeze`
How it compares
This skill integrates two distinct safety mechanisms into a single, user-configurable mode, offering a consolidated approach to preventing accidental data loss or unauthorized modifications compared to activating each protection separately.
Compared to similar skills
guard side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| guard (this skill) | 0 | 3mo | Review | Beginner |
| 1password | 27 | 2mo | Review | Intermediate |
| senior-security | 31 | 7mo | Review | Advanced |
| fix-dependabot-alerts | 18 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
1password
openclaw
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.
senior-security
davila7
Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.
fix-dependabot-alerts
microsoft
Fix Dependabot security alerts by updating vulnerable npm dependencies. Use when the user mentions "dependabot", "security alerts", "vulnerability", "CVE", or wants to update packages with security issues.
red-team-tools-and-methodology
davila7
This skill should be used when the user asks to "follow red team methodology", "perform bug bounty hunting", "automate reconnaissance", "hunt for XSS vulnerabilities", "enumerate subdomains", or needs security researcher techniques and tool configurations from top bug bounty hunters.
wsdiscovery
BrownFineSecurity
WS-Discovery protocol scanner for discovering and enumerating ONVIF cameras and IoT devices on the network. Use when you need to discover ONVIF devices, cameras, or WS-Discovery enabled equipment on a network.
trivy-offline-vulnerability-scanning
benchflow-ai
Use Trivy vulnerability scanner in offline mode to discover security vulnerabilities in dependency files. This skill covers setting up offline scanning, executing Trivy against package lock files, and generating JSON vulnerability reports without requiring internet access.