lefthook

Installation
SKILL.md

Lefthook

Create or update Lefthook configuration with exact option names, practical defaults, and clear debugging steps. Explain the tool briefly, then produce a working config for the current repository.

Use this skill when the task mentions:

  • lefthook.yml, .lefthook.yml, .config/lefthook.yml, lefthook-local.yml, or another lefthook-local.* file
  • Git hooks such as pre-commit, commit-msg, pre-push, post-merge, or post-checkout
  • lefthook install, lefthook run, lefthook dump, or lefthook validate
  • choosing between commands, jobs, and scripts
  • placeholders such as {staged_files}, {push_files}, {all_files}, {files}, or {1}
  • hook bugs such as commands not running, wrong files matching, fixed files not restaged, or local-only wrappers leaking into shared config

Non-Negotiables

  1. Inspect the repository before writing config. Reuse the existing config filename and format if one already exists.
  2. Match hook commands to the repo's real toolchain. Reuse existing package manager commands, scripts, and linters instead of inventing wrappers.
  3. Choose the simplest structure that fits. Use commands by default, jobs for ordering or grouping, and scripts only for executable hook files.
  4. Use placeholders and filters that match the hook type. pre-commit usually wants {staged_files}, pre-push usually wants {push_files}, and commit-msg usually wants {1}.
Installs
5
GitHub Stars
3
First Seen
Apr 3, 2026