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 wu529778790/shenzjd-skills --skill git-hooks-setupgit clone --depth 1 https://github.com/wu529778790/shenzjd-skillsWrote 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/wu529778790/shenzjd-skills/git-hooks-setup)<a href="https://agentmods.dev/skills/wu529778790/shenzjd-skills/git-hooks-setup"><img src="https://agentmods.dev/badge/skills/wu529778790/shenzjd-skills/git-hooks-setup/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/wu529778790/shenzjd-skills/git-hooks-setup"><img src="https://agentmods.dev/badge/skills/wu529778790/shenzjd-skills/git-hooks-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk fail
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.00042 | $0.01941 |
| Opus 5 | $0.00021 | $0.00971 |
| Sonnet 5 | $0.00008 | $0.00388 |
| Haiku 4.5 | $0.00004 | $0.00194 |
Grade A, and why
git-hooks-setup scanned grade A with 0 findings 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Hooks Setup
一键配置 Git Hooks,标准化团队开发流程。
Overview
自动生成 pre-commit / commit-msg / pre-push hook 配置,包含代码格式化、commit message 校验、敏感信息检查。支持 husky 和原生 git hooks 两种方案。
When to Use
- User wants to set up git hooks
- User mentions pre-commit or commit message conventions
- User wants to automate lint/format checks
- User inputs
/git-hooks-setup - User wants to enforce pre-push checks (tests, lint)
- User wants to prevent pushing broken code
- User wants to standardize team commit message format
- User wants to add secret scanning before commit
- User wants to auto-format code on every commit
When NOT to Use:
- User only wants to view current git hooks configuration
- User wants CI-based checks (no local hooks needed)
- User's project already has a complete hooks setup
- User wants to run hooks on specific files only (use lint-staged directly)
- User wants to hook into Git events other than pre-commit/commit-msg/push
Core Pattern
Step 1: 检测项目环境
# 检测包管理器(按 lock 文件判断)
if [ -f "package-lock.json" ]; then PACKAGE_MANAGER="npm"
elif [ -f "yarn.lock" ]; then PACKAGE_MANAGER="yarn"
elif [ -f "pnpm-lock.yaml" ]; then PACKAGE_MANAGER="pnpm"
# 检测已有 hooks 配置
test -d ".husky" && echo "husky 已配置"
test -f ".git/hooks/pre-commit" && echo "原生 hooks 已配置"
# 从 package.json 检测已安装的 lint 工具(eslint/prettier/lint 相关)
Step 2: 选择方案
| 方案 | 适用场景 | 优点 |
|---|---|---|
| husky | Node.js 项目 | 团队协作友好,配置即代码 |
| 原生 git hooks | 非 Node.js 项目 | 无依赖 |
Step 3: 生成配置
方案 A: Husky
# 根据 $PACKAGE_MANAGER 选择: pnpm dlx / yarn dlx / npx
husky init # 初始化 husky
生成 .husky/pre-commit(执行 lint-staged)和 .husky/commit-msg(执行 commitlint),注意 commitlint 需加 --no 前缀避免交互式安装。
生成 lint-staged 配置(写入 package.json):
{
"lint-staged": {
"*.{ts,tsx,js,jsx}": ["eslint --fix", "prettier --write"],
"*.{json,md,yml}": ["prettier --write"]
}
}
生成 .husky/pre-push(可选,push 前跑测试):
# 根据包管理器选择命令
if [ "$PACKAGE_MANAGER" = "pnpm" ]; then
pnpm test
elif [ "$PACKAGE_MANAGER" = "yarn" ]; then
yarn test
else
npm test
fi
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 185 lines · 42 tokens per session scan A 62468233e18f
git-hooks-setup is a skill published in the GitHub repository wu529778790/shenzjd-skills (0 stars, last pushed 4d ago), licensed MIT. It adds 42 tokens to every session and 1,941 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
shared-tooling-git-hooks
Husky v9 setup, lint-staged v16 patterns, commitlint with conventional commits, CI/production handling, monorepo setup, migration from v8.
git-workflow
Git workflow automation with conventional commits, merge vs rebase decision trees, worktrees, SSH signing, and monorepo sparse checkout patterns.
commit-code
Analyze code changes to prepare conventional commit message and commit to a new branch.
git-workflow-guide
Git workflow reference covering branch naming, commit message conventions, PR templates, merge strategies, and common operations — for consistent team collaboration.
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.
commit-with-reflection
A Git workflow that creates a Chinese-language report about debugging mistakes, investigation steps, fixes, and lessons learned, then includes that report in a commit. Git is a system for tracking changes to code.