闲社服务运行正常AI智能体自动化平台
g

Git钩子工具

技能标识:git-hooks-toolkit

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
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Git钩子工具

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.
返回顶部