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.zip

Installs 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)
363 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

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

You give it
A user-provided directory path for edit restrictions
You get back
Activation of destructive command warnings and file edit restrictions to the specified directory

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

<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->

/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:

  1. Resolve it to an absolute path:
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
echo "$FREEZE_DIR"
  1. 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

The `/careful` skillThe `/freeze` skill

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.

SkillInstallsUpdatedSafetyDifficulty
guard (this skill)03moReviewBeginner
1password272moReviewIntermediate
senior-security317moReviewAdvanced
fix-dependabot-alerts185moReviewIntermediate

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.

2799

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.

3191

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.

1872

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.

759

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.

16

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.

14

Search skills

Search the agent skills registry