/claudops:git-guardrailsfrom Claudops
Manages a git safety hook that blocks dangerous operations (push, force-delete branches, discard working tree changes). Install, customize, or troubleshoot the guard.
Ships in Claudops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
If
.claude/skills/git-guardrails/SKILL.md.disabledexists, stop before reading a fallback. Project configuration: If the current project contains.claude/skills/git-guardrails/SKILL.md, read and apply it instead of this bundled default. The project copy is the capability source of truth. Repository context: Read../setup/references/task-context.mdwhen resolving a task, project commands, named agent roles, or legacy.claude/resource paths. Use repository evidence and applicable project instructions; a missing local workflow copy does not require setup. Resolve bundled resources from the installed skill, never from the target cwd. Invocation guard: use this as a standalone skill only when explicitly requested by the user; automatic selection is not authorization. Portable clients may not enforce Claude Code host-level invocation restrictions.
Status: DISABLED. The hook script exists at
.claude/hooks/guards/git-guardrails.shbut is not wired intosettings.json. It does nothing until re-enabled. See "Re-enable" below.
Upstream: Adapted from mattpocock/skills/git-guardrails-claude-code. Implements harness-level git safety — prompts cannot reliably enforce this, only PreToolUse hooks can.
This skill manages the git-safety hook at .claude/hooks/guards/git-guardrails.sh.
The plugin does not wire a project hook. Resolve the target repository and its local
settings through ../setup/references/task-context.md before any requested change;
never edit the installed plugin copy. A status check is standalone and creates no task;
when a task owns the guard change, save settings read-back and smoke-test receipts there.
Add the following entry to the target repository's Bash-matcher hooks array in its
.claude/settings.json under hooks.PreToolUse:
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/guards/git-guardrails.sh"
}
Place it first in the array for fail-fast (so dangerous commands are rejected before logging/validation hooks fire). Remove the DISABLED banner at the top of the script.
Once the hook is wired, it blocks these operations without additional configuration:
git push — any variant. The user pushes manually after reviewing the diff/PR.git branch -D / git branch --delete -f — force-delete branches discards unmerged work.git checkout . / git restore . / git checkout -- . — discarding all working-tree changes.Already covered by the sibling bash-guard.sh (universal rules, always-active section):
git reset --hardgit push --force / -f (the --force variant — git-guardrails.sh blocks the rest)git clean -fd / -fxrm -rf /, rm -rf ~, rm -rf .curl | sh / wget | bashWhen blocked, Claude sees BLOCKED: … on stderr with exit 2 and stops — the user runs the command manually if intended.
This skill documents and verifies the optional hook; do not change settings.json, enable the
hook, or remove a pattern unless the user explicitly requests that configuration change.
# Should be referenced in PreToolUse → Bash hooks:
jq '.hooks.PreToolUse[] | select(.matcher == "Bash") | .hooks[].command' .claude/settings.json
# Smoke test — should print the BLOCKED message and exit 2:
echo '{"tool_input":{"command":"git push origin main"}}' | .claude/hooks/guards/git-guardrails.sh
echo "exit: $?" # expect: 2
Edit .claude/hooks/guards/git-guardrails.sh directly. Each rule is a grep -qE block followed by echo "BLOCKED: …" >&2; exit 2. Rules are independent — add or remove freely.
When adding a rule, also add a smoke-test line above and confirm exit 2.
.claude/settings.json and remove the git-guardrails.sh entry from hooks.PreToolUse[*].hooks where the matcher is Bash.Don't disable on a whim — every blocked command reflects an incident or a near-miss.
A CLAUDE.md instruction "do not run git push" is unreliable: the model can ignore it under pressure, and the user can't audit it. A PreToolUse hook is the only enforcement that actually fires every time. This is a load-bearing safety primitive — keep it.
What SKILL.md sets; muted values are Claude Code's defaults
40 skills in this plugin
/analyzeCompare a task's discovery or product requirements with its tech decomposition and report traceability gaps. Use when asked to 'analyze consistency', 'check alignment', 'verify spec matches plan', 'traceability check', 'spec drift', 'are my docs aligned', or after /ct completes to verify the plan covers the requirements. `/ct` may invoke this check when traceability is material; otherwise it remains an explicit read-only command. NOT for code review (use /sr), NOT for code analysis (use /code-analysis), NOT for debugging (use /dbg)./antigravity-cliRun Google Antigravity CLI (agy) for web-grounded research, cross-AI review, or validation when those capabilities are explicitly needed or another skill delegates to agy. One-shot only; do not select it for an ordinary review without an explicit provider choice./architecture-languageCanonical architectural vocabulary — module, interface, seam, adapter, depth, leverage, locality. Use when reviewing architecture, deepening shallow modules, designing interfaces, or evaluating refactor candidates. NOT a domain glossary (use /ubiquitous-language for that)./blueprintTurn a one-line objective into a bounded staged implementation plan with cold-start briefs. Use when asked to 'blueprint', 'multi-session plan', 'long-term plan', 'construction plan', 'break into sessions', 'plan across sessions', 'multi-step project plan', 'session plan', or when work needs staged handoffs. Produces a plan where each step can be resumed independently by a fresh agent with no prior context./brainstormCompare options and clarify a decision through a collaborative brainstorming session. Use when asked to 'brainstorm', 'let's brainstorm', 'explore ideas', 'think through', 'brainstorm about [topic]', 'what are our options for', 'let's think about', 'pros and cons of', 'help me decide', or 'weigh the options'. NOT for feature discovery (use /nf), NOT for PRD/JTBD docs (use /product), NOT for deep research (use /deep-research), NOT for pre-implementation design (auto-triggered by design-exploration skill)./cc-linearExecute Linear operations via direct GraphQL API — create issues, update status/priority/title, add comments, search tasks, manage labels, assign work, and link PRs. Use this skill when the user mentions Linear explicitly, or references a Linear-style identifier (uppercase team prefix + dash + number, e.g. ENG-123, OPS-7; the project's team key is in $LINEAR_TEAM_KEY). Trigger on phrases like "create a Linear ticket/issue", "move TEAM-X to done/in progress/review", "update the Linear task status", "close the Linear issue", "what's in our Linear backlog", "assign this Linear issue to", "my Linear issues", or any project management operation targeting Linear. Also trigger when other skills (ct, si, sr) need to sync state with Linear. Do not trigger on ambiguous "create an issue" when the user clearly means a GitHub Issue (repo context, `gh issue` commands, issues.md), unless they also reference Linear.
npx claudepluginhub alexandrbasis/claudops --plugin claudopsOther plugins' skills for the same job