← All skills
git-guardrails
97 / 100 · Low risk
Fine to try. Some of what it can do is expected: a coding skill usually runs build and test commands.
By borghei/Claude-Skills (GitHub) · coding · 1,086 stars · scanned at commit 25bf86b
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.
Works with any agent that supports SKILL.md skills.
What this skill can do
Runs commands on your computer
This is disclosed by the author in the skill's SKILL.md or README. Expected for a coding skill.
Found in 14 places.
Show 11 more
- engineering/git-guardrails/SKILL.md, line 131
git config --add guardrails.protected main - engineering/git-guardrails/SKILL.md, line 151
python3 engineering/git-guardrails/scripts/guardrail_test.py \ - engineering/git-guardrails/SKILL.md, line 162
typically `cd x && git reset --hard`, `bash -c "..."`, `-fdx` flag clusters, - engineering/git-guardrails/SKILL.md, line 183
with `shlex`, splits on shell operators, unwraps `sudo`/`env`/`xargs`/`bash -c`, - engineering/git-guardrails/assets/git_guardrails_hook.py, line 6
``||``, ``|``, subshells, ``bash -c`` bodies) and every ``git`` invocation is - engineering/git-guardrails/assets/git_guardrails_hook.py, line 166
res = subprocess.run(["git", "-C", where, "symbolic-ref", "--short", "-q", "HEAD"], - engineering/git-guardrails/assets/git_guardrails_hook.py, line 169
except (OSError, subprocess.SubprocessError): - engineering/git-guardrails/assets/sample_command_corpus.json, line 283
"command": "bash -c \"git clean -fdx\"", - engineering/git-guardrails/references/rule-catalog.md, line 103
| Nested shells | `bash -c "git clean -fdx"`, `bash -lc '...'`, `sh -xc '...'`, `eval "..."` (3 levels) | - engineering/git-guardrails/scripts/guardrail_test.py, line 78
proc = subprocess.run([sys.executable, str(hook)], input=json.dumps(payload), - engineering/git-guardrails/scripts/guardrail_test.py, line 80
except subprocess.TimeoutExpired:
Install
Paste this into your terminal. It downloads exactly the version we scanned, not whatever is newest.
if [ -e ~/.agents/skills/'git-guardrails' ] || [ -L ~/.agents/skills/'git-guardrails' ]; then echo 'A skill folder named git-guardrails already exists — not replacing it' >&2; false; else d=$(mktemp -d) && git clone --quiet --filter=blob:none --no-checkout 'https://github.com/borghei/Claude-Skills' "$d" && git -C "$d" checkout --quiet '25bf86b89c6c1e63f433a5b65e8cfcb6cf0b7ad3' -- 'engineering/git-guardrails' && mkdir -p ~/.agents/skills && cp -R "$d"/'engineering/git-guardrails' ~/.agents/skills/'git-guardrails' && rm -rf "$d"; fi
Codex reads ~/.agents/skills directly. For Claude Code, Cursor, Copilot, Gemini CLI, Antigravity or OpenCode, also link it. For Claude Code: ln -s ~/.agents/skills/'git-guardrails' ~/.claude/skills/'git-guardrails' (other agents: ~/.cursor/skills, ~/.copilot/skills, ~/.gemini/skills, ~/.gemini/config/skills, ~/.config/opencode/skills). Or install through the finder skill, which does both.
Badge for your README
The badge for borghei/Claude-Skills shows the score of its lowest-scoring skill.

[](https://zalavijaysinh.github.io/skilltrust/repos/borghei/Claude-Skills/)
Score history
| Date | Version | Score |
|---|
| 2026-11-10 | 25bf86b | 97 |