guard

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Full safety mode combining destructive-command warnings with directory-scoped edits to prevent accidental damage when touching production or debugging live systems.

Core Features & Use Cases

  • Destructive-command warnings that prompt before executing dangerous commands (e.g., rm -rf, DROP TABLE, force-push).
  • Directory-bound edits that restrict changes to a user-specified path.
  • Combined safety coverage during maintenance, debugging, and deployments.
  • Easy activation via interactive prompts with clear status messages.

Quick Start

Ask the user which directory should be protected, then enable guard mode to apply both safety checks and edit boundaries.

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 from harming production during debugging?

Protect production during debugging by enabling guard mode, which combines destructive-command warnings for operations like rm -rf with directory-scoped edit restrictions to block accidental damage.

What is a directory freeze boundary for safe edits?

A directory freeze boundary restricts file modifications to a user-specified path, preventing accidental changes outside the boundary across shells, terminals, and automation during maintenance or deployments.

How do I restrict file edits to a specific directory during deployment?

Restrict file edits to a specific directory during deployment by enabling guard mode, which enforces directory-bound edits through Edit and Write hooks to confine changes to a protected path.

Does guard mode work across different shells and automation terminals?

Guard mode works across different shells, terminals, and automation by implementing PreToolUse hooks for Bash and Edit/Write hooks to detect dangerous commands and enforce the freeze boundary.

Can I get warnings before executing dangerous commands like DROP TABLE or force-push?

You can get warnings before executing dangerous commands like DROP TABLE or force-push by enabling guard mode, which prompts for confirmation before allowing destructive operations to proceed.