# Quality and checks

Run the deterministic checks, self-test the harness and trace where a value comes from.

## audit-page

Check a complete HTML page using this design system for a level-one heading and main landmark. This static check is not a full accessibility audit.

```
sketchbook audit-page <file> [--json]
```

Read-only.

| Argument | Meaning |
| --- | --- |
| `file` | HTML file to check, relative to the current project |

**Examples**

- `sketchbook audit-page preview.html`
- `sketchbook audit-page preview.html --json`

## audit-decisions

Compare the decision log with a trusted earlier copy or Git revision and report changes to settled entries. This read-only audit does not replace check X1.

```
sketchbook audit-decisions [baseline] [--git-ref <ref>] [--json]
```

Read-only.

| Argument | Meaning |
| --- | --- |
| `baseline` (optional) | Path to a trusted earlier copy of spec/decisions/DECISIONS.md |

| Option | Meaning |
| --- | --- |
| `--git-ref` | Compare against the committed log at this Git revision (for example HEAD) |

**Examples**

- `sketchbook audit-decisions ../decisions-before.md`
- `sketchbook audit-decisions --git-ref HEAD --json`

## check

Run the deterministic checks (exit 0 pass, 1 fail, 2 pass with flagged overrides).

```
sketchbook check [--only <T1,T6>] [--fix] [--verbose] [--maintainer] [--json]
```

Read-only.

| Option | Meaning |
| --- | --- |
| `--only` | Run a subset of checks by id |
| `--fix` | Rebuild generated outputs first (the only automatic fix) |
| `--verbose` | List every check, not only failures and warnings |
| `--maintainer` | Also require the Storybook and docs site builds to be current (O1) and that every shipped component is documented in every output (M1); maintainers only |

**Examples**

- `sketchbook check`
- `sketchbook check --only T6`
- `sketchbook check --maintainer`
- `sketchbook check --json`

## selftest

Run the harness's own tests against the installed engine: they prove every check can still reject and that the CLI, starters and generators work (what npm run test:harness runs in a project).

```
sketchbook selftest [--json]
```

Read-only.

**Examples**

- `sketchbook selftest`

## explain

Explain a token, CSS variable, component, tag or decision from the spec.

```
sketchbook explain <thing...> [--json]
```

Read-only.

| Argument | Meaning |
| --- | --- |
| `thing` | Token path, --css-var, component name, tag, SB-NNNN or free text |

**Examples**

- `sketchbook explain color.primary`
- `sketchbook explain button`
- `sketchbook explain SB-0024`
