What it does
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute
Skills ZICQ category:Agent Workflows git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
Official URL:skills.sh
Intro in this page language first. The official description stays in its original wording; we do not rewrite SKILL.md.
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute
user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code
Per Agent Skills progressive disclosure: name and description load at startup (~100 tokens); the full SKILL.md body loads when the skill activates; scripts/, references/, and assets/ load only as needed. This file's sections: Setup Git Guardrails; What Gets Blocked; Steps; 1. Ask scope; 2. Copy the hook script; 3. Add hook to settings. It includes spec-recommended sections: step-by-step instructions.
File analysis: besides SKILL.md, the body references scripts/block-dangerous-git.sh. Those resources load on demand.
Setup Git GuardrailsWhat Gets BlockedSteps1. Ask scope2. Copy the hook script3. Add hook to settings4. Ask about customization5. Verify
Source category:skills.sh agent-skill
namegit-guardrails-claude-codedescriptionscripts/block-dangerous-git.shThese paths are extracted from the text. Check the upstream package to verify the files exist.
Invocation syntax and available tools depend on your Agent client. Client integration guide ↗
Choose the target agent and installation scope, keep referenced package files, then verify the skill appears in the client's catalog.
This skill references supporting files. Retrieve the complete directory from the source; copying SKILL.md alone may leave missing dependencies.
Copy these instructions to a compatible agent and confirm the target directory matches your client.
Install the agent skill "git-guardrails-claude-code" into my project. The full SKILL.md and official description are at https://zicq.com/en/skills/skl-652c47b82ef6d05b-Git-Guardrails-Claude-Code.html Save it as .cursor/skills/git-guardrails-claude-code/SKILL.md or .claude/skills/git-guardrails-claude-code/SKILL.md and keep the frontmatter name and description exactly as-is. This skill also ships scripts/, references/, or assets/ — fetch the whole folder from https://github.com/mattpocock/skills instead of creating only a SKILL.md.
Requires Node.js and npx. First inspect the repository's skill list to confirm the name.
npx skills add 'https://github.com/mattpocock/skills' --list
npx skills add 'https://github.com/mattpocock/skills' --skill 'git-guardrails-claude-code'
The CLI lets you choose the agent interactively. The default scope is the project; use -g for user scope. Confirm package availability with the discovery command, then use npx skills list to inspect installed skills.
Agent Workflows
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that exte…
Agent Workflows
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fl…
Agent Workflows
Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team …
Agent Workflows
Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan →…