guard

Combines destructive command warnings with directory-scoped edit restrictions for safer sessions.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aicodepro/ai-agent-nexi --skill guard-aicodepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/aicodepro/ai-agent-nexi/tree/main/agent/skills/gstack/guard
Command: npx skills add https://github.com/aicodepro/ai-agent-nexi --skill guard-aicodepro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on production systems or live environments, a single destructive command (rm -rf, DROP TABLE, force-push) or an edit to the wrong file can cause serious damage. This Skill activates a combined safety mode that warns before destructive commands and blocks file edits outside a chosen directory. ## Core Features & Use Cases - Destructive Command Warnings: Inherits the /careful behavior, warning before commands like rm -rf, DROP TABLE, or force-push execute, with user override possible. - Directory-Scoped Edit Boundary: Inherits the /freeze behavior, restricting all file edits to a user-specified absolute path stored in a freeze state file. - Use Case: While debugging a live production issue, activate guard mode and restrict edits to the hotfix directory so no accidental changes are made elsewhere, while still getting warned before any risky shell command runs. ## Quick Start Ask the assistant to enable guard mode and provide the directory path that edits should be restricted to.

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 session?

Activate guard mode and provide the target directory path when prompted. The path is resolved to an absolute path, saved to a freeze-dir state file, and all edits outside that directory are blocked until you run /unfreeze.

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

Guard mode includes the /careful protection, which warns before executing destructive patterns such as rm -rf, DROP TABLE, and force-push. You can review each warning and choose to override it.

Does guard mode work without the careful and freeze skills installed?

No. Guard mode references hook scripts from the sibling /careful and /freeze skill directories, so both must be installed. They are installed together by the gstack setup script.

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

Run /unfreeze to remove the directory edit boundary while keeping the session active. To deactivate all protections entirely, end the session.

When should I use guard mode instead of careful or freeze alone?

Use guard mode when you need both protections at once, such as touching production systems or debugging live environments. Use /careful alone for command warnings only, or /freeze alone for edit scoping only.