/dominiks-skills:git-guardrails-claude-codefrom dominiks-skills
Sets up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before execution. Use when you want to prevent destructive git operations in Claude Code.
Ships in dominiks-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.
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude executes them.
git push (all variants including --force)git reset --hardgit clean -f / git clean -fdgit branch -Dgit checkout . / git restore .When blocked, Claude sees a message telling it that it does not have authority to access these commands.
Ask the user: install for this project only (.claude/settings.json) or all projects (~/.claude/settings.json)?
The bundled script is at: scripts/block-dangerous-git.sh
Copy it to the target location based on scope:
.claude/hooks/block-dangerous-git.sh~/.claude/hooks/block-dangerous-git.shMake it executable with chmod +x.
Add to the appropriate settings file:
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"
}
]
}
]
}
}
If the settings file already exists, merge the hook into existing hooks.PreToolUse array — don't overwrite other settings.
Ask if user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
Run a quick test:
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
Should exit with code 2 and print a BLOCKED message to stderr.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (dominikdorfstetter/skills) — no native marketplace selected
npx claudepluginhub p/dominikdorfstetter-dominiks-skills25 skills in this plugin
/add-backend-endpointAdd a new backend HTTP endpoint following the project's existing conventions — language and framework agnostic. Walks the layers (schema → repo → handler → routing → spec → client wiring), TDD-first. Use when adding a new API route to a backend codebase./add-list-pageScaffold a new CRUD list page in any frontend codebase — language and framework agnostic. Walks the layers (data fetch, mutations, RBAC, loading/empty/error, i18n, accessibility, UX polish), TDD-first. Use when adding a list/management page to a UI codebase./architect-reviewArchitectural evaluation of a codebase. Finds tech debt, missing patterns, coverage gaps, design inconsistencies; files parent + sub-issues via `gh`. Use when user asks for an architecture review, codebase evaluation, or wants to know what to fix structurally.28 plugins ship this exact skill · first indexed Jun 2, 2026
Showing 6 of 28 plugins, one per repository first
Other plugins' skills for the same job