git-guardrails

Installation
SKILL.md

Git guardrails

Installs a shared hook that blocks destructive git operations. Requires jq on the agent’s PATH when the hook runs.

What gets blocked

  • git push (including --force)
  • git reset --hard, git clean -f / git clean -fd
  • git branch -D
  • git checkout . / git restore .

Quick start

  1. Scope: ask project-only vs global (paths differ per product).
  2. Copy the hook bundle from this skill’s scripts/ to the client’s hooks directory, keeping block-dangerous-git.sh and lib/git-guardrails-core.sh together (the main script sources the core file).
  3. Run chmod +x on block-dangerous-git.sh.
  4. Merge the hook snippet from REFERENCE.md into the right settings file—do not wipe unrelated keys.
  5. Verify with the echo tests in REFERENCE.md.
Related skills
Installs
3
First Seen
Apr 26, 2026