burgee
Packages

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 hookset

Install it as a dev dependency (-D) beside lefthook. It needs git.

Quick start

npm install hookset
import { 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.yml

hookset 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
CommandExit 1 when
inita lefthook.yml written by hand is already there and --force is not given
checka 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 --json and init --json print burgee's --json envelope, every problem with a message that ends in fix:.
  • --json, --schema and an MCP server come from one declaration on burgee: hookset --mcp serves its commands as tools.
  • The Claude Code hook pack is what an agent meets first: a denied --no-verify names the hook to fix instead.
  • The docs are machine-readable at burgee.interlace.tools/llms.txt.

API

ImportWhat it gives you
hooksetparseRemotes(), 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.

PackageWhat it isMigrates from
burgeeThe CLI framework: one declaration, every surfacecommander, yargs and meow
roundelColour: one output policy, semantic tokens, a themechalk, colorette, kleur, picocolors, supports-color and yoctocolors
flagstaffThe frame loop: spinners, progress, boxes and tablesora, log-update, boxen and cli-table3
caiquePrompts that are flags first, and never hang@inquirer/core
linegaugeMeasuring, wrapping, truncating and slicing styled textstring-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line
paratextHyperlinks, images, title, clipboard and notificationsansi-escapes, terminal-link and term-img
seniorityConfiguration precedence and discovery, with provenancecosmiconfig, lilconfig, dotenv and rc
closeoutExit handlers, terminal restore and a bounded shutdownsignal-exit, exit-hook, restore-cursor, cli-cursor and onetime
bellpullSubprocesses, and which executable actually rancross-spawn and which
controlroomKeyboard-driven terminal screens, inline or full-screenink
oxmutateMutation testing on the oxc engine, inside your own VitestStryker
truepassLint rules and a pre-push check that keep a test suite honest@vitest/eslint-plugin
contractdiffAPI contracts: breaking-change diff, lint, and code from the specopenapi-typescript
truefitValidation whose schemas are data, with no evalzod
provedoneA receipt for how every change was verified, and a gate that reads it@commitlint/cli
replzRecall of a reviewer and its checks, replayed on bugs that shippedpromptfoo
hookset (this package)The same git and Claude Code hooks in every repository, pinned by taghusky
triggerlistThe review checklist a diff selects, read from the base branchdanger

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.

On this page