guard

Detect destructive commands and restrict file edits to a specified directory.

Updated Jul 21, 2025
One-click install
npx skills add https://github.com/robertzengcn/aiFetchly --skill guard-robertzengcn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard
Source: https://github.com/robertzengcn/aiFetchly/tree/main/.agents/skills/gstack/guard
Command: npx skills add https://github.com/robertzengcn/aiFetchly --skill guard-robertzengcn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of accidental destructive changes and out-of-scope file edits when working on production environments, live systems, or sensitive project directories, preventing costly outages or data loss from unintended actions.

Core Features & Use Cases

  • Destructive command warnings: Alerts you before executing dangerous commands like rm -rf, DROP TABLE, or force-push, with the option to override if the action is intentional.
  • Directory-scoped edit restrictions: Blocks all file edits outside a user-specified directory, so you can never accidentally modify unrelated files outside your intended work scope.
  • Use Case: When debugging a live production server, activate guard mode and set the edit boundary to your app's config directory to avoid accidentally deleting critical system files or editing unrelated code, while still getting warnings for any risky commands you intentionally run.

Quick Start

Activate guard mode and set the edit boundary to your project's /config directory to block all out-of-scope edits and receive warnings before any destructive commands run.

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

You can prevent accidental destructive commands in production by activating guard mode, which detects dangerous patterns like rm -rf or DROP TABLE and alerts you before execution. You retain the option to intentionally override the warning if the action is required.

How do I restrict file edits to a specific directory scope when debugging live systems?

You can restrict file edits to a specific directory scope by setting a configurable edit boundary before debugging live systems. This blocks all file modifications outside your specified directory, preventing unintended changes to unrelated sensitive files.

What is directory-scoped edit restriction and how does it protect sensitive project directories?

Directory-scoped edit restriction is a safety mechanism that blocks all file edits outside a user-specified boundary. It protects sensitive project directories by ensuring that any accidental out-of-scope modifications are actively prevented during infrastructure management.

Can I override a destructive command warning if the action is intentional?

Yes, you can override a destructive command warning if the action is intentional. The guard mechanism alerts you before executing dangerous commands, but it allows authorized overrides to ensure legitimate operational tasks are not blocked during production work.

Does this CLI safety tool work without additional dependencies or components?

Yes, this CLI safety tool works without additional dependencies or components. It operates independently to combine destructive command pattern detection with directory-scoped edit restrictions, enforcing operational safety directly within your existing workflow.

When should I use guard mode for production safety?

You should use guard mode for production safety when debugging live services, managing production infrastructure, or editing sensitive project directories. It enforces maximum operational safety by preventing outages or data loss from unintended modifications.