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 anotherlefthook-local.*file- Git hooks such as
pre-commit,commit-msg,pre-push,post-merge, orpost-checkout lefthook install,lefthook run,lefthook dump, orlefthook validate- choosing between
commands,jobs, andscripts - 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
- Inspect the repository before writing config. Reuse the existing config filename and format if one already exists.
- Match hook commands to the repo's real toolchain. Reuse existing package manager commands, scripts, and linters instead of inventing wrappers.
- Choose the simplest structure that fits. Use
commandsby default,jobsfor ordering or grouping, andscriptsonly for executable hook files. - Use placeholders and filters that match the hook type.
pre-commitusually wants{staged_files},pre-pushusually wants{push_files}, andcommit-msgusually wants{1}.