/officialunofficial-skills:git-guardrailsfrom Official Unofficial Skills
Installs a PreToolUse hook that blocks destructive git commands (push, reset --hard, clean, branch -D) from running inside Claude Code. Supports project-level or global installation.
Ships in Official Unofficial Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Wire up a PreToolUse hook that inspects every Bash command Claude is about to run and refuses the destructive git operations before they touch the repository.
git push in any form, including --forcegit reset --hardgit clean -f and git clean -fdgit branch -Dgit checkout . and git restore .When a command matches, the hook exits with code 2 and Claude receives a message stating it is not permitted to run that command, so it stops rather than retrying.
Ask whether the guard should cover this project only (.claude/settings.json) or every project (~/.claude/settings.json). The answer decides where the script and the hook entry go.
The bundled script lives at scripts/block-dangerous-git.sh. Copy it to match the chosen scope:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.shThen mark it executable with chmod +x.
Add the hook to the settings file for the chosen scope.
Project (.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
Global (~/.claude/settings.json):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/block-dangerous-git.sh"
}
]
}
]
}
}
When the settings file already exists, merge this entry into the existing hooks.PreToolUse array and leave the rest of the file untouched.
Ask whether any patterns should be added or dropped, then edit the DANGEROUS_PATTERNS array in the copied script to match.
Feed a sample command through the script and check the result:
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
A working guard exits with code 2 and prints a BLOCKED line to stderr.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
git-safety, pre-tool-hook, destructive-commands, claude-hook
npx claudepluginhub officialunofficial/skills --plugin officialunofficial-skills85 skills in this plugin
/alignmentMeasures a running page for edges, gaps, centres and radii that miss by a pixel or two, judges visual weight, and returns a numbered report with proof./animateBuilds a web animation from scratch and writes the code. Decides in order whether it should animate at all, its purpose, the tool, the properties, the easing and duration or spring, how it interrupts and exits, and reduced motion. Use when asked to animate something, add motion, build a transition, or make a component feel alive. For React Native or Expo use animate-expo. To critique existing motion use review-animations. To audit a whole codebase use improve-animations./animate-expoOther plugins' skills for the same job