Guard Git

SkillDocs & knowledge

Blocks risky git commands like force push and resets before your AI agent runs them.

Available today. Use it from your connected AI after setup.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Guard Git skill

About this skill

Block dangerous git commands (push, force push, reset --hard, clean, branch -D, checkout/restore .) and enforce Conventional Commits & Branch Protection before an AI agent runs them. Installs hook scripts for Claude Code, Cursor, Cursor CLI, and Gemini CLI; documents Google Antigravity Terminal deny

What this skill tells your AI

The instructions your AI receives, as published by danielvm-git/bigpowers in skills/guard-git/SKILL.md and read by ahel’s review.

HARD GATE — HARD GATE — Before committing, verify: branch is not main/master, author is correct, git user is configured. Bad commits are hard to fix.

Installs a shared hook that blocks destructive git operations and enforces workflow discipline. Requires jq on the agent's PATH when the hook runs.

What gets blocked/enforced

  • Safety: git push --force, git reset --hard, git clean -f, git branch -D, git checkout ., git restore ..
  • Discipline: Blocks direct commits or pushes to protected branches (main, master) unless GIT_BIGPOWERS_LAND=1 (set only by scripts/land-branch.sh).
  • Allows: git push origin <feature-branch> for backup/CI; solo land push to main only inside land-branch.sh.
  • Standardization: Enforces Conventional Commits for all git commit commands.
  • Secrets: Blocks commits containing common secret patterns (sk-, ghp_, AKIA, xoxb-, -----BEGIN private keys) — see REFERENCE.md.

Quick start

  1. Scope: ask project-only vs global (paths differ per product).
  2. Write the hook bundle from REFERENCE.md into the client's hooks directory.
  3. Run chmod +x on pre-tool-use.sh.
  4. Merge the hook snippet from REFERENCE.md into the right settings file — do not wipe unrelated keys.
  5. Verify with the tests in REFERENCE.md.
ClientMechanismConfig
Claude CodePreToolUse (Bash).claude/settings.json or ~/.claude/settings.json
Cursor / Cursor CLIbeforeShellExecution.cursor/hooks.json or ~/.cursor/hooks.json
Gemini CLIBeforeTool + run_shell_command.gemini/settings.json or ~/.gemini/settings.json
Google AntigravityBuilt-in Terminal Deny listSettings UI (no shell hook)

Modes (env on the hook command): GIT_GUARDRAILS_MODE is claude (default) or cursor → stderr + exit 2 on block. Set gemini for Gemini CLI → JSON decision on stdout.

Customization

To add or remove patterns or protected branches, edit pre-tool-use.sh.

Advanced

Full JSON examples, merge rules, Antigravity deny-list entries, and test commands: REFERENCE.md.

Signals

GitHub stars
248
Forks
19
Last commit
Sep 2026

ahel review

  • K4info
    destructive
  • K4binfo
    destructive-scoped
  • K6info
    bundled executables the agent is told to run
  • K4binfo
    destructive-scoped (in scripts/lib/git-guardrails-core.sh)
  • K4info
    destructive (in REFERENCE.md)
  • K4binfo
    destructive-scoped (in REFERENCE.md)

Automated review, not a security audit. Ruleset v1+k2.

Advanced
Item type
skill
Key
guard-git
Source
github.com/danielvm-git/bigpowers