guard

Warn on destructive commands and enforce edits within a specified directory.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/zhifengzhang-sz/divine-book --skill guard-zhifengzhang-sz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/zhifengzhang-sz/divine-book/tree/main/.claude/skills/gstack/guard
Command: npx skills add https://github.com/zhifengzhang-sz/divine-book --skill guard-zhifengzhang-sz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Full safety mode combines destructive command warnings with directory-scoped edit restrictions to prevent dangerous operations in production environments and live systems.

Core Features & Use Cases

  • Destructive-command warnings during risky operations (rm -rf, DROP TABLE, force-push, etc.) to alert and prevent accidental execution.
  • Directory-boundary enforcement: edits are allowed only within a user-specified path.
  • Dependency integration with sibling utilities /careful and /freeze to compose robust safety workflows.
  • Guided setup: prompts the user for a restricted directory and saves the boundary state for ongoing enforcement.

Quick Start

Activate guard mode by specifying the directory to restrict edits to, so destructive commands trigger warnings and edits are blocked outside 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 destructive commands like rm -rf or DROP TABLE from running in production environments?

A safety guard prevents destructive commands like rm -rf or DROP TABLE by intercepting risky operations and issuing warnings before execution. This Skill combines command warnings with directory-scoped edit restrictions to block dangerous operations in live production systems.

Can I restrict file edits to a specific directory path during live system maintenance?

Yes, you can restrict file edits to a specific directory path. This Skill enforces directory boundaries by prompting you for a target path, storing the boundary state, and blocking any edit attempts that occur outside the specified directory.

What is directory-scoped edit enforcement and how does it protect production systems?

Directory-scoped edit enforcement is a boundary control mechanism that limits file modifications to a user-specified path. It protects production systems by blocking accidental edits outside the designated directory, keeping maintenance and deployment tasks safely isolated.

Does this safety guard work for incident response on live deployments?

Yes, this safety guard works for incident response on live deployments. It is designed for production environments where boundary controls are critical, applying destructive-command warnings and edit restrictions during maintenance, deployments, and incident response.

What's the best way to set up dual safety guards for destructive commands and edit boundaries?

The best way to set up dual safety guards is to compose them from sibling utilities. This Skill implements dual guards by integrating the /careful utility for destructive-command warnings and the /freeze utility for directory-boundary enforcement, guided by an interactive setup prompt.

Why do I need boundary controls when running deployments in production environments?

You need boundary controls during production deployments to prevent catastrophic data loss and system instability. Without dual guards for destructive commands and edit restrictions, accidental force-pushes or unauthorized file modifications can easily disrupt live systems.