guard

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guard mode prevents accidental destructive actions and unintended repository-wide edits by combining warnings for dangerous commands with a directory-scoped edit lock, reducing the risk of data loss or production outages.

Core Features & Use Cases

  • Destructive command warnings: Detects risky operations like rm -rf, DROP TABLE, and force-push and prompts for confirmation before running.
  • Directory-scoped edit restrictions: Restricts file edits to a user-specified directory path so changes outside the boundary are blocked.
  • Integrated hooks: Runs pre-tool hooks for Bash and edit/write operations and records a local usage event for auditability.
  • Use Case: Ideal for debugging live systems, performing high-risk maintenance, or granting temporary edit permissions during release windows.

Quick Start

Activate guard mode and set the directory to restrict edits to /path/to/allowed/dir to enable destructive-command warnings and lock edits to that path.

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 or force-push in a production repository?

Restricting file edits to a specified directory path blocks any write operations outside that boundary, ensuring changes are confined to the allowed directory during high-risk maintenance.

What is directory-scoped edit restriction for debugging live systems?

Directory-scoped edit restriction locks file modifications to a specified path, preventing unintended repository-wide edits and reducing the risk of data loss when debugging live systems.

How do I set up hooks to warn before destructive commands and lock edits to a directory?

You need sibling careful and freeze hook scripts installed, along with a gstack state file to persist the absolute freeze path, enabling pre-tool hooks for Bash and edit/write operations.

Can I restrict file edits to a specific directory during high-risk maintenance?

Yes, you can restrict file edits to a specific directory by setting an allowed path, which blocks any write operations outside that boundary during high-risk maintenance or release windows.

Do I need any specific hook scripts installed to enforce edit boundaries and warnings?

Yes, you need sibling careful and freeze hook scripts installed, along with a gstack state file to persist the absolute freeze path, enabling pre-tool hooks for Bash and edit/write operations.

When should I not use a directory-scoped edit lock for repository changes?

Avoid using directory-scoped edit locks when you need to perform broad repository-wide refactoring across multiple directories, as the boundary blocks any write operations outside the specified allowed path.