git-hooks-automation

git-hooks-automation is a skill for Claude Code, Codex from tmolavi/mcp-agent-skills-hub. It costs 46 tokens per session (3,375 once invoked), scanned C, a copy of git-hooks-automation, MIT.

Guidance for setting up Git hooks with tools such as Husky, lint-staged, pre-commit, and commitlint. Git hooks are scripts that run automatically during actions such as committing or pushing code.

In plain words
What is it for?
Use it to add pre-commit or pre-push checks, enforce commit-message rules, or configure Husky, lint-staged, or the pre-commit framework.
Why use it?
It catches formatting, linting, type-checking, test, and commit-message problems before changes reach the shared repository or CI system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to add pre-commit or pre-push checks, enforce commit-message rules, or configure Husky, lint-staged, or the pre-commit framework.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmolavi/mcp-agent-skills-hub/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 tmolavi/mcp-agent-skills-hub --skill git-hooks-automation
Clone the repo
git clone --depth 1 https://github.com/tmolavi/mcp-agent-skills-hub

Made for: Claude Code, Codex.

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/tmolavi/mcp-agent-skills-hub/git-hooks-automation/github.svg)](https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/git-hooks-automation)
Your own site
<a href="https://agentmods.dev/skills/tmolavi/mcp-agent-skills-hub/git-hooks-automation"><img src="https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/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/tmolavi/mcp-agent-skills-hub/git-hooks-automation"><img src="https://agentmods.dev/badge/skills/tmolavi/mcp-agent-skills-hub/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,375 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 91% copy Near-identical to another mod 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.03375
Opus 5 $0.00023 $0.01688
Sonnet 5 $0.00009 $0.00675
Haiku 4.5 $0.00005 $0.00337

Measured 8d ago against content hash d4ee40c36937, 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 8d 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

This is a copy

91% identical to git-hooks-automation — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/git-hooks-automation/SKILL.md · 422 lines

How it starts

The opening of the file, as written. The whole thing — 422 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 · 422 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. 8d ago First seen · 422 lines · 46 tokens per session scan C d4ee40c36937

Subscribe to this mod's changes

git-hooks-automation is a skill published in the GitHub repository tmolavi/mcp-agent-skills-hub (8 stars, last pushed 15d ago), licensed MIT. It adds 46 tokens to every session and 3,375 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 91% identical to git-hooks-automation, differing in 5 lines, and is treated as a copy.

Related

Other skills, from other repositories

gate

MANDATORY before every commit and push. All gates must pass — Gates 1–3 always run; Gates 4 (Docker) and 5 (Cloud) run only when applicable. Do NOT proceed if any gate fails — fix the issue first.

rajitsaha/100xprism · 0 tokens

merge-check

Xcode-specific pre-merge gate — archive build (catches strict-concurrency/MainActor errors debug builds miss), app-extension Info.plist check, SwiftLint — spawned in parallel. Trigger on Apple/Xcode merge intent specifically ("merge this iOS branch", "archive check before merge", "is this ready for TestFlight"); a…

markdavidgan/apple-dev-skills · 96 tokens

github

Manages all git operations (commit, push, branch management, PR creation) in a standardized, safe, and consistent way. Automatically runs the code-review skill before any commit. Enforces Conventional Commits standard. Handles the full lifecycle: branch → review → commit → push → PR.

omergocmen/vibe-coder-kit · 60 tokens

Git Conventional Commits

Git commit message and branch naming standards following Conventional Commits format. / TR: Git commit mesajları ve branch isimlendirme standartlarını belirler. Conventional Commits kurallarını uygular.

GktuOktay/ai-skills · 44 tokens

commit

Detect the repo's commit convention (Conventional Commits, Gitmoji, or a custom template) and create commits. Use when asked to commit, write a commit message, stage and commit changes, or commit and push work.

Bilal140202/the-lord-of-the-skills · 49 tokens

git-orchestrator

Git orchestrator managing commit standards, issue triage, PR code reviews, and repo rules. / TR: Git süreçlerini, commit standartlarını, issue ve PR yönetimini, repo kurallarını yöneten ana orkestratör.

GktuOktay/ai-skills · 53 tokens