git-hooks-automation

git-hooks-automation is a skill for Claude Code from ratnesh-maurya/cursor-claude-personas. It costs 46 tokens per session (3,315 once invoked), scanned C, original, MIT.

A skill for setting up Git hooks, which are scripts that run automatically at points in Git's workflow. It covers tools such as Husky, lint-staged, pre-commit, and commitlint.

In plain words
What is it for?
Use it to configure checks before commits and pushes, validate staged files, and enforce commit-message conventions.
Why use it?
It catches formatting, linting, type, test, and commit-message problems before changes reach shared branches or continuous integration.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Good fit Use it to configure checks before commits and pushes, validate staged files, and enforce commit-message conventions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ratnesh-maurya/cursor-claude-personas --skill git-hooks-automation
Clone the repo
git clone --depth 1 https://github.com/ratnesh-maurya/cursor-claude-personas

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-hooks-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation/github.svg)](https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation)
Your own site
<a href="https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation"><img src="https://agentmods.dev/badge/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-hooks-automation

Your own site · 80×15
<a href="https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation"><img src="https://agentmods.dev/badge/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.03315
Opus 5 $0.00023 $0.01657
Sonnet 5 $0.00009 $0.00663
Haiku 4.5 $0.00005 $0.00331

Measured 11d ago against content hash 9bc612c227b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

git-hooks-automation scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .husky
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/git-hooks-automation/SKILL.md · 417 lines

How it starts

The opening of the file, as written. The whole thing — 417 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Hooks Automation

Automate code quality enforcement at the Git level. Set up hooks that lint, format, test, and validate before commits and pushes ever reach your CI pipeline — catching issues in seconds instead of minutes.

When to Use This Skill

  • User asks to "set up git hooks" or "add pre-commit hooks"
  • Configuring Husky, lint-staged, or the pre-commit framework
  • Enforcing commit message conventions (Conventional Commits, commitlint)
  • Automating linting, formatting, or type-checking before commits
  • Setting up pre-push hooks for test runners
  • Migrating from Husky v4 to v9+ or adopting hooks from scratch
  • User mentions "pre-commit", "commit-msg", "pre-push", "lint-staged", or "githooks"

Git Hooks Fundamentals

Git hooks are scripts that run automatically at specific points in the Git workflow. They live in .git/hooks/ and are not version-controlled by default — which is why tools like Husky exist.

Hook Types & When They Fire

Hook Fires When Common Use
pre-commit Before commit is created Lint, format, type-check staged files
prepare-commit-msg After default msg, before editor Auto-populate commit templates
commit-msg After user writes commit message Enforce commit message format
post-commit After commit is created Notifications, logging
pre-push Before push to remote Run tests, check branch policies
pre-rebase Before rebase starts Prevent rebase on protected branches
post-merge After merge completes Install deps, run migrations
post-checkout After checkout/switch Install deps, rebuild assets

Native Git Hooks (No Framework)

# Create a pre-commit hook manually
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/sh
set -e

# Run linter on staged files only
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|ts|jsx|tsx)$' || true)

if [ -n "$STAGED_FILES" ]; then
  echo "🔍 Linting staged files..."
  echo "$STAGED_FILES" | xargs npx eslint --fix
  echo "$STAGED_FILES" | xargs git add  # Re-stage after fixes
fi
EOF
chmod +x .git/hooks/pre-commit

Read the full file on GitHub · 417 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 417 lines · 46 tokens per session scan C 9bc612c227b5

Subscribe to this mod's changes

git-hooks-automation is a skill published in the GitHub repository ratnesh-maurya/cursor-claude-personas (8 stars, last pushed 5mo ago), licensed MIT. It adds 46 tokens to every session and 3,315 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories