← ClaudeAtlas

git-guardrailslisted

Use when a repository needs a safety net against force-push, forced refspec, hard reset, forced clean, forced branch deletion, working-tree discard, stash drop/clear, reflog expire, or gc prune; installs a PreToolUse hook exiting 2 on them; plain git push allowed. Not for remote, credential, publish, deploy, or irreversible changes.
OutlineDriven/odin-claude-plugin · ★ 35 · AI & Automation · score 79
Install: claude install-skill OutlineDriven/odin-claude-plugin
# Set up Git guardrails ## Contract | Field | Bound contract | |---|---| | Trigger | A repository needs a tool-time safety net against force-push/reset/clean/branch-delete/discard. | | Authority | Reversible-local: write only the hook copy under the chosen `.claude/hooks/` or `~/.claude/hooks/` directory and one merged `hooks.PreToolUse` entry in the matching `.claude/settings.json` or `~/.claude/settings.json`. No VCS, remote, credential, or other file change. Rollback: delete the copied script and remove the registered entry. | | Side effect | Copies `block-dangerous-git.py` and registers it in the chosen settings file `PreToolUse`; net effect removes destructive capability. | | Done | All 16 verification payloads exit as expected, the hook is registered, and plain `git push` still exits 0. | ## Inputs - Scope (required, chosen by the user): project (`.claude/settings.json` plus `.claude/hooks/`) or global (`~/.claude/settings.json` plus `~/.claude/hooks/`). - Hook source: `scripts/block-dangerous-git.py` shipped beside this SKILL.md. - Optional: rule additions or removals, decided before installation. ## Procedure 1. Ask the user to choose project or global scope. Mutate nothing before the choice. Done when: the user has chosen project or global scope, with no mutation made. 2. Copy `scripts/block-dangerous-git.py` to the chosen location — project: `.claude/hooks/block-dangerous-git.py`; global: `~/.claude/hooks/block-dangerous-git.py` — and run `chmod +x` on the cop