# The check

> design check finds anything on your screens that is not in your guide.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/screens/the-check/

For agents: design check (CLI, SDK, CI, MCP check tool): reads design/, src/design/, the app's source (TSX/JSX/CSS/MDX/Astro) and cases/. Findings with codes: raw-color, raw-size (px/rem outside tokens), raw-font, unknown-piece (import not from src/design or not in gallery.yaml), base-import (imports @sypnia/base directly), unknown-icon (SVG or icon library not in design/icons), icon-rules, missing-screen (case with where and no screen file), missing-state (outcome/failure not designed), screen-out-of-date, contrast, focus (no visible focus state), touch-target (< size.touch on phone render), first-screen (main content below the fold at 1366×700 or 390×844), voice (tell text too long, codes, avoided words), guide-drift (tokens.json vs guide.md vs tokens.css), components-out-of-date. Severity error|warning; exit 1 on errors; --json; waivers in sypnia.toml [[design.checks.waive]] {code, path, reason, until}. Renders-based checks (touch-target, first-screen, contrast in context) need a browser (local Chromium) or Cloud.

```bash
npx @sypnia/design check
```

```text
src/app/order/page.tsx:42  raw-color      #F5D76E is not a colour of the guide (closest: color.accent)
src/app/order/page.tsx:57  unknown-piece  <Badge> is not in gallery.yaml
cases/orders/place-order    missing-state  failure.Closed has no design
design check: 2 errors, 1 warning
```

## What it checks

| Code                                | Finds                                                                                |
| ----------------------------------- | ------------------------------------------------------------------------------------ |
| `raw-color`, `raw-size`, `raw-font` | a colour, size or font written by hand instead of a token                            |
| `unknown-piece`                     | a piece that does not come from `src/design/` or is not in `gallery.yaml`            |
| `base-import`                       | a screen importing `@sypnia/base` directly                                           |
| `unknown-icon`, `icon-rules`        | an icon from outside `design/icons/`, or one that breaks the construction rules      |
| `missing-screen`                    | a case with a `where` and no screen file                                             |
| `missing-state`                     | an outcome or failure of a case with no designed state                               |
| `screen-out-of-date`                | a screen designed with an older guide or an older version of its case                |
| `contrast`                          | text or controls under the guide's contrast minimums, measured on the render         |
| `focus`                             | a piece with no visible keyboard focus                                               |
| `touch-target`                      | something pressable smaller than `size.touch` on the phone render                    |
| `first-screen`                      | the main content of a `first_screen` screen does not fit at 1366 × 700 or on a phone |
| `voice`                             | a message that is too long, shows a code, or uses a word the guide avoids            |
| `guide-drift`                       | `guide.md`, `tokens.json` and `tokens.css` disagree                                  |
| `components-out-of-date`            | pieces generated from an older guide                                                 |

Each finding is an `error` or a `warning`. The command exits with `1` when there are errors, so a pipeline stops; `--json` prints the findings for tools.

## Where it runs

- **Before the agent proposes a change.** The Design skills run it and fix what they can.
- **On every pull request,** in Sypnia Git or any CI.
- **In the console and App,** next to each screen.

The checks that need a picture (`contrast` in context, `touch-target`, `first-screen`) use a browser: Chromium on your machine, or the renderer in Sypnia Cloud.

## Waivers

Sometimes a rule must bend, for a while. A waiver needs a reason and an end date:

`sypnia.toml (part)`

```toml
[[design.checks.waive]]
code = "raw-color"
path = "src/app/legacy/receipt.tsx"
reason = "Old receipt screen, replaced by place-order's outcome"
until = 2027-01-31
```
