hookset
Git hooks presets for AI coding agents: lefthook presets pulled by a pinned tag, a Claude Code hook pack that denies skipped hooks, and `hookset init` and `check`. No dependency outside the burgee family. A husky migration path.
hookset puts the same verification stations in every repository: lefthook presets for
commit-msg, pre-commit and pre-push, pulled through lefthook remotes at a pinned
hookset@<version> tag, and a Claude Code hook pack that denies a skipped hook, a moved
core.hooksPath and a hand-rolled CI polling loop. Each preset step calls the repository's own
script by a declared name, so the preset is the same everywhere and the repository decides what
runs. hookset init writes the smallest lefthook.yml that pulls them; hookset check fails a
repository whose hooks miss a station, pin no version, repeat a preset step or drift from the pack.
It covers the install half of husky: where husky keeps a hook script in each repository,
hookset keeps one pinned set for all of them and checks each repository against it. Every command
prints burgee's --json envelope, each problem with its fix: line, for a pipe or an agent.
Install
npm install hookset
pnpm add hookset
yarn add hookset
bun add hooksetInstall it as a dev dependency (-D) beside lefthook. It needs git.
Quick start
npm install hooksetimport { parseRemotes } from "hookset";
// The remote `hookset init` writes into lefthook.yml, pinned to a release tag.
const lefthook = `remotes:
- git_url: https://github.com/ofri-peretz/burgee
ref: hookset@0.2.1
configs:
- packages/hookset/presets/lefthook/pre-push.yml
`;
for (const remote of parseRemotes(lefthook)) console.log(`${remote.ref ?? "no ref"}: ${remote.configs.join(", ")}`);hookset@0.2.1: packages/hookset/presets/lefthook/pre-push.ymlhookset check reads the same remotes and fails when one is pinned to a branch rather than a tag.
What it checks
hookset init # the smallest lefthook.yml that pulls the presets, pinned to this version
hookset init --claude # and the Claude Code hook pack under .claude/hooks/
hookset check # the CI gate: exit 1 on any error, warnings listed
hookset check --json # the problems as data, one fix line each| Command | Exit 1 when |
|---|---|
init | a lefthook.yml written by hand is already there and --force is not given |
check | a station is missing, a remote pins no hookset@<version> tag, a preset step is repeated, or a vendored hook drifts from the pack |
Migrating
The switch is one command, npx hookset init, and husky's folder comes out:
// package.json
"scripts": {
- "prepare": "husky",
+ "prepare": "lefthook install",
}npx hookset init writes lefthook.yml; move each .husky/<hook> script into the
hook:provedone, hook:staged or hook:verify script its station calls, then delete .husky/.
Compatibility
Not graded: hookset reads and writes a repository's hook configuration, and no suite is graded against it. It runs anywhere git and lefthook do.
Benchmarks
Every number here is produced by npm run bench and published at burgee.interlace.tools/docs/benchmarks.
No suite is graded against this package yet, so there is no compatibility number to quote.
For agents
hookset check --jsonandinit --jsonprint burgee's--jsonenvelope, every problem with a message that ends infix:.--json,--schemaand an MCP server come from one declaration on burgee:hookset --mcpserves its commands as tools.- The Claude Code hook pack is what an agent meets first: a denied
--no-verifynames the hook to fix instead. - The docs are machine-readable at burgee.interlace.tools/llms.txt.
API
| Import | What it gives you |
|---|---|
hookset | parseRemotes(), checkRepo(), checkText(), initRepo(), lefthookTemplate(), loadStations() and program |
The hookset bin is that API, declared once on burgee.
Requirements
Node 22.13 or later, git and lefthook.
Where it sits
It hosts no plugin key of its own.
Nothing in this family builds on it yet, and it builds on burgee.
The family
18 packages, one repository, one release pipeline. Each installs and works on its own, and each owns
one job. Seven of them — bellpull, closeout, linegauge, paratext, roundel, seniority,
truefit — depend on nothing; the others depend only on packages in this table, and every
dependency points one way, down the layers.
No package declares a dependency from outside the family; react and react-reconciler are
optional peers of controlroom, which npm does not install; vitest is an optional peer of
oxmutate, which npm does not install; eslint is an optional peer of truepass, which npm does
not install.
package-shape-lock
holds that for every manifest, and
independence-install-lock
installs each package alone and finds nothing but the family packages it declares.
Releases are published by one workflow through npm trusted publishing: no npm token is used, and
each release carries SLSA provenance, which npm view <package> dist.attestations shows.
trusted-publishing-lock
keeps both true.
| Package | What it is | Migrates from |
|---|---|---|
| burgee | The CLI framework: one declaration, every surface | commander, yargs and meow |
| roundel | Colour: one output policy, semantic tokens, a theme | chalk, colorette, kleur, picocolors, supports-color and yoctocolors |
| flagstaff | The frame loop: spinners, progress, boxes and tables | ora, log-update, boxen and cli-table3 |
| caique | Prompts that are flags first, and never hang | @inquirer/core |
| linegauge | Measuring, wrapping, truncating and slicing styled text | string-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line |
| paratext | Hyperlinks, images, title, clipboard and notifications | ansi-escapes, terminal-link and term-img |
| seniority | Configuration precedence and discovery, with provenance | cosmiconfig, lilconfig, dotenv and rc |
| closeout | Exit handlers, terminal restore and a bounded shutdown | signal-exit, exit-hook, restore-cursor, cli-cursor and onetime |
| bellpull | Subprocesses, and which executable actually ran | cross-spawn and which |
| controlroom | Keyboard-driven terminal screens, inline or full-screen | ink |
| oxmutate | Mutation testing on the oxc engine, inside your own Vitest | Stryker |
| truepass | Lint rules and a pre-push check that keep a test suite honest | @vitest/eslint-plugin |
| contractdiff | API contracts: breaking-change diff, lint, and code from the spec | openapi-typescript |
| truefit | Validation whose schemas are data, with no eval | zod |
| provedone | A receipt for how every change was verified, and a gate that reads it | @commitlint/cli |
| replz | Recall of a reviewer and its checks, replayed on bugs that shipped | promptfoo |
| hookset (this package) | The same git and Claude Code hooks in every repository, pinned by tag | husky |
| triggerlist | The review checklist a diff selects, read from the base branch | danger |
Every migration guide, and the family-wide compatibility and benchmarks pages, are on burgee.interlace.tools.
Contributing
Issues and pull requests are welcome at ofri-peretz/burgee; read CONTRIBUTING.md first. Report a vulnerability privately, as SECURITY.md describes — never in a public issue.
Licence
MIT © Ofri Peretz — see LICENSE.
contractdiff
Breaking-change diff, lint and code generation for API contracts (OpenAPI, JSON Schema, AsyncAPI, MCP), and the spec back from the code. No dependency outside the burgee family. An openapi-typescript migration path.
provedone
Verified commits for JS and TS repos: each commit carries a receipt of the command that proved it, each intent a done check, and a gate reads both. No dependency outside the burgee family. A @commitlint/cli migration path.