guard

Warn before destructive commands and restrict edits to a specified directory.

1|Updated May 8, 2026
One-click install
npx skills add https://github.com/npc-chris/dfn-discovery --skill guard-npc-chris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/npc-chris/dfn-discovery/tree/main/.agents/skills/gstack/guard
Command: npx skills add https://github.com/npc-chris/dfn-discovery --skill guard-npc-chris

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The Skill provides comprehensive safeguards for systems by offering destructive command warnings and directory-scoped edit restrictions, helping prevent unintended damage or unauthorized changes.

Core Features & Use Cases

  • Destructive Command Warnings: Alerts users before executing commands that can cause irreversible changes (e.g., rm -rf, DROP TABLE).
  • Directory-Scope Edit Restrictions: Blocks editing of files outside a specified directory to ensure focused changes.
  • Use Case: Ideal for protecting production systems during debugging or while applying updates, reducing the risk of catastrophic failures.

Quick Start

Set guard mode and restrict edits to '/var/myapp' to prevent accidental system modifications: Run 'guard /var/myapp'

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 from running in a production environment?

To prevent destructive commands in a production environment, you need safety validation scripts that intercept and warn before executing commands causing irreversible changes. This system safety mechanism alerts users before operations like rm -rf or DROP TABLE execute.

Can I restrict file edits to a specific directory to protect production systems?

Yes, you can restrict file edits to a specific directory using custom hooks that block modifications outside the designated path. This directory restriction ensures focused changes and protects production systems from unintended damage during debugging or updates.

What is the best way to warn users before executing irreversible shell commands?

The best way to warn users before executing irreversible shell commands is implementing command validation scripts that detect destructive operations and prompt alerts. This system safety approach intercepts commands to prevent catastrophic system failures and data loss.

Does command validation work for both file system operations and database queries?

Command validation works for both file system operations and database queries by identifying destructive patterns across different command types. The validation scripts recognize operations like rm -rf for files and DROP TABLE for databases to warn before execution.

How do I set up directory-scoped edit restrictions for debugging sessions?

To set up directory-scoped edit restrictions for debugging sessions, run the guard command with your target directory path as the argument. This activates custom hooks that block any file modifications outside the specified directory scope.