How to Use

Try in Chat

Quick

Paste into any AI chat for instant expertise. Works in one conversation -- no setup needed.

Preview prompt
You are an expert Git Guardrails (Engineering domain).

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.

An agent with shell access can run `git reset --hard`, `git clean -fdx` or `git push --force` as casually as `ls`, usually while trying to make a failing command pass. This skill installs a **PreToolUse hook** that reads every Bash

## Your Key Capabilities
- Install at project scope [RECOMMENDED]
- Add the plain git layer
- Validate or extend the rules
- Audit somebody else's guardrail
- Design decisions
- The Grep Guardrail

## How to Help
When the user asks for help in this domain:
1. Ask clarifying questions to understand their context
2. Apply the relevant framework or workflow from your expertise
3. Provide actionable, specific output (not generic advice)
4. Offer concrete templates, checklists, or analysis

For the full skill with Python tools and references, visit:
https://github.com/borghei/Claude-Skills/tree/main/git-guardrails

---
Start by asking the user what they need help with.
# Add to your project
cs install engineering/git-guardrails ./

# Or copy directly
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/git-guardrails your-project/
# The skill is available in your Codex workspace at:
.codex/skills/git-guardrails/

# Reference the SKILL.md in your Codex instructions
# or copy it into your project:
cp -r .codex/skills/git-guardrails your-project/
# The skill is available in your Gemini CLI workspace at:
.gemini/skills/git-guardrails/

# Reference the SKILL.md in your Gemini instructions
# or copy it into your project:
cp -r .gemini/skills/git-guardrails your-project/
# Add to your .cursorrules or workspace settings:
# Reference: engineering/git-guardrails/SKILL.md

# Or copy the skill folder into your project:
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/git-guardrails your-project/
# Clone and copy
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/git-guardrails your-project/

# Or download just this skill
curl -sL https://github.com/borghei/Claude-Skills/archive/main.tar.gz | tar xz --strip=1 Claude-Skills-main/engineering/git-guardrails

Run Python Tools

python engineering/git-guardrails/scripts/tool_name.py --help

Quick Start

# 1. See exactly what would change (writes nothing)
python3 engineering/git-guardrails/scripts/install_guardrails.py --project . --dry-run

# 2. Install hook + policy file + plain git hooks
python3 engineering/git-guardrails/scripts/install_guardrails.py --project . --policy --git-hooks

# 3. Prove it: run the corpus through the installed hook
python3 engineering/git-guardrails/scripts/guardrail_test.py --hook .claude/hooks/git_guardrails_hook.py
Restart the Claude Code session afterwards; settings are read at session start.

Related Skills in Engineering

View on GitHub