mcpField
L
lefthook

lefthook

github.com/fandhe-ai开发41.2k 次安装4 天前更新
代码仓库

关于 lefthook

按任务整理 Lefthook 文档的参考技能,便于查找相关说明。内容涵盖 Lefthook v2.2.2 的安装、配置、命令、集成、示例和 AI Agent hook 设置。

主要功能

  1. 01按任务映射文档类别
  2. 02安装方式与设置指南
  3. 03Hook、命令和脚本配置
  4. 04CLI 用法与环境变量
  5. 05集成和本地覆盖示例

适用场景

  1. 01选择 Lefthook 安装方式
  2. 02配置 Git hooks 和命令
  3. 03查询环境变量控制选项
  4. 04设置 AI Agent hook 配置

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/fandhe-ai/agent-reference-skills --skill lefthook

安装后在 Claude Code 中输入/lefthook确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/configuration/
ai.md
command-settings.md
global-settings.md
hook-settings.md
README.md
remotes.md
script-settings.md
source-dir.md
references/examples/
commitlint.md
filters.md
lefthook-local.md
protect-branch.md
README.md
remotes.md
skip.md
stage-fixed.md
wrap-commands.md
references/installation/
alpine.md
arch.md
deb.md
devbox.md
go.md
homebrew.md
manual.md
mise.md
node.md
overview.md
php.md
python.md
README.md

详细介绍

Lefthook 参考

涵盖 Lefthook(lefthook.dev)全部文档的技能。 根据用户的任务读取适当的 README.md,并从中找到相关文件。

适用于 Lefthook v2.2.2(截至 2026-10,原始内容为 GitHub 标签 v2.2.2 中的 docs/)。

目录结构

skills/lefthook/
  SKILL.md
  references/
    installation/
      README.md
      overview.md
      node.md
      ruby.md
      go.md
      python.md
      php.md
      swift.md
      homebrew.md
      winget.md
      scoop.md
      deb.md
      rpm.md
      alpine.md
      arch.md
      snap.md
      devbox.md
      mise.md
      manual.md
    configuration/
      README.md
      ai.md
      global-settings.md
      hook-settings.md
      command-settings.md
      script-settings.md
      source-dir.md
      remotes.md
    usage/
      README.md
      commands.md
      environment-variables.md
    examples/
      README.md
      commitlint.md
      filters.md
      lefthook-local.md
      protect-branch.md
      remotes.md
      skip.md
      stage-fixed.md
      wrap-commands.md
  samples/
    README.md
    basic-setup.md
    parallel-execution.md
    auto-fix-and-stage.md
    commitlint-integration.md
    local-override.md
    conditional-skip.md
    monorepo-setup.md
    shared-config-via-remotes.md
  scripts/
    README.md
    cli.md
    install.md
    run-with-env.md

探索步骤

根据任务查找对应类别,再通过该类别的 README.md 找到目标页面:

  1. 在下方映射表中查找与任务对应的类别
  2. 参阅该类别的 references/{category}/README.md,找到目标页面
  3. Read 相应的 .md 页面以查看详情

任务 → 类别映射

任务类别参考 README
安装和设置 Lefthookinstallationreferences/installation/README.md
通过 npm / yarn / pnpm / pip / gem / composer 安装installationreferences/installation/README.md
通过 Homebrew / Scoop / Winget / APK / AUR 安装installationreferences/installation/README.md
手动安装二进制文件、支持 mise / devboxinstallationreferences/installation/README.md
lefthook.yml 全局配置configurationreferences/configuration/README.md
Hook 配置(parallel, piped, follow, skip)configurationreferences/configuration/README.md
Command 配置(run, glob, files, stage_fixed)configurationreferences/configuration/README.md
Script 配置、更改 source_dirconfigurationreferences/configuration/README.md
通过 remotes 共享配置configurationreferences/configuration/README.md
AI Agent hooks(ai: 生成 claude / codex / cursor / copilot 的 hooks 配置文件)configurationreferences/configuration/README.md
编辑器补全、JSON schema(lefthook.dev/schema.json)configurationreferences/configuration/README.md
lefthook install / run / add / validate / dumpusagereferences/usage/README.md
通过环境变量(LEFTHOOK、LEFTHOOK_VERBOSE 等)控制usagereferences/usage/README.md
commitlint / Commitizen 集成examplesreferences/examples/README.md
文件筛选(glob / staged_files / tags)examplesreferences/examples/README.md
通过 lefthook-local.yml 进行本地覆盖examplesreferences/examples/README.md
条件跳过、分支限制examplesreferences/examples/README.md
当前分支为 main / master 时通过 pre-push 阻止 push(不判断 push 目标 ref)examplesreferences/examples/README.md
了解典型用法samplessamples/README.md
了解安装、CLI 命令scriptsscripts/README.md

评论

支持 Markdown