Full safety mode for risky work — warns before destructive commands (rm -rf, DROP TABLE, force-push) via a PreToolUse hook and restricts file edits to a chosen directory boundary. Combines /careful and /freeze.
---
name: guard
description: "Full safety mode: destructive-command warnings plus directory-scoped edits. Use when touching prod or debugging live systems, or when asked for guard mode, full safety, lock it down, or maximum safety. Part of gstack; depends on sibling /careful and /freeze skills."
---
Maximum-safety mode that combines destructive-command warnings (/careful) with a directory edit boundary (/freeze) via PreToolUse hooks.
## How to use
1. On activation, ask the user (text input) which directory to restrict edits to — destructive-command warnings are always on.
2. Resolve the path to absolute, ensure a trailing slash, and write it to the gstack freeze state file (`$GSTACK_STATE_ROOT/freeze-dir.txt`).
3. The PreToolUse Bash hook (`check-careful.sh`) warns before patterns like `rm -rf`, `DROP TABLE`, and force-push; the user can override.
4. The PreToolUse Edit/Write hook (`check-freeze.sh`) blocks any edit to files outside the chosen directory.
5. Confirm both protections to the user; `/unfreeze` removes the edit boundary, and ending the session deactivates everything.
Note: requires the sibling /careful and /freeze skills (installed together by gstack setup).
Full skill & source: https://github.com/garrytan/gstack/tree/a861c00cfac6e2376d26c7d3ba5207cdc5aefc49/guardSign in to rate and review this skill.
No reviews yet. Be the first to review this skill.