Skip to content
Skills Library
AI & agents · Automation

guard

/guard

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory. Use when working on critical systems or when you want extra protection.

Repository
ultraship ↗
Licence
MIT
Last repository change
08.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory. Use when working on critical systems or when you want extra protection.

Arguments

/guard <directory-to-protect>
Original author description

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory. Use when working on critical systems or when you want extra protection.

How it works

  1. What Guard Blocks
  2. How It Works
  3. Usage
  4. Integration with Other Skills
  5. Key Principles
Original SKILL.md headings · 79 lines, 437 words
SKILL.md preview
---
name: guard
description: Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory. Use when working on critical systems or when you want extra protection.
argument-hint: "<directory-to-protect>"
allowed-tools: Bash, Read
---

# Guard — Safety Guardrails

Guard protects you from accidental destructive actions by intercepting dangerous commands before they execute. It uses Claude Code's PreToolUse hooks to catch risky patterns in real-time.

**Announce at start:** "I'm activating Guard — destructive commands will be blocked until you explicitly approve them."

## What Guard Blocks

### Destructive Bash Commands
- `rm -rf` / `rm -r` on important directories
- `DROP TABLE` / `DROP DATABASE` / `TRUNCATE`
- `git push --force` / `git push -f` (to main/master)
- `git reset --hard`
- `git checkout .` / `git restore .` (discard all changes)
- `git clean -f` / `git clean -fd`
- `git branch -D` (force delete branch)
- `kubectl delete` (Kubernetes resource deletion)
- `docker system prune` / `docker volume rm`
- `:> file` / `> file` (truncate files)

### File Edit Restrictions (Optional)
When the user specifies a directory to freeze to, Guard blocks edits outside that directory:

```
User: "Only edit files in src/api/"
→ Guard blocks Edit/Write calls to any path not under src/api/
```

## How It Works

Guard installs PreToolUse hooks that run BEFORE Claude executes Bash, Edit, or Write tools:

1. **Bash hook** — Scans the command string for destructive patterns. If matched, outputs a warning and blocks execution.
2. **Edit/Write hook** — If a freeze directory is set, checks that the target file is within the allowed path.

The hooks are defined in this skill's configuration and activate when the skill is loaded.

## Usage

### Activate full protection
Just invoke `/guard` — destructive command blocking is immediate.

### Set a directory freeze
Tell Claude which directory to restrict edits to:
```
"Only edit files in packages/api/"
"Freeze edits to src/components/"
```

Guard will write the freeze path to `.ultraship/guard-freeze.txt` and enforce it on all Edit/Write operations.

### Remove freeze
```
"Unfreeze" or "Remove edit restrictions"
```

### Override a blocked command
If Guard blocks something you actually need to run, explicitly confirm:
```
"Yes, I want to force-push to main"
"Confirmed: drop the users table"
```

Guard will allow explicitly confirmed destructive actions.

## Integration with Other Skills

- **`/investigate`** — Guard pairs well with investigation. No accidental fixes while diagnosing.
- **`/deploy`** — Guard prevents accidental force-pushes during deployment.
- **`/rescue`** — During incidents, Guard ensures rollback commands are deliberate.

## Key Principles

1. **Block by default, allow on confirmation.** Better to stop and ask than to destroy.
2. **No silent failures.** Always explain what was blocked and why.
3. **The user is sovereign.** Explicit confirmation overrides any guard.
4. **Minimal friction for safe operations.** Guard only triggers on genuinely dangerous patterns.

Versions

RepositoryScoreLicence
This page · houseofmvps/ultraship100MIT
frankxai/agentic-creator-os100Apache-2.0
darioabc/massimo100MIT
onlypfachi/chief100MIT
bdfinst/agentic-dev-team100MIT
ruya-ai/cozempic100MIT
tranhieutt/software_development_department100MIT
sharpdeveye/maestro100MIT
frankxai/agentic-creator-os95Apache-2.0

Database snapshot: 13.11.2026 · package version 43809178bcc6 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100git-guardrails
    Install a hook that blocks destructive git commands before an AI agent runs them. Use when an agent force-pushed or ran reset --hard, when adding git safety hooks, or when protecting main from agent pushes.
  • 100git-guardrails
    Install a hook, for one project or for every project, that blocks destructive git commands before an agent runs them: git push, force push, reset --hard, clean -f, branch -D, checkout . and restore . Claude Code's PreToolUse hook is the worked example. Use when the user wants to…
  • 90git-safety
    Git safety rules. INVOKE WHEN: git push, force push, git reset, git clean, destructive git, push force, reset hard. NEVER force push or do destructive git operations.
  • 100git-guardrails-claude-code
    Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
  • 100git-guardrails
    Use when you want mechanical, non-bypassable enforcement of git safety rules — a PreToolUse hook that blocks force-push, reset --hard, clean -f, branch -D, checkout ./-f, switch --discard-changes, restore ., worktree remove --force, git add -A/., and --no-verify before they run.…
  • 100git-guardrails-claude-code
    Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.