Check the hooks in CI
Run `hookset check` on every pull request, either through burgee's reusable hookset-check workflow, which needs no install or build, or as one step of a job that already ran `npm ci`.
A hook only runs on a machine where someone installed it. CI is where a repository proves its hooks are still wired: the station scripts are declared, the presets are pinned, and the Claude pack has not drifted.
The reusable workflow
jobs:
hookset:
uses: ofri-peretz/burgee/.github/workflows/hookset-check.yml@mainWhat hookset-check.yml
does:
- Reads the
hookset@<version>tag the caller'slefthook.ymlpins. No tag fails the job with the fix: runhookset init. - Checks out
packages/hooksetfrom the burgee repository at that tag, sparse, beside the caller. - Runs
src/core.tsunder Node 24's type stripping: nonpm ci, no build. - Prints the same text
hookset checkprints, plus a GitHub annotation per problem, and fails on any error.
Because it checks against the tag the repository pins, a repository is judged by the presets it
chose, not by whatever burgee's main holds today. It needs contents: read and nothing else.
The workflow is called at @main, which moves. A repository that wants the workflow itself
pinned can call it at a commit SHA instead.
As a step
A repository that already installs its dependencies in a job can run the installed bin:
- run: npm ci
- run: npx hookset checkThis checks against the hookset version in the lockfile, so it also warns when the ref is
behind that version.
Reading it from a script
npx hookset check --json prints one envelope: data.problems is the list, each with id,
severity, message and fix (The two commands). A bot that comments
on pull requests can post the fix lines as they are.
Coming from husky
Move a repository from husky to hookset: each .husky/ script becomes the station script its hook calls, `prepare` runs lefthook instead, and hookset init writes the lefthook.yml. A concept map, the steps, what differs on purpose and what is not built.
Monorepo
Wire hookset once at the root of a monorepo: one lefthook.yml, one package.json whose hook:staged and hook:verify scripts hand off to the workspace tool, and check run from the root or with --cwd.