CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

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.

91

1.19x
Quality

89%

Does it follow best practices?

Impact

100%

1.19x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No findings from the security scan

The canonical home for this skill is git-guardrails-claude-code in mattpocock/skills

SKILL.md
Quality
Evals
Security

Quality

Content

86%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A tight, actionable setup guide with concrete commands, complete settings JSON, and an explicit verification step. The main improvements are trimming the near-duplicate project/global JSON blocks and adding brief recovery guidance for when the verification test fails.

Suggestions

Collapse the two near-identical settings JSON blocks into one example plus a note to swap the command path for the project ($CLAUDE_PROJECT_DIR) vs global (~) scope, cutting ~15 redundant lines.

In step 5, add a short recovery branch: if the test does not exit with code 2, check that the script is executable (chmod +x), that the settings JSON is valid, and that the hook entry was merged into the existing hooks.PreToolUse array.

Optionally list the exact patterns the bundled script blocks (or note that step 4's customization edits the copied script) so the body and script stay in sync when patterns change.

DimensionReasoningScore

Conciseness

The body is lean — no explanations of concepts Claude already knows, every step is direct ('Copy it to the target location', 'Make it executable with chmod +x'). It fits anchor 4 ('minor instances of over-explanation that could be trimmed') rather than 5 because the project and global settings JSON blocks are ~35 near-duplicate lines differing only in the command path; that block could be collapsed to one snippet plus a path substitution. It is well above anchor 3 since there is no real padding.

4 / 5

Actionability

Fully executable throughout: exact script path and destination paths, 'chmod +x', complete copy-paste settings JSON for both scopes, an explicit merge instruction ('merge the hook into existing hooks.PreToolUse array — don't overwrite other settings'), and a concrete verification one-liner with expected behavior ('Should exit with code 2 and print a BLOCKED message to stderr'). Matches the anchor-5 'copy-paste ready commands covering the common cases'; not 4 because no key detail is missing.

5 / 5

Workflow Clarity

Five clearly sequenced steps (ask scope → copy script → add hook → customize → verify) ending in an explicit validation step with a test command and expected exit code, so it avoids the destructive-operation cap at 3. It matches anchor 4 ('Clear sequence with most checkpoints present; minor validation gaps') rather than 5 because there is no error-recovery guidance if the verification fails (e.g., check executable bit, confirm settings merge) — the feedback loop is single-shot rather than validate → fix → retry.

4 / 5

Progressive Disclosure

The implementation script is correctly externalized with a clear one-level-deep reference ('The bundled script is at: [scripts/block-dangerous-git.sh](scripts/block-dangerous-git.sh)' — the file exists and matches the body), and everything remaining inline is appropriately concise setup guidance. This is a single-task skill whose only split-worthy content (the pattern-matching script) is already in a separate file, matching the well-signaled one-level-deep anchor; not 4 because there are no organization gaps — sections (What Gets Blocked / Steps) are well-ordered and easy to navigate.

5 / 5

Total

18

/

20

Passed

Description

87%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: concrete capability list, explicit 'Use when...' trigger clause with multiple natural phrasings, third-person voice, and a well-defined niche. Minor room to enumerate a few more blocked variants or synonyms (e.g., 'force push', 'safety rails').

DimensionReasoningScore

Specificity

Quotes: 'Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute' — names the domain and several concrete actions (block push, reset --hard, clean, branch -D). It matches the anchor 'Lists several specific actions; minor gaps in coverage' rather than 5 because 'etc.' leaves coverage slightly open (checkout/restore variants, force-push specifics are only partially enumerated), and it is above 3 because more than 1-2 concrete actions are explicitly listed.

4 / 5

Completeness

Quotes: 'Set up Claude Code hooks to block dangerous git commands... before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.' Both 'what' and an explicit 'when' with concrete trigger phrases are present, matching the anchor-5 example pattern exactly; it is not 4 because the 'when' clause is explicit and multi-trigger rather than merely adequate.

5 / 5

Trigger Term Quality

Quotes: 'prevent destructive git operations', 'add git safety hooks', 'block git push/reset in Claude Code' — good coverage of natural phrases a user would say. It fits anchor 4 ('Good keyword coverage; a few natural terms missing') rather than 5 because common synonyms like 'force push', 'protect', or 'safety rails' are absent, and it clearly exceeds anchor 3 since multiple natural user phrasings are present.

4 / 5

Distinctiveness Conflict Risk

Quotes: 'Claude Code hooks', 'block dangerous git commands', 'git push/reset in Claude Code' — a clear niche (git safety hooks in Claude Code) with distinct triggers and minimal overlap with other skills. It is not 4 because the combination of hook installation + specific blocked git commands is unlikely to fire for a wrong skill.

5 / 5

Total

18

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

SnowingFox/ai-skills

Path

.cursor/skills/git-guardrails-claude-code/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.