guard

Warn before destructive commands and restrict file edits to a specified directory.

Updated May 11, 2026
One-click install
npx skills add https://github.com/cloudofgeorge/AI-hands --skill guard-cloudofgeorge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/cloudofgeorge/AI-hands/tree/main/skills/gstack/guard
Command: npx skills add https://github.com/cloudofgeorge/AI-hands --skill guard-cloudofgeorge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents accidental destructive commands and unbounded file edits by enforcing a dual safety posture: destructive-command warnings and directory-bound edits.

Core Features & Use Cases

  • Destructive-command warnings: prompts before executing dangerous operations like rm -rf or force-push.
  • Edit boundary enforcement: restricts edits to a user-specified directory, blocking changes outside it.
  • Quick activation: enables both protections through a single command for use during high-risk tasks such as prod debugging or sensitive deployments.

Quick Start

Run the guard command to enable both protections in your current workflow.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I prevent accidental destructive commands during production debugging?

You can prevent accidental destructive commands by enabling a guard tool that warns before executing dangerous shell operations like rm -rf or force-push. It enforces a dual safety posture by also restricting file edits to a specific directory during high-risk tasks.

How do I restrict file edits to a specific directory in my workflow?

To restrict file edits to a specific directory, you can use a tool that enforces edit boundaries by blocking any unintended changes outside the user-specified path. This ensures modifications remain safely contained within your defined boundary.

Do I need other tools to enable workflow protection for shell sessions?

Yes, enabling workflow protection for shell sessions requires integration with sibling tools like careful and freeze. Guard uses Bash hooks to trigger pre-use checks and provides a single command to activate both protections.

What's the best way to block dangerous shell commands without disabling the entire workflow?

The best way to block dangerous shell commands without stopping your workflow is to apply warnings rather than executing them outright. Guard intercepts destructive operations via Bash hooks, prompting you before any dangerous action proceeds.

When should I use an edit boundary in software engineering?

You should use an edit boundary during high-risk tasks such as sensitive deployments or production debugging. Enforcing directory-bound edits prevents unintended file modifications outside the target directory, keeping critical system files safe from accidental changes.