guard-mode

Warn on destructive commands and optionally freeze edits to a directory.

15|5|Updated May 17, 2026
One-click install
npx skills add https://github.com/cropsgg/skills --skill guard-mode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guard-mode
Source: https://github.com/cropsgg/skills/tree/main/skills/productivity/guard-mode
Command: npx skills add https://github.com/cropsgg/skills --skill guard-mode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safety mode: warn on destructive commands and optionally restrict edits to one directory to prevent catastrophic changes in shared repos.

Core Features & Use Cases

  • Warn before destroy: rm -rf, DROP TABLE, force-push, hard reset, kubectl delete, etc.
  • Freeze optional: when a directory is provided, block edits outside it for the session.
  • Override with confirmation: explicit user consent required to proceed.
  • Git safety: warn before force-push to main, and before --no-verify or amend, with guidance to revert when possible.

Quick Start

Activate guard mode and test a destructive command to verify warnings and edit boundaries.

Frequently Asked Questions about guard-mode

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

FAQPage Schema
How do I prevent accidental destructive commands like rm -rf or DROP TABLE in a shared repository?

To prevent destructive commands in a shared repository, you need a safety mode that warns before executing actions like rm -rf or DROP TABLE. This skill intercepts these operations and requires explicit user confirmation to proceed.

Can I lock edits to a specific directory boundary during a production debugging session?

Yes, you can lock edits to a specific directory by providing a directory path. The session will then block any file modifications outside that specified directory boundary to prevent catastrophic changes.

How do I add warnings before force-pushing to main or using git amend?

To add git safety warnings before force-pushing to main or using amend, you need a guard mode that detects these operations. It warns you and provides guidance on how to revert the changes when possible.

What is the best way to ensure explicit warnings and override prompts for critical operations?

The best way to ensure explicit warnings and override prompts is to activate a guard mode that monitors session commands. It halts destructive actions and requires explicit user consent before proceeding.

Does guard mode provide session deactivation controls for directory boundaries?

Yes, guard mode provides session deactivation controls and enforces directory boundaries. You can restrict edits to one directory and override the freeze with confirmation prompts when critical operations are needed.

When should I not use directory freeze for git safety?

You should not use directory freeze when you need to perform widespread edits across multiple directories in a session. It blocks edits outside the specified directory, requiring manual override prompts for each external change.