guard

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

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/mgher668/surf-ai --skill guard-mgher668
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/mgher668/surf-ai/tree/main/.agents/skills/gstack/guard
Command: npx skills add https://github.com/mgher668/surf-ai --skill guard-mgher668

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents destructive actions and unintended edits by combining destructive-command warnings with directory-based edit protections.

Core Features & Use Cases

  • Destructive-command warnings: alerts users before executing dangerous commands like rm -rf or force-push.
  • Edit-boundary enforcement: restricts edits to a user-specified directory to prevent accidental changes elsewhere.
  • Use Case: teams protecting production configurations while debugging locally.

Quick Start

Activate guard mode to enable destructive-command warnings and directory-based edit restrictions.

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 like rm -rf during production debugging?

Guard mode prevents accidental destructive commands by activating pre-tool hooks that warn users before executing dangerous shell commands like rm -rf or force-push. It runs cross-skill checks to intercept these actions during development and production safety workflows.

What are edit boundaries and how do they protect critical codebase files?

Edit boundaries are directory-scoped restrictions that prevent unintended file modifications outside a user-specified path. Guard mode enforces these boundaries to ensure accidental changes cannot occur elsewhere in codebases or configuration repositories.

How do I set up directory-scoped edit restrictions for a configuration repository?

Activate guard mode to enable directory-scoped edit restrictions for your configuration repository. You must specify the target directory to restrict edits, preventing accidental changes to critical files outside that boundary during local debugging.

Do I need the careful and freeze skills to use guard mode?

Yes, you need the sibling careful and freeze skills installed to use guard mode. Guard implements its destructive-command warnings and edit-boundary enforcement via pre-tool hooks that require these dependencies to run cross-skill checks.

Can I use guard mode to protect production configurations while debugging locally?

Yes, you can use guard mode to protect production configurations while debugging locally. It combines destructive-command warnings with directory-based edit protections specifically designed for teams safeguarding critical files in production environments.

What are the limitations of relying solely on directory-based edit protections for safety?

Directory-based edit protections rely on pre-tool hooks and require the sibling careful and freeze skills to function. If these dependencies are missing or bypassed, guard mode cannot enforce its destructive-command warnings or edit boundaries.