guard

Warn before destructive commands and restrict file edits to a chosen directory.

1|Updated May 5, 2026
One-click install
npx skills add https://github.com/yashs33244/my-mac-claude --skill guard-yashs33244
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/yashs33244/my-mac-claude/tree/main/skills/gstack/guard
Command: npx skills add https://github.com/yashs33244/my-mac-claude --skill guard-yashs33244

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guard mode prevents accidental high-impact mistakes by warning before running destructive operations and blocking file edits outside a chosen directory, which reduces risk during production changes and live debugging.

Core Features & Use Cases

  • Destructive command warnings (careful layer): Warns before commands like rm -rf, dangerous SQL patterns, and risky git operations to help you catch harmful actions early.
  • Directory-scoped edit boundary (freeze layer): Restricts “Edit” and “Write” actions so modifications only occur within a directory you select.
  • Combined “maximum safety” workflow (guard layer): Uses both protections together to enforce a consistent safety posture when you need guardrails, not just reminders.

Quick Start

Ask the skill which directory should be allowed for edits by responding to the prompt with the path you want to restrict modifications to.

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

You can prevent accidental destructive commands during production debugging by enabling safety guardrails that warn before executing risky Bash patterns like `rm -rf` or dangerous SQL operations. This adds a command-level caution layer to catch harmful actions early.

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

To restrict file edits to a specific directory during risky refactors, you need to enable a freeze boundary. This restricts Edit and Write operations so modifications only occur within the directory path you select, preventing out-of-scope file changes.

What are guardrails for safe live debugging and how do they work?

Guardrails for safe live debugging work by combining destructive command warnings with directory-scoped edit boundaries. They require pre-tool hooks to run checks before executing Bash destructive patterns or permitting Edit and Write operations, enforcing a consistent safety posture.

Do I need pre-tool hooks to block destructive git operations and filesystem edits?

Yes, you need pre-tool hooks to block destructive git operations and filesystem edits. The system requires hooks that run check-careful and check-freeze checks before executing destructive Bash patterns and before permitting any Edit or Write operations.

What is the best way to enforce a maximum safety workflow for production troubleshooting?

The best way to enforce a maximum safety workflow for production troubleshooting is to combine both destructive command warnings and edit boundaries. This guard layer applies guardrails rather than just reminders, ensuring modifications and commands are carefully checked.