guard

Warn on destructive shell and Git commands while restricting file edits to a directory.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents accidental destructive operations and unauthorized edits by combining destructive-command warnings with directory-scoped edit restrictions so teams can safely work on production or sensitive code paths.

Core Features & Use Cases

  • Destructive command warnings: Warns before running rm -rf, DROP TABLE, force-pushes, and other high-risk operations.
  • Directory-scoped edits (freeze): Restricts file modifications to a single user-specified directory boundary to avoid touching unrelated parts of a repository or system.
  • Combined protection: Ideal for deployments, live debugging, or when multiple contributors operate on critical systems and you need an extra safety layer.

Quick Start

Enable guard mode and set the directory path to restrict edits when prompted.

Frequently Asked Questions about guard

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

FAQPage Schema
How do I block destructive git commands like force-push and rm -rf in a shared repository?

You can block destructive git commands by enabling pre-tool hooks that scan shell operations for high-risk patterns like `rm -rf` or force-pushes, triggering warnings before execution to prevent accidental data loss.

How do I restrict file edits to a specific directory during live production debugging?

Restrict file edits to a specific directory by configuring a freeze boundary stored in a local state file. The system verifies this boundary before allowing modifications, isolating changes during live debugging.

What are git hooks and how do they prevent accidental destructive shell operations?

Git hooks are pre-tool scripts that intercept and check for destructive shell operations. They run automatically before commands execute, warning you and preventing accidental high-risk operations like `DROP TABLE`.

Do I need specific hook scripts to enforce a directory-scoped edit freeze?

Yes, enforcing a directory-scoped edit freeze requires both the careful and freeze hook scripts to be present. These scripts execute pre-tool checks and verify the stored freeze boundary before allowing modifications.

Can I combine destructive command warnings with directory-scoped edit restrictions?

Yes, combining destructive command warnings with directory-scoped edit restrictions provides dual protection. This integrated approach is ideal for deployments where multiple contributors operate on critical systems.