guard

Activates destructive command warnings and directory-scoped edit restrictions for safer sessions.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/raghavbadhwar/rstack --skill guard-raghavbadhwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/raghavbadhwar/rstack/tree/main/guard
Command: npx skills add https://github.com/raghavbadhwar/rstack --skill guard-raghavbadhwar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on production systems or debugging live environments, a single accidental command like rm -rf or an edit to the wrong file can cause serious damage. This Skill combines two safety layers so destructive commands trigger warnings and file edits are confined to a directory you choose. ## Core Features & Use Cases - Destructive Command Warnings: Intercepts dangerous Bash commands such as rm -rf, DROP TABLE, and force-push, warning you before execution with the option to override. - Directory-Scoped Edit Boundary: Blocks Edit and Write operations outside a user-specified directory, enforced through PreToolUse hooks. - Use Case: You are hotfixing a bug in a live deployment's config directory. Activate guard mode, restrict edits to that config path, and any accidental edit attempt elsewhere is blocked while risky shell commands prompt for confirmation. ## Quick Start Ask the AI to activate guard mode and restrict edits to a specific directory such as your project's src folder.

Frequently Asked Questions about guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict file edits to a specific directory in a coding session?

Activate guard mode and provide a directory path when prompted. The skill resolves it to an absolute path, saves it to a freeze state file, and PreToolUse hooks then block Edit and Write operations outside that boundary.

How do I get warnings before running destructive commands like rm -rf?

Guard mode registers a PreToolUse hook on Bash that checks commands against destructive patterns such as rm -rf, DROP TABLE, and force-push. Matching commands trigger a warning before execution, and you can choose to override.

Does guard mode require other skills to be installed?

Yes. Guard depends on hook scripts from the sibling careful and freeze skill directories. Both are installed together by the gstack setup script, so a standard installation satisfies this dependency.

How do I turn off the edit boundary after activating guard mode?

Run the /unfreeze command to remove the directory edit boundary. Destructive command warnings remain active for the session; ending the session deactivates everything.

When should I not use guard mode?

Avoid guard mode for routine local development where edits span many directories, since the boundary blocks legitimate changes outside the chosen path. It is intended for high-risk contexts like production or live system work.