guard

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guard mode provides dual protections for high-risk operations by emitting warnings for destructive commands and enforcing an edit boundary that confines changes to a user-specified directory. This reduces risk of accidental data loss and unauthorized modifications during live prod work or debugging.

Core Features & Use Cases

  • Destructive command warnings: Intercepts dangerous commands (like rm -rf, DROP TABLE, force-push) and prompts before execution.
  • Directory-bound edits: Blocks edits outside a configured path, enabling safe collaboration on production systems.
  • Sane defaults and recovery: Works with the companion /careful and /freeze skills to provide layered safety without blocking routine tasks in safe contexts.

Quick Start

Ask the user which directory should be protected and then enable guard mode to activate both protections immediately.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I prevent destructive commands like rm -rf or force-push from running accidentally during production work?

To prevent destructive commands during production work, the guard mechanism intercepts dangerous commands like rm -rf, DROP TABLE, and force-push, prompting for confirmation before execution. This reduces accidental data loss by enforcing a manual review step for high-risk operations.

Can I restrict file edits to a specific directory boundary during debugging sessions?

Yes, you can restrict file edits to a specific directory boundary by configuring a protected path. The guard enforces this boundary by blocking any modifications attempted outside the user-specified directory, ensuring debugging sessions do not trigger unauthorized changes elsewhere.

Do I need any other components to enable directory-scoped edit boundaries and destructive command warnings?

Yes, enabling directory-scoped edit boundaries and destructive command warnings requires the accompanying careful and freeze components. These must be installed and wired via pre-tool hooks to provide layered safety and activate the full protection mechanism during sessions.

What is the best way to protect a production system from unauthorized modifications when collaborating?

The best way to protect a production system from unauthorized modifications is enforcing a strict directory-bound edit boundary. This confines all changes to a user-specified path, ensuring safe collaboration by blocking edits and destructive commands outside the protected scope.

Why does guard mode not block routine tasks in safe contexts despite enforcing production protection?

Guard mode does not block routine tasks in safe contexts because it applies sane defaults and recovery mechanisms. By integrating with companion components, it provides layered safety that targets only destructive commands and out-of-bound edits without interfering with standard operations.