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.
npx skills add ratnesh-maurya/cursor-claude-personas --skill git-hooks-automationgit clone --depth 1 https://github.com/ratnesh-maurya/cursor-claude-personasWrote 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.
[](https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/git-hooks-automation)<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.
<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>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.
| Model | Per session | Once 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 |
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 Copies of this mod
1 near-identical copy found in the catalogue:
- git-hooks-automation — 91% identical, 5 lines differ
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
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.
- 11d ago First seen · 417 lines · 46 tokens per session scan C 9bc612c227b5
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.
Other skills, from other repositories
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.
ijfw-commit
Terse conventional commits. Trigger: commit, git commit, /ijfw-commit.
git-workflow
Git workflow best practices. Covers branching, commits, and collaboration. Use for version control guidance. USE WHEN: user mentions "git", "commit", "branch", "pull request", "PR", "merge", "rebase", "version control", asks about "commit message", "branching strategy", "git best practices", "conventional commits"…
using-git-worktrees
Parallel development branches.
git-commit
Creates git commits following Conventional Commits format with type/scope/subject. Use when user wants to commit changes, create commit, save work, or stage and commit. Handles regular branch commits (development) and merge commits (PR closure). Enforces project-specific conventions from CLAUDE.md.
github-pr-review
Handles PR review comments and feedback resolution. Use when user wants to resolve PR comments, handle review feedback, fix review comments, address PR review, check review status, respond to reviewer, or verify PR readiness. Fetches comments via GitHub CLI, classifies by severity, applies fixes with user…