Agent skill

Guard

by Houseofmvps in Houseofmvps/ultraship

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory.

MITAuto-check: notesAI & LLM Engineering

Install Guard

skills CLI
$ npx skills add Houseofmvps/ultraship --skill guard -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Houseofmvps/ultraship guard --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Houseofmvps/ultraship.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/guard .claude/skills/guard && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
guard
GitHub stars
123
Token cost
~790 tokens
SKILL.md length
341 words
Files
1
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory.

  • Works in 2 steps: Bash hook — Scans the command string for… → Edit/Write hook — If a freeze directory…
  • Working on critical systems
  • SKILL.md covers What Guard Blocks, How It Works, Usage and Integration with Other Skills, plus 1 more section
  • Calls git, docker and kubectl

What it does

Guard is an agent skill from Houseofmvps/ultraship. 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.

Its SKILL.md is about 790 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM guardrails and Git workflow. It works with Git and Bash. The repository describes itself as: "ULTRASHIP" Claude Code plugin — 39 skills, 33 tools, 11 agents for ship-ready workflows: planning, review, pentesting, safety guardrails, canary monitoring, SEO/AI-readiness… The licence is MIT.

When your agent uses it

  • Working on critical systems
  • You want extra protection

Example prompts

  • “/guard”

Requirements

  • Docker
  • Pre-approved tools (allowed-tools): Bash, Read

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  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.

What it can do on your machine

Read from SKILL.md and the folder at commit ed232cb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • docker
    • kubectl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, docker and kubectl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Guard loads about 790 tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 341 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~790

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Houseofmvps/ultraship at commit ed232cb, republished under its MIT licence (© Houseofmvps). 341 words, ~790 tokens.

Download SKILL.mdSave it as .claude/skills/guard/SKILL.md (or your agent's skills folder).
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.
allowed-tools
Bash, Read
argument-hint
<directory-to-protect>

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.

© Houseofmvps, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/guard of Houseofmvps/ultraship.

Open the folder on GitHubat commit ed232cb

Compare with similar skills

Guard next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Guard compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Guard this skillHouseofmvps/ultraship123—~790Automated safety check: NotesMIT
Git Guardrails Claude Codefossasia/eventyay-interpretation1.6k13 repos~578Automated safety check: PassApache-2.0
Git Guardrails Claude Codevinvcn/mattpocock-skills-zh-CN4.7k—~474Automated safety check: PassMIT
Git Guardrails Claude Codedevcxl/mattpocock-skills-zh4371 repos~420Automated safety check: PassMIT
Rtk Skillsopaco/deepwiki-rs3.1k—~1.4kAutomated safety check: PassMIT
Wednesday Gitwednesday-solutions/ai-agent-skills170—~702Automated safety check: PassMIT

Similar skills

  • Git Guardrails Claude Code

    fossasia/eventyay-interpretation

    Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute.

    1.6k GitHub starsUsed in 13 repos~578 tokens
    AI & LLM EngineeringAuto-check passed
  • Git Guardrails Claude Code

    vinvcn/mattpocock-skills-zh-CN

    设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D 等)执行前阻止它们。适用于用户想防止破坏性 git 操作、添加 git safety hooks,或在 Claude Code 中阻止 git push/reset 时。

    4.7k GitHub stars~474 tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check passed
  • Git Guardrails Claude Code

    devcxl/mattpocock-skills-zh

    设置 Claude Code 钩子,在危险 Git 命令(push、reset --hard、clean、branch -D 等)执行前将其拦截。当用户想要防止破坏性 Git 操作、添加 Git 安全钩子或在 Claude Code 中阻止 git push/reset 时使用。

    437 GitHub starsUsed in 1 repo~420 tokens
    AI & LLM EngineeringAuto-check passed
  • Rtk Skill

    sopaco/deepwiki-rs

    A skill your agent uses when running shell commands that produce verbose output (git, test, build, lint, package managers, docker).

    3.1k GitHub stars~1.4k tokensUpdated 24 days ago
    DevOps & CloudAuto-check passed
  • Wednesday Git

    wednesday-solutions/ai-agent-skills

    Unified Git workflow. An agent skill from wednesday-solutions/ai-agent-skills.

    170 GitHub stars~702 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Speckit Git Feature

    kunstmusik/blue

    Create a feature branch with sequential or timestamp numbering

    154 GitHub starsUsed in 5 repos~861 tokens
    DevelopmentAuto-check passed

More from Houseofmvps/ultraship

All 28 skills in this repo
  • Using Ultraship

    Houseofmvps/ultraship

    A skill your agent uses when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions

    123 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • A11y

    Houseofmvps/ultraship

    Accessibility audit + auto-fix (WCAG 2.2 A/AA). An agent skill from Houseofmvps/ultraship.

    123 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check: notes
  • Architecture

    Houseofmvps/ultraship

    Living Architecture Map — auto-generate Mermaid diagrams of your codebase.

    123 GitHub stars~708 tokensUpdated 3 mo ago
    Auto-check: notes
  • Clone Patterns

    Houseofmvps/ultraship

    Learn From the Best — analyze patterns from any codebase and apply them to yours.

    123 GitHub stars~682 tokensUpdated 3 mo ago
    Auto-check: notes
  • Code Review

    Houseofmvps/ultraship

    Code review with principal-engineer-level depth. An agent skill from Houseofmvps/ultraship.

    123 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Compete

    Houseofmvps/ultraship

    Competitive X-Ray — analyze any competitor URL vs your site.

    123 GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check: notes

Works with

Questions about Guard

What does Guard do?

Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory. Guard is an agent skill from Houseofmvps/ultraship. Safety guardrails — blocks destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) and optionally restricts file edits to a specific directory.

When should I use Guard?

Guard fits situations like: working on critical systems; you want extra protection.

How do I install Guard in Claude Code?

Run `npx skills add Houseofmvps/ultraship --skill guard -a claude-code`. Or copy the skill folder (skills/guard in Houseofmvps/ultraship) into .claude/skills/guard in your project. Claude Code loads it when a task matches its description.

How do I install Guard in Codex?

Run `npx skills add Houseofmvps/ultraship --skill guard -a codex`. Or copy the skill folder (skills/guard in Houseofmvps/ultraship) into .agents/skills/guard in your project. Codex loads it when a task matches its description.

Can I use Guard in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Houseofmvps/ultraship --skill guard -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/guard, .gemini/skills/guard, .github/skills/guard and .opencode/skills/guard in your project.

What does Guard need to run?

Going by SKILL.md and its folder, Guard needs the command-line tools its instructions call (git, docker and kubectl). Our summary lists: Docker. Its frontmatter pre-approves these tools: Bash, Read.

Does Guard access the network?

SKILL.md contains no URLs. Its commands use git and docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Guard safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Guard use?

Guard is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Guard use?

About 790 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Guard?

Skills that share tags, products or a category with Guard: Git Guardrails Claude Code (fossasia/eventyay-interpretation, 1.6k stars), Git Guardrails Claude Code (vinvcn/mattpocock-skills-zh-CN, 4.7k stars), Git Guardrails Claude Code (devcxl/mattpocock-skills-zh, 437 stars) and Rtk Skill (sopaco/deepwiki-rs, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Guard?

Houseofmvps (a GitHub user) maintains it in Houseofmvps/ultraship, which has 123 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on July 8, 2026.

Source: Houseofmvps/ultraship on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.