Skip to content
lawbook
Esc
↑↓navigate↵open⌘Jpreview
On this page

Introduction

Lawbook checks code standards with repeatable rules and LLM decisions.

Lawbook checks a directory against the rules in its lawbook.yaml. Most rules are repeatable: the same files always give the same result, and a failing rule names the file and line that broke it. A standard rule states a standard in prose and lets a model judge each file against it. Lawbook ships as an npm package and needs Node.js 22.12 or newer.

npm install --global lawbook
lawbook init
lawbook check
  • Getting started walks through the first run.
  • Configuration describes the rule kinds and the config file.
  • LLM rules explains standard rules and how to write one.
  • Clean-code example is a drop-in lawbook.yaml built from ten software engineering books.
  • Providers configures the Claude Code, Codex, or Kiro CLI, so a subscription pays for standard rules.
  • Suppressions turns a rule off for a line or a file with a comment.
  • Baseline records today’s findings so only new ones fail.
  • Commands lists every command and flag.
  • Exit codes says what 0, 1, and 2 mean.

Build from source

With Node.js 22.12 or newer and pnpm, from a clone of the repository:

pnpm install
pnpm run build
npm install --global .

Then check the install:

lawbook --version

Last updated on October 9, 2026

Was this page helpful?