guard

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Full Safety Mode reduces risk when touching prod by warning about destructive commands and enforcing edit boundaries.

Core Features & Use Cases

  • Combines destructive command warnings with a directory-scoped edit boundary to prevent accidental damage.
  • Supports safe debugging and production work by restricting edits outside a defined path and warning on destructive actions.
  • Use case: deploys in a scenario where a user needs to thaw guard mode temporarily to isolate a specific directory and still get warnings.

Quick Start

Ask the user which directory should edits be restricted to, then activate guard mode.

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 bash commands during production debugging?

Preventing accidental destructive bash commands during production debugging requires combining destructive command warnings with a directory-scoped edit boundary. This approach restricts edits outside a defined path and warns on risky shell actions.

Can I restrict shell edits to a specific directory boundary?

Yes, you can restrict shell edits to a specific directory boundary by activating a safety mode. The system asks which directory edits should be restricted to, enforcing that edits outside the path are blocked.

What's the best way to warn about risky commands during deployments?

Warning about risky commands during deployments is best handled by implementing PreToolUse hooks for Bash, Read, and AskUserQuestion. These hooks intercept destructive actions before execution and issue warnings.

How do I temporarily thaw guard mode to isolate a specific directory?

To temporarily thaw guard mode for directory isolation, you reference sibling careful and freeze scripts. The freeze state is stored in the user's gstack state directory to manage the boundary scope.

Does full safety mode work with standard bash workflow security?

Yes, full safety mode works with standard bash workflow security by adding an edit boundary layer. It enhances typical workflow security by actively preventing edits outside a restricted path rather than only issuing warnings.

When should I not use edit boundaries for shell commands?

Edit boundaries for shell commands should not be used when you need unrestricted write access across the entire file system. They are designed for prod debugging and deployment scenarios where limiting scope prevents catastrophic damage.