The hook
On a frozen board, save this as .git/hooks/pre-commit and make it executable:
#!/bin/sh
npx briefatto-board check . "outputs/*.html"The quotes pass the glob to Board, which expands it itself, so the same line works in PowerShell on Windows.
What stops the commit
- Text that is clipped, off the canvas, over other text or too small where it is seen.
- A font that never loaded, and contrast below WCAG.
- Anti-patterns found by the Impeccable detector.
- A delivery PNG or PDF listed in
deliverables.jsonthat does not match its editable HTML. A PNG must match every decoded RGBA pixel.
In CI
Run the same command as a step after installing dependencies. board check writes a receipt that records which checks ran, so the log says what was tested as well as what failed.
Questions and answers
Does it check exported PNG and PDF files too?
Yes. Board decodes every file listed in deliverables.json, compares it with its HTML source and records in the receipt the SHA-256 of the checked bytes.
Does the hook need a browser?
Yes, Chromium. If it is missing, the first render prints the Playwright command that installs it.
Is Briefatto Board free?
Yes. It is open source under the Apache-2.0 licence and installs with npx briefatto-board install.