0011. A pre-push hook builds and smoke-tests every app

accepted Decided 23 November 2026

Context

The user asked for a pre-push hook that builds the apps and checks they aren't crashing.

Options

  1. CI (e.g. GitHub Actions): runs on the server, but only after the push, and needs setup and a remote.
  2. Husky or lefthook: popular, but adds a dependency and a root package.json for one hook.
  3. Plain git hook in a versioned .githooks/ folder, enabled with git config core.hooksPath .githooks: no dependencies, and the logic lives in a script that can also be run by hand.

Decision

Option 3. .githooks/pre-push runs scripts/check-apps.sh. For every app in apps/ it:

  1. installs dependencies if they're missing;
  2. lints;
  3. runs a production build;
  4. starts the production server and requests key routes, each of which must return the expected status (including a 404 for an unknown page). The server must not crash or log errors.

The website check takes about 8 seconds. git push --no-verify skips it once.

Consequences

  • Each clone must run git config core.hooksPath .githooks once; this is in AGENTS.md and the README.
  • Because the site is built from docs/, a doc edit that breaks the site's parsers also blocks the push.
  • When the project gets CI, the same script can run there.

Follow the research

Occasional notes from the lab as the factory takes shape: what we tried, what worked, and what didn’t.