From mattpocock-skills
Set up safeguards that block or warn before dangerous git operations such as push, reset --hard, clean -f, branch -D, checkout ., or restore .. Use when user wants to prevent destructive git commands, add git safety hooks, or make an agent ask before risky repository changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mattpocock-skills:git-guardrailsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Install safeguards that prevent an agent from running dangerous git commands
Install safeguards that prevent an agent from running dangerous git commands without explicit user intent.
Block or require confirmation for:
git push, especially force pushesgit reset --hardgit clean -f / git clean -fdgit branch -Dgit checkout .git restore .The default posture is conservative: protect local work first, then let the user opt into narrower or broader rules.
Ask which agent or shell surface should enforce the guardrails:
Do not assume all agents have hooks. If the active agent has no pre-command hook, explain the limitation and offer a shell wrapper or project policy doc instead.
Before installing, ask whether the user wants to add or remove blocked patterns. Keep the default list unless they provide a clear preference.
When editing the script, keep each blocked command as a separate pattern so the blocked reason remains specific.
After installing, test the active integration with a command equivalent to:
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
The guardrail should reject the command and print a BLOCKED message.
Also test one harmless command, such as git status, to make sure normal git
usage still works.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub maxenergy/skills --plugin mattpocock-skills