guard

Blocks destructive bash commands and restricts file edits to a specified directory.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/TarunTeja44/portfolio --skill guard-tarunteja44
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/TarunTeja44/portfolio/tree/main/.agents/skills/gstack-guard
Command: npx skills add https://github.com/TarunTeja44/portfolio --skill guard-tarunteja44

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on production systems or debugging 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 enforces two layers of protection so risky operations are caught before they execute. ## Core Features & Use Cases - Destructive Command Warnings: PreToolUse hooks scan every Bash command for dangerous patterns like rm -rf, DROP TABLE, force-push, and git reset --hard, warning before execution. - Directory-Scoped Edit Boundary: Edit and Write operations are blocked outside a user-specified directory, enforced via a freeze state file. - Combined Safety Mode: Merges the /careful and /freeze skills into one activation for maximum protection. - Use Case: While hotfixing a production repository, activate guard mode with the boundary set to the service directory so accidental edits to infrastructure configs are blocked and any destructive shell command triggers a confirmation warning. ## Quick Start Ask the AI to activate guard mode and restrict edits to your project directory, for example: turn on guard mode and lock edits to the src folder.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I block destructive bash commands in an AI coding session?

Activate guard mode, which registers a PreToolUse hook that scans every Bash command for destructive patterns like rm -rf, DROP TABLE, force-push, and git reset --hard. Matching commands trigger a warning before execution, and you can override if intentional.

How to restrict AI file edits to a specific directory?

Guard mode asks which directory to restrict edits to, resolves it to an absolute path, and stores it in a freeze state file. Edit and Write hooks then block any file modification outside that boundary until you run /unfreeze.

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 activating guard mode?

Run /unfreeze to remove the directory edit boundary while keeping the session active. To deactivate all protections entirely, end the session, since destructive command warnings persist for the session duration.

What destructive command patterns does guard mode detect?

It detects patterns such as rm -rf, DROP TABLE, force-push, and git reset --hard, along with safe exceptions. The full pattern list is defined in the sibling /careful skill's check script.