guard
Full safety mode: destructive command warnings + directory-scoped edits. Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with /freeze (blocks edits outside a specified directory). Use for maximum safety when touching prod or debugging live systems. Use when asked to "guard mode", "full safety", "lock it down", or "maximum safety".
Security Assessment
Detected risks:
About guard
The 'guard' skill provides a comprehensive safety mechanism for managing potentially destructive operations and restricting file edits within a defined directory. By combining the functionalities of the '/careful' and '/freeze' skills, it ensures that commands which could delete critical data or modify production systems are intercepted and that edits are only applied within a user-specified directory. This reduces the risk of accidental system damage, data loss, or unintended changes, making it especially valuable when working on live systems or sensitive environments.
Key features of 'guard' include destructive command warnings and directory-scoped edit restrictions. The destructive command warnings alert users before executing high-risk commands such as 'rm -rf', 'DROP TABLE', 'force-push', or 'git reset --hard', allowing users to review and confirm actions before proceeding. The directory-scoped edit restriction enforces a boundary by only permitting file modifications within a specified directory, effectively preventing unintended edits outside the designated workspace. These protections are activated simultaneously, providing a robust layer of safety for development and operations workflows. Additionally, usage analytics are optionally logged locally to track skill activation.
'Guard' is ideal for developers, system administrators, and DevOps engineers who frequently interact with production environments or perform sensitive file operations. It is particularly useful when debugging live systems, handling critical infrastructure, or performing tasks where accidental destructive actions could have significant consequences. By offering both warnings for risky commands and strict directory boundaries, 'guard' helps users work confidently and securely, making it a recommended tool for anyone seeking maximum operational safety in command-line and code editing activities.
FAQ
How do I activate guard mode?
You can activate guard mode by invoking the skill, which combines destructive command warnings and directory-scoped edit restrictions. You will be prompted to specify a directory to restrict edits to, and the protections will then be enabled.
Which commands are monitored by guard?
Guard monitors potentially destructive commands such as 'rm -rf', 'DROP TABLE', 'force-push', and 'git reset --hard'. Warnings are displayed before execution, allowing you to confirm or override the command.
Can I edit files outside the restricted directory?
No. Once guard mode is active, edits are limited to the directory you specified. Any attempt to edit files outside this boundary will be blocked. You can remove the restriction by running '/unfreeze'.
Are there any dependencies required for guard?
Yes. Guard relies on the hook scripts from the sibling '/careful' and '/freeze' skills, which must be installed. Typically, these are installed together via the gstack setup script.
Who should use guard mode?
Guard is designed for developers, system administrators, and DevOps engineers who work with live systems or critical data. It is particularly useful for debugging production environments safely and preventing accidental destructive operations.
Install guard
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
garrytan/gstack