Guard

Warn before destructive commands and block edits outside a specified directory.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/aporto-tech/aporto-agent-skills --skill guard-aporto-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Guard
Source: https://github.com/aporto-tech/aporto-agent-skills/tree/main/skills/gstack/guard
Command: npx skills add https://github.com/aporto-tech/aporto-agent-skills --skill guard-aporto-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Bash, and includes scripts (resource) components.

What problem does it solve?

The Guard Skill addresses the challenge of safely working with production systems or during live debugging by providing warnings for destructive commands and blocking edits outside a specified directory.

Core Features & Use Cases

  • Destructive Command Warnings: Warns before executing commands like rm -rf, DROP TABLE, and force-push.
  • Directory-Scope Edits: Blocks edits outside a specified directory to protect the integrity of production data.
  • Use Case: When you need to work in a high-risk environment like a production server or during critical debugging sessions.

Quick Start

Activate guard mode and specify the directory to restrict edits to: run 'guard mode /path/to/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 destructive commands like rm -rf during production debugging?

To prevent destructive commands during production debugging, you need safety mechanisms that validate command execution and block edits outside a specified directory. Guard provides warnings for high-risk commands like rm -rf, DROP TABLE, and force-push.

Can I restrict file edits to a specific directory on a production server?

Yes, you can restrict file edits to a specific directory on a production server using directory-scoped edit blocking. Guard enforces this by validating commands against a specified path and blocking modifications outside those boundaries.

Do I need Bash to run directory protection and command warning scripts?

Yes, Bash is required to run directory protection and command warning scripts. Guard uses Bash hook scripts to perform command validation and enforce edit restrictions within your specified directory.

What is the best way to warn against force-push and DROP TABLE in engineering workflows?

The best way to warn against force-push and DROP TABLE in engineering workflows is using a command validation system that intercepts destructive actions. Guard triggers comprehensive warnings before executing these high-risk commands.

Are there limitations when using command warnings for live system modifications?

Limitations when using command warnings for live system modifications include the need to explicitly activate guard mode and define the target directory. Guard only enforces directory-scoped edits and command validation when this boundary is actively configured.

How do I activate guard mode to protect a specific directory in production?

To activate guard mode and protect a specific directory in production, run the command 'guard mode /path/to/directory'. This immediately enables command warnings and restricts file edits to the specified path.