git-guardrails

Installation
SKILL.md

Git Guardrails

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 call before it runs, parses the git invocations inside it (chains, subshells, bash -c, xargs, git -C), and blocks the destructive ones with exit code 2 and a reason the agent can act on. It ships the hook, an installer that merges into .claude/settings.json without overwriting anything, plain git pre-push and pre-rebase hooks for non-agent callers, and a corpus tester that proves which commands are allowed and which are blocked.

When to use this skill

Installs
3
GitHub Stars
1.2K
First Seen
10 days ago