Git Hooks With Lefthook
Lefthook orchestrates the repository Git hooks so local checks stay fast and consistent across contributors.
pre-commit: runsnpx ultracite fix {staged_files}and re-stages modified filescommit-msg: runspnpm exec commitlint --edit {1}pre-push: runspnpm pre-push, which invokes the pre-push validation script from@repo/scriptsprepare: runslefthook installto refresh the delegated hook shims committed under.githooks/
This repository uses core.hooksPath=.githooks, so contributors execute the checked-in .githooks/* entrypoints and those shims delegate into Lefthook. lefthook install updates that delegated hook layer instead of writing a separate set of hooks under .git/hooks.
Pre-push validation
Section titled “Pre-push validation”- Change detection for workspaces based on recent diffs
- Runs repo-wide
pnpm lintandpnpm format:check - Runs package-scoped
typecheck,build,knip, and coverage tests for changed workspaces - Blocks the push on failures, prints actionable output
Commitlint
Section titled “Commitlint”- Enforces Conventional Commits; supports scopes for apps/packages and multi-line messages
- Examples:
feat(server): add rate limiterfix(ui): correct button focus statechore: update dependencies