返回顶部
g

git-hooks-toolkitGit钩子工具

Generate, install, and manage Git hooks with pre-built templates. Includes hooks for linting staged files, enforcing conventional commits, blocking debug statements, preventing large file commits, auto-formatting code, requiring ticket references, protecting branches, running tests before push, and auto-installing dependencies after merge. Use when setting up git hooks, enforcing commit conventions, or automating pre-commit/pre-push checks.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
133
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

git-hooks-toolkit

Git Hooks 工具包

使用预构建模板,在数秒内安装生产就绪的 Git 钩子。

快速开始

bash

列出所有可用模板


python3 scripts/git_hooks.py list

安装钩子

python3 scripts/git_hooks.py install pre-commit lint-staged python3 scripts/git_hooks.py install commit-msg conventional

安装前预览

python3 scripts/git_hooks.py show pre-commit no-debug

检查已安装内容

python3 scripts/git_hooks.py status

移除钩子

python3 scripts/git_hooks.py remove pre-commit

可用模板

pre-commit(提交前)

  • - lint-staged — 仅对暂存文件运行 ESLint/Ruff/Flake8
  • no-debug — 阻止 console.log、debugger、pdb、breakpoint()
  • large-files — 阻止提交超过 500KB 的文件
  • format-check — 自动对暂存文件运行 Prettier、Black、gofmt

commit-msg(提交信息)

  • - conventional — 强制使用约定式提交(feat/fix/docs 等)
  • ticket-ref — 要求包含工单引用(#123、PROJ-456)
  • no-wip — 阻止在 main/master/release 分支上提交 WIP

pre-push(推送前)

  • - run-tests — 自动检测项目类型并运行测试套件
  • branch-protect — 阻止直接推送到 main/master 分支

post-merge(合并后)

  • - install-deps — 当锁定文件发生变化时自动安装依赖

命令

  • - list — 显示所有模板
  • install <钩子> <模板> [--repo 路径] [--force] — 安装钩子
  • show <钩子> <模板> — 预览模板内容
  • status [--repo 路径] — 显示已安装的钩子
  • remove <钩子> [--repo 路径] — 删除钩子

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 git-hooks-toolkit-1776110342 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 git-hooks-toolkit-1776110342 技能

通过命令行安装

skillhub install git-hooks-toolkit-1776110342

下载

⬇ 下载 git-hooks-toolkit v1.0.0(免费)

文件大小: 6.31 KB | 发布时间: 2026-4-14 12:20

v1.0.0 最新 2026-4-14 12:20
Initial release of git-hooks-toolkit.

- Generate, install, and manage Git hooks using ready-made templates.
- Templates include enforcing commit conventions, linting staged files, blocking debug statements, preventing large file commits, auto-formatting, running tests pre-push, branch protections, and auto-installing dependencies after merge.
- Intuitive CLI for listing, installing, previewing, checking status, and removing hooks.
- Supports pre-commit, commit-msg, pre-push, and post-merge hook types.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部