guard

Block destructive Bash commands and file edits outside a directory boundary.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents accidental execution of destructive shell commands and blocks file edits outside a designated safe directory, protecting production environments and live systems.

Core Features & Use Cases

  • Destructive command warnings: Intercepts risky Bash commands like rm -rf, DROP TABLE, and force‑pushes, prompting the user before execution.
  • Directory‑scoped edit restriction: Limits file modifications to a user‑specified path, blocking changes elsewhere.
  • Combined activation: Enables both safeguards with a single guard mode, ideal for debugging live services or handling critical deployments.

Quick Start

Run /guard to enable full safety mode and set the edit restriction directory.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I prevent accidental execution of destructive bash commands in production?

To prevent destructive bash commands in production, you can enforce pre-execution checks that intercept risky commands like `rm -rf` or `DROP TABLE` and prompt for user confirmation before allowing execution.

How can I restrict file edits to a specific directory scope?

You can restrict file edits to a specific directory scope by setting a designated safe path in a state file, which acts as an edit boundary to block unauthorized modifications elsewhere on the system.

What is guard mode for shell commands and file editing?

Guard mode is a combined safety feature that simultaneously intercepts destructive shell commands and enforces directory-scoped file edit restrictions, ideal for debugging live services or handling critical deployments.

How do I enable both destructive command warnings and edit restrictions at the same time?

You can enable both destructive command warnings and edit restrictions simultaneously by activating a full safety mode, which applies pre-execution checks and sets the edit restriction directory in one step.

Does this safety mechanism require any external dependencies to intercept force-pushes?

No external dependencies are required to intercept force-pushes or other risky commands; the safety mechanism relies entirely on internal Bash scripts and a state file for enforcing pre-execution checks.