arbiterdesign 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,201 +1,514 @@
1
- # Arbiter
1
+ <div align="center">
2
2
 
3
- A decision layer for AI-generated UI. Records the design calls made during agent-assisted UI work — what was chosen, what was rejected, and why — and feeds them back into the agent's context so the same call never has to be made twice.
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset=".github/assets/banner-dark.svg">
5
+ <img src=".github/assets/banner-light.svg" alt="arbiter. Design decisions that stick. Reasons that survive." width="100%">
6
+ </picture>
7
+
8
+ ### The decision layer for agent-built UI
9
+
10
+ [![npm](https://img.shields.io/npm/v/arbiterdesign?style=flat-square&color=171717&label=npm)](https://www.npmjs.com/package/arbiterdesign)
11
+ [![Status: beta](https://img.shields.io/badge/status-beta-171717?style=flat-square)](https://arbiter.design/changelog)
12
+ [![License: MIT](https://img.shields.io/badge/license-MIT-171717?style=flat-square)](LICENSE)
13
+ [![Node](https://img.shields.io/badge/node-%3E%3D20-171717?style=flat-square)](package.json)
14
+ [![Claude Code](https://img.shields.io/badge/works%20with-Claude%20Code-171717?style=flat-square)](https://claude.com/claude-code)
15
+ [![Cursor](https://img.shields.io/badge/works%20with-Cursor-171717?style=flat-square)](https://cursor.com)
16
+
17
+ **[Website](https://arbiter.design)** · **[Live demo](https://arbiter.design/p/acme)** · **[Start guide](https://arbiter.design/get-started)** · **[Changelog](https://arbiter.design/changelog)**
18
+
19
+ [Quick start](#quick-start) · [How it works](#how-it-works) · [Share with your team](#share-it-with-your-team) · [Commands](#commands) · [FAQ](#faq)
20
+
21
+ </div>
22
+
23
+ <br>
24
+
25
+ ## What is Arbiter?
26
+
27
+ Arbiter is a decision record for teams building UI with AI agents like Claude Code and Cursor.
28
+
29
+ As your agent builds, it writes down the design calls it makes: what it chose, what it beat, and why. You approve them in seconds. The agent follows them next time, and everyone on your team can read them.
30
+
31
+ It's documentation that writes itself.
32
+
33
+ <p align="center">
34
+ <picture>
35
+ <source media="(prefers-color-scheme: dark)" srcset=".github/assets/board-dark.png">
36
+ <img src=".github/assets/board-light.png" alt="A screen on the Arbiter board: the Settings page, the reason it won, who decided it, and the tabs version it replaced." width="80%">
37
+ </picture>
38
+ </p>
39
+
40
+ <p align="center"><sub>A screen on the board: what was decided, who decided it, and what it beat. <a href="https://arbiter.design/p/acme">Try the live demo</a>.</sub></p>
41
+
42
+ ## What you get
43
+
44
+ ### Consistency
45
+
46
+ **Your agent follows your design rules.**<br>
47
+ Make a call once and it becomes a rule in `DECISIONS.md`, which the agent reads before any UI work. No more re-explaining.
48
+
49
+ ### Traceability
50
+
51
+ **Build fast without losing the why.**<br>
52
+ Every design decision and change is recorded as it's made: what was chosen, what it beat, who decided and when.
53
+
54
+ ### Visibility
55
+
56
+ **See every decision in one place.**<br>
57
+ Publish a board so you and your team can see each screen, the decisions made on it, and what lost.
58
+
59
+ ## Why Arbiter
60
+
61
+ Building with an agent means making product decisions all day, and nobody keeps track of them.
62
+
63
+ - **The agent forgets between sessions.** On Tuesday you tell it *"no tabs, keep settings on one page."* On Thursday, in a new session, the tabs are back.
64
+ - **Nothing gets written down.** Five screens ship before lunch, each one full of calls about layout, copy and flow. None of them are recorded anywhere.
65
+ - **The reasoning gets lost.** Someone asks in review why it's a modal. There was a good reason, but it was in a chat three weeks ago.
66
+
67
+ Arbiter fixes that without adding work:
68
+
69
+ - 📄 **It's just files in your repo.** Rules live in `DECISIONS.md`. Plain markdown, reviewed in pull requests like everything else.
70
+ - 🤫 **It stays out of the way.** No popups while you iterate. The agent queues what it decided and you judge it when you're ready.
71
+ - 🧭 **It informs, it doesn't enforce.** Rules shape what the agent builds. Nothing blocks a build.
72
+
73
+ ## Quick start
4
74
 
5
75
  ```bash
6
76
  npx arbiterdesign init
7
77
  ```
8
78
 
9
- That's the whole install. It writes:
79
+ That's the whole install. Run it in the folder your agent works in, or ask the agent to run it. It detects Claude Code or Cursor, teaches your agent the protocol, and adds `arbiterdesign` to your devDependencies, which is what makes the shorter `npx arbiter` work from then on. Running it twice changes nothing.
80
+
81
+ No `package.json` in the project? Add `arbiterdesign` as a dev dependency yourself. New to the terminal? Follow the [step-by-step guide](https://arbiter.design/get-started).
82
+
83
+ If you want the agent to take screenshots of the screens it changes, tell it where your app runs:
84
+
85
+ ```bash
86
+ npx arbiter setup --app http://localhost:3000
87
+ ```
88
+
89
+ Then build UI the way you normally do. Arbiter picks it up from there.
10
90
 
11
- | File | What it is |
91
+ <details>
92
+ <summary><b>The files Arbiter keeps in your repo</b></summary>
93
+ <br>
94
+
95
+ | File | What it's for |
12
96
  |---|---|
13
- | `DECISIONS.md` | Active rules, grouped by dimension. Capped at 40. The agent reads this before UI work. |
14
- | `.arbiter/archive.md` | Every decision ever, append-only. Never loaded into the agent. |
97
+ | `DECISIONS.md` | Your active rules, grouped by type. Capped at 40. The agent reads this before UI work. |
98
+ | `.arbiter/archive.md` | Every decision ever made, append-only. Never loaded into the agent. |
15
99
  | `.arbiter/pending.md` | Decisions the agent queued that you haven't judged yet. |
16
- | `.arbiter/candidates/` | One page per generated screen or direction, with its state, snapshot, decisions, and why it lost. |
17
- | `CANDIDATES.md` | Index of candidates — written only when `destination` is `git`. |
18
- | `.claude/skills/arbiter/SKILL.md` or `.cursor/rules/arbiter.mdc` | Tells the agent to surface its decisions after UI work and record what you confirm. |
19
- | `arbiter.json` | Config. `destination: "local"`. `app.url` (from `npx arbiter setup --app http://localhost:3000`) is where the agent opens screens for pictures. |
20
- | `AGENTS.md` | One line appended, pointing at `DECISIONS.md`. Merged, never overwritten. |
21
- | `CLAUDE.md` (Claude Code) / `.cursor/commands/arbiter.md` (Cursor) | Same pointer line in Claude Code's own context file; a `/arbiter` command for Cursor. |
100
+ | `.arbiter/candidates/` | One page per generated screen or direction: its state, snapshot, decisions, and why it lost. |
101
+ | `.arbiter/work/` | One picture per piece of work, when the agent could take one. `publish` carries it to the board. |
102
+ | `.arbiter/hosted.json`, `comments.json`, `requests.json` | Which hosted board is yours, and the comments and change requests `pull` brings back. |
103
+ | `CANDIDATES.md` | Index of candidates. Only written when `destination` is `git`. |
104
+ | `.claude/skills/arbiter/SKILL.md` or `.cursor/rules/arbiter.mdc` | Tells the agent to check your rules before UI work, ask when something clashes with one, then surface its decisions and record what you confirm. |
105
+ | `arbiter.json` | Config. `app.url` is where the agent opens screens for pictures. |
106
+ | `AGENTS.md` | One line appended, pointing at `DECISIONS.md`. It tells the agent to ask before building when your request or the design system goes against a rule, and that a rule written as an exception beats the design system. Merged, never overwritten. A newer `init` refreshes only that line. |
107
+ | `CLAUDE.md` / `.cursor/commands/arbiter.md` | The same pointer for Claude Code, and an `/arbiter` command for Cursor. |
22
108
 
23
- Running `init` twice changes nothing.
109
+ </details>
24
110
 
25
111
  ## How it works
26
112
 
27
- 1. You ask the agent to build a screen. It reads `DECISIONS.md` first. After a sizeable piece of work it names up to three rules that shaped it, *Following D-0001 (removing asks first, no undo bar)*, so you can see the record working. How often follows the check-in setting: never under `quiet`, every time a rule changed something under `every`.
28
- 2. You iterate. It says nothing about decisions while you're iterating — each version you move past becomes a rejected alternative on the one that replaced it.
29
- 3. When you move on, it queues the design calls it made — sized as `feature`, `pattern`, or `polish` — and, after feature-level work, says one line about what changed. When 5 changes are waiting (then 10, 15…), it asks in plain text whether you want to review them now; polish doesn't count, and `setup --checkin quiet` turns both off.
30
- 4. You judge them when you want — in chat with `/arbiter`, or in the browser with `npx arbiter review`. Grouped by piece of work; each item reads **Change** (what happened) / **Pattern** (the rule) / **Rejected** (what lost). Per item: **Confirm**, **Make it a rule**, **Skip**, or type a correction. Polish is one line per group — **Confirm all**. In chat, an item that goes against an active rule says so (*Clashes — D-0009*) and asks which wins: **Follow D-0009**, **Replace D-0009**, or **Keep as exception**.
31
- 5. Rules enter `DECISIONS.md`. Everything judged enters the archive. Skips vanish.
113
+ ```mermaid
114
+ flowchart TB
115
+ %% The team lane is declared first so it renders below the repo lane.
116
+ subgraph team ["With your team"]
117
+ direction LR
118
+ H[Board on<br/>arbiter.design] --> I[Teammates<br/>comment or ask<br/>for a change]
119
+ end
120
+ subgraph repo ["In your repo"]
121
+ direction LR
122
+ A([You ask for<br/>a screen]) --> B[Agent reads<br/>your rules<br/>and builds]
123
+ B --> C[Design calls<br/>get queued]
124
+ C --> D{You judge}
125
+ D -- Make it a rule --> E[(DECISIONS.md<br/>read next session)]
126
+ D -- Confirm --> F[(Archive)]
127
+ D -- Skip --> G[Gone]
128
+ end
129
+ repo -- npx arbiter publish --> team
130
+ team -- npx arbiter pull --> repo
131
+ classDef teamNode fill:#2da44e1f,stroke:#2da44e
132
+ class H,I teamNode
133
+ style repo fill:transparent,stroke:#8f8f8f,stroke-dasharray:4 4
134
+ style team fill:#2da44e0d,stroke:#2da44e,stroke-dasharray:4 4
135
+ linkStyle 7,8 stroke:#2da44e
136
+ ```
137
+
138
+ 1. **You ask for a screen.** The agent reads `DECISIONS.md` first. After a sizeable piece of work it names up to three rules that shaped it, like *Following D-0001 (removing asks first, no undo bar)*, so you can see the record working.
139
+ 2. **You iterate.** The agent says nothing about decisions while you're going back and forth. Each version you move past becomes a rejected alternative on the one that replaced it.
140
+ 3. **You move on.** The agent queues the design calls it made, sized as `feature`, `pattern` or `polish`. When 5 are waiting (then 10, 15…) it asks if you want to review them. Polish doesn't count toward that. Only real choices get queued: things you asked for, things you corrected, and options the agent actually weighed. Its habits don't.
141
+ 4. **You judge them when you want.** In chat with `/arbiter`, or in the browser with `npx arbiter review`.
142
+ 5. **Rules go into `DECISIONS.md`.** Everything you judged goes into the archive. Skipped items disappear. The next session reads the new rules.
143
+ 6. **You share it.** `npx arbiter publish` puts the board online, so your team can see each screen, what was decided and why. They can comment or request a change, and `npx arbiter pull` brings that back for you to answer. More in [Share it with your team](#share-it-with-your-team).
32
144
 
33
- You can also just say it: *"make that a rule"*, *"reject the tabs, going with a single page"*. It records without asking.
145
+ You can also just say it: *"make that a rule"*, or *"reject the tabs, going with a single page."* The agent records it without asking.
34
146
 
35
- Nothing enforces anything. Rules inform generation; they don't gate it.
147
+ ### What a rule looks like
36
148
 
37
- ## Commands
149
+ ```markdown
150
+ ### D-0001 · Destructive actions confirm in a modal, never inline
151
+
152
+ - **Change:** The delete-project link now opens a confirm modal
153
+ - **Rationale:** Inline confirms get clicked through; a modal forces the pause.
154
+ - **Rejected:**
155
+ - Inline confirm — clicked through without reading
156
+ - **Trigger:** Delete-project flow used an inline "Are you sure?" link
157
+ - **Scope:** pattern:destructive-confirm · **Dimension:** interaction · **Level:** pattern
158
+ ```
159
+
160
+ ### Judging the queue
161
+
162
+ Each item reads as **Change** (what happened), **Pattern** (the rule) and **Rejected** (what lost). For each one you pick:
163
+
164
+ | Action | What happens |
165
+ |---|---|
166
+ | **Confirm** | Goes into the archive as a one-off. |
167
+ | **Make it a rule** | Goes into `DECISIONS.md`. The agent follows it from now on. |
168
+ | **Skip** | Thrown away. |
169
+ | **Fix** | Type a correction and it's recorded your way. |
170
+
171
+ Polish items come as one line per group with a single **Confirm all**. If an item goes against an existing rule, Arbiter says so (*Clashes with D-0009*) and asks which one wins: **Follow D-0009**, **Replace D-0009**, or **Keep as exception**.
172
+
173
+ > [!TIP]
174
+ > Too chatty? `npx arbiter setup --checkin quiet` turns off the check-ins. `--checkin every` does the opposite and mentions a rule every time one changed something.
175
+
176
+ ### When something clashes with a rule
177
+
178
+ The agent asks before building, once, and always in the same shape: *Before building, Arbiter found a clash*, the facts, one question, and two or three options plus Other. It only speaks up when a rule is involved.
179
+
180
+ | Clash | It asks | Your answer goes into the record as |
181
+ |---|---|---|
182
+ | You ask for something a rule goes against | *Do you still want the undo bar?* | Nothing (it follows the rule), a one-off exception, or a new rule replacing the old one |
183
+ | A rule goes against the design system | *Which should the empty list follow?* | The rule retired, or reworded as *Exception to the design system: …* |
184
+ | Two rules disagree (only when both can't be true) | *Which should they follow?* | The other one retired, or both reworded to say what each is for |
185
+ | Other screens don't follow a rule you just built to (asked after building) | *Update Events too?* | Nothing (it updates them), a clash on your review list, or an exception |
186
+ | A rule needs something the design system doesn't have | *Build one?* | A short plan first, then this screen only, or a clash on your review list |
187
+
188
+ The design system means `DESIGN.md`, pattern and component docs, and the shared components. It ranks above a plain rule, so it's the first option when the two disagree. A rule written as an exception beats it, and the agent follows that rule without asking.
189
+
190
+ The agent never edits the design system, never adds to the shared components to fit a rule without asking, and never checks your work against it. That stays with your own tooling.
191
+
192
+ ## Share it with your team
38
193
 
194
+ ### The hosted board
195
+
196
+ ```bash
197
+ npx arbiter publish
39
198
  ```
40
- arbiter init install into this project [--destination git]
41
- arbiter setup --checkin <mode> how often the agent checks in: feature | quiet | every
42
- arbiter setup --app <url> where the app runs, so the agent can open screens for pictures
43
- arbiter snapshot "<work>" --file x.png a picture for a piece of work (or --capture on macOS); publish carries it
44
- arbiter record walk through a decision at the terminal
45
- arbiter record '<json>' record now (what the agent calls)
46
- arbiter record --pending '<json>' queue for later
47
- arbiter record P-0003 --as rule judge a queued one: accept | rule | skip | fix --to "…" [--candidate C-0001]
48
- arbiter record --all --as accept judge every queued item [--level polish] [--trigger "Settings build"]
49
- arbiter record --findings f.json queue a scanner's findings for verdicts
50
- arbiter record --retire D-0003 --why "…" drop a rule with no replacement
51
- arbiter record R-0001 --as apply answer a request from the board: apply [--to "<instead>"] | decline --why "…"
52
- arbiter record '<json>' --request R-0001 record the change made for an approved request; it's applied
53
- arbiter remove D-0004 take out a record that was never real: a decision, a screen (C-0001),
54
- or a picture (--snapshot "<work>")
55
- arbiter unlink D-0004 detach a decision from the screen it was recorded against
56
- arbiter review judge the queue in a browser page
57
- arbiter verify [id] re-check a decision's claim against its files
58
- arbiter sweep D-0004 [--queue] find existing violations of a mechanical rule
59
- arbiter candidate add "<name>" track a generated direction [--feature f] [--snapshot img | --capture]
60
- arbiter candidate C-0002 --state … generated | in_review | approved | rejected | superseded
61
- arbiter board candidates and their states
62
- arbiter export static folder of the board for people without the repo [--feature f] [--include-rules] [--open]
63
- arbiter publish board online at arbiter.design, with comments; prints the share link. Nothing to set up.
64
- arbiter publish --to <url|pages> your own hosted Arbiter, or GitHub Pages (git destination + export + commit + push)
65
- arbiter publish --on-push also write a GitHub Actions workflow that republishes on every push, and set its secret
66
- arbiter publish --auto republish whenever the record changes — no GitHub, no CI, no repository needed
67
- arbiter pull bring comments and "looks good" reactions down into .arbiter/comments.json;
68
- "Request change" becomes a request (R-0001) in .arbiter/requests.json
69
- arbiter drift deviations per screen: accepts, unverified claims, rules broken
70
- arbiter rules active rules [--dimension <name>] [--json]
71
- arbiter rules --pending the queue, and requests waiting on an answer
72
- arbiter rules --archive everything ever
73
- arbiter rules D-0003 one decision in full (R-0001: one request)
74
- arbiter update newest Arbiter: install it, refresh the skill file, re-pin the workflow [--check]
199
+
200
+ Puts your board online at [arbiter.design](https://arbiter.design) and prints a share link. Nothing to set up. People sign in with a magic link and can comment, say "looks good", or request a change on any screen. See what one looks like in the [live demo](https://arbiter.design/p/acme).
201
+
202
+ ```bash
203
+ npx arbiter pull
75
204
  ```
76
205
 
77
- `record` exit codes: `0` recorded · `1` invalid · `2` overlap — re-run with `--supersedes <id>` or `--keep-both` · `3` cap reached · `4` contradicted — the named files don't match the claim.
206
+ Brings their comments back into your repo, where `arbiter review` shows them next to each screen.
78
207
 
79
- ## Screenshots
208
+ Git stays the source of truth. The service only holds the latest board and its comments, and only `publish` and `pull` ever touch the network.
80
209
 
81
- The agent takes one picture per piece of work, when the work settles and it changed how a specific screen looks. Size isn't the test — a small pattern change on one screen earns a picture; a font or token change has no single screen to point at and doesn't. Motion and anything behavioural can't be carried by a still, so they don't either. Work that's only polish gets none: polish never reaches the board, so there'd be no card to show it on.
210
+ **Keep it current automatically:**
82
211
 
83
- The agent's own screenshot tool hands it an image, not a file, so it renders to disk with a headless browser (`chrome --headless --screenshot=…`) and attaches that. When it can't — no browser, app not running, screen behind a login — it says so once, naming the reason, whatever the check-in setting. `--capture` is the manual fallback and is macOS only; elsewhere, save a screenshot and pass `--file`.
212
+ - `npx arbiter publish --auto` republishes whenever the record changes. Works anywhere: no GitHub, no CI, no repo needed. If a republish fails (offline, service down) the command still succeeds and tells you the board is behind. `--no-auto` turns it off.
213
+ - `npx arbiter publish --on-push` writes a GitHub Actions workflow that republishes when decisions land on your default branch, and sets the `ARBITER_PUBLISH_TOKEN` secret through `gh` if you're signed in. Commit the workflow along with `.arbiter/hosted.json`.
84
214
 
85
- Name a piece of work after the screen it changed where the work splits that way — `Settings — billing` rather than one `Settings build` across four routes — and one picture per piece of work is one per screen.
215
+ ### Change requests
86
216
 
87
- The board shows an icon of the kind of change where a card has no picture, so a missing one never looks broken there. That's also why nobody notices, so Arbiter says it where it can still be fixed. A change asks for a picture when it's about one screen (not `global`) and is layout, words or looks (`structure`, `content`, `visual`); interaction, states, motion and access are right as an icon. When such a card has none, `record` adds a `picture` line with the command to the agent's reply, the review page marks the group "No picture", and `publish` to arbiter.design lists the card (the agent passes the list on). Scanner findings never ask: they're a line in a file, not a screen. Nothing on the board changes.
217
+ A comment is just input. **Request change** is different: someone wants something changed, so it gets a proper answer.
88
218
 
89
- ## Taking something out
219
+ 1. `npx arbiter pull` turns each request into `R-0001` in `.arbiter/requests.json`. Commit it so everyone sees the same answers.
220
+ 2. You answer in chat with `/arbiter`, or on the **Requests** tab of `arbiter review`:
221
+ - **Apply**: `record R-0001 --as apply`
222
+ - **Apply, but…**: `record R-0001 --as apply --to "keep the tab, make the button red"`
223
+ - **Decline**: `record R-0001 --as decline --why "…"` (a reason is required, since the requester reads it)
224
+ 3. The agent makes the change. Approving from chat makes it right away; approving from the review page makes it at the next `/arbiter`.
225
+ 4. `publish` sends the answer back. The requester sees *Open*, *Approved*, *Applied* (with what changed) or *Declined* (with the reason).
90
226
 
91
- Three acts, and only one is a removal.
227
+ > [!NOTE]
228
+ > Nothing gets applied without the owner saying yes, and the board never writes to git. Requests come in through `pull` and answers go out through `publish`.
92
229
 
93
- | | What it means | Command |
94
- |---|---|---|
95
- | **Retire** | It was real, it's over | `arbiter record --retire D-0003 --why "…"` |
96
- | **Remove** | It was never real | `arbiter remove D-0004` |
97
- | **Unlink** | Real, attached to the wrong screen | `arbiter unlink D-0004` |
230
+ <details>
231
+ <summary><b>More on requests</b></summary>
232
+ <br>
233
+
234
+ - Pulling twice never creates the same request twice. If the requester deletes it on the board before it's made, the next pull takes it off the queue and says so.
235
+ - Only an approved request can be applied. A change the owner hasn't said yes to is refused.
236
+ - Removing the last decision that applied a request reopens it for a fresh answer. The agent never remakes it unasked.
237
+ - A screen or decision with a request waiting on it can't be removed until the request is declined or applied.
238
+ - Display names and comment text come from outside the project, so neither is trusted. Names arrive as a single line, and nothing they contain can add a line, entry or field to the record.
98
239
 
99
- The archive is append-only for judgments: a call you changed your mind about is superseded, and that history is the point. It isn't append-only for mistakes. A test entry, an agent misfire, or a screen invented to work around a bug is a record that says something false, and keeping it forever makes the archive less trustworthy, not more.
240
+ </details>
100
241
 
101
- So `remove` deletes — from the archive, from `DECISIONS.md`, from the candidate files — and prints the full record it removed, because git holds the history only for people who have a repo. It refuses while anything still points at the record: an active rule (retire it), a decision another one supersedes, or a screen with decisions still linked (`--force` unlinks them in one go).
242
+ ### Other ways to share
243
+
244
+ - **Static export.** `npx arbiter export` writes `arbiter-export/`: one `index.html` plus snapshots, no server, no JavaScript. Drop it on any static host. It's a read-only view: each screen, its state, who approved it, why the others lost, and what was decided in plain words.
245
+ - **GitHub Pages.** With `"destination": "git"` in `arbiter.json`, every candidate change also writes the export to `docs/arbiter/`. Turn on Pages for the `docs` folder once and the board lives at `https://<owner>.github.io/<repo>/arbiter/`. `npx arbiter publish --to pages` does the whole setup in one go.
246
+
247
+ ## Screenshots
102
248
 
103
- `arbiter remove --snapshot "<work>"` takes only the picture; the work and its decisions stay, and the board keeps the old image until the next publish.
249
+ The agent takes one picture per piece of work, when the work settles and it changed how a specific screen looks.
104
250
 
105
- ## Verification
251
+ - **Gets a picture:** layout, wording or visual changes to one screen. Even a small pattern change counts.
252
+ - **Doesn't:** font or token changes (no single screen to show), motion and behaviour (a still can't show it), and polish (it never reaches the board).
106
253
 
107
- A mechanical decision can name `files` and an `expect` — literal strings that must be `present` in / `absent` from them (write `regex:<pattern>` for a pattern, e.g. `regex:#[0-9a-fA-F]{6}\b` for any hex colour). Arbiter reads only those files, never the repo. A claim that doesn't hold is refused. `accept` verdicts are never checked: an exception is a deviation by definition.
254
+ The agent renders pictures with a headless browser. If it can't (no browser, app not running, screen behind a login) it tells you once and says why. On macOS, `--capture` lets you drag-select a picture yourself; elsewhere, save one and pass `--file`.
108
255
 
109
- ## Sweep
256
+ > [!TIP]
257
+ > Name each piece of work after the screen it changed, like `Settings, billing` instead of one `Settings build` across four routes. Then one picture per piece of work means one per screen.
110
258
 
111
- Recording a mechanical rule with `expect.absent` reports how much existing code breaks it. `arbiter sweep <id>` lists the lines; `--queue` turns each file into a pending item to confirm as an exception or fix. Read-only — fixes are the agent's job. Judgment rules can't sweep.
259
+ Cards without a picture show an icon of the kind of change, so the board never looks broken. To make sure missing pictures still get noticed, `record` tells the agent the command to add one, the review page marks the group "No picture", and `publish` lists the cards that are missing one.
112
260
 
113
- The scan set is the rule's `paths` (directories or files) if it names any, else its `file:` scope, else the whole project. Keep token definitions and reference HTML out with `arbiter.json`:
261
+ ## Keeping the record honest
262
+
263
+ ### Verify and sweep
264
+
265
+ A mechanical rule (a hex colour ban, say) can name the `files` it applies to and what should be `present` in or `absent` from them. Use `regex:<pattern>` for patterns, like `regex:#[0-9a-fA-F]{6}\b` for any hex colour.
266
+
267
+ - **Verify.** Arbiter reads only those files and refuses a claim that doesn't hold.
268
+ - **Sweep.** `npx arbiter sweep D-0004` lists every existing line that breaks the rule. `--queue` turns each file into a pending item to fix or keep as an exception. Sweep never edits code; fixing is the agent's job.
269
+
270
+ Keep token files and reference HTML out of sweeps in `arbiter.json`:
114
271
 
115
272
  ```json
116
- { "sweep": { "exclude": ["app/globals.css", "design-reference/**", "docs/**"] },
117
- "overlap": { "ignore": ["audit", "journey"] } }
273
+ {
274
+ "sweep": { "exclude": ["app/globals.css", "design-reference/**", "docs/**"] },
275
+ "overlap": { "ignore": ["audit", "journey"] }
276
+ }
118
277
  ```
119
278
 
120
- `overlap.ignore` lists project words too common to signal that two rules overlap.
279
+ `overlap.ignore` lists words too common in your project to signal that two rules overlap.
121
280
 
122
- ## Review page
281
+ ### Taking something out
123
282
 
124
- `arbiter review` opens a local page with two tabs. **Decisions** — the queue, grouped by dimension, each card showing the screen it was made for. Confirm / Make it a rule / Skip / Fix; overlaps and contradictions surface inline. **Candidates** — every direction with its snapshot; Approve (with why — kept on the ones it replaces), Reject, In review. Both write the same files as the CLI.
283
+ Three different things, and only one of them deletes.
125
284
 
126
- ## Export
285
+ | | When to use it | Command |
286
+ |---|---|---|
287
+ | **Retire** | It was real, and it's over | `arbiter record --retire D-0003 --why "…"` |
288
+ | **Remove** | It was never real (a test, a misfire) | `arbiter remove D-0004` |
289
+ | **Unlink** | It's real, but attached to the wrong screen | `arbiter unlink D-0004` |
127
290
 
128
- `arbiter export` writes `arbiter-export/` — one `index.html` plus snapshots, no server, no JS. Open it locally or drop the folder on any static host and send the link. It's the stakeholder view only: each screen, its state, who approved, why the others lost, and what was decided in plain words. No verdict controls — feedback comes back through a person. This is the cheap test of whether stakeholders actually look, before anything hosted gets built.
291
+ Changing your mind is history worth keeping, so judgments are never deleted, only superseded. Mistakes are different: a record that says something false makes the archive less trustworthy. `remove` deletes it everywhere and prints the full record it removed. It refuses while anything still points at the record, unless you pass `--force` to unlink screens in one go. `remove --snapshot "<work>"` takes away just the picture.
129
292
 
130
- ## Hosted board
293
+ ## Candidates
131
294
 
132
- The hosted board at [arbiter.design](https://arbiter.design) serves a board at a share link and lets people comment, request a change, or say "looks good" after a magic-link sign-in. Git stays the record: the service holds one board version per project and the comments, nothing else. `npx arbiter publish` uploads; `npx arbiter pull` brings comments back, where `arbiter review` shows them beside each screen. Only `publish` and `pull` ever touch the network. The service itself is a separate, private codebase.
295
+ When the agent generates several directions for one feature, each one is a candidate with a state: `generated`, `in_review`, `approved`, `rejected` or `superseded`. Approving one supersedes the rest and keeps the reason. Decisions link to the candidate they were made for, and `arbiter board` lists them all.
133
296
 
134
- Two ways to keep the board current without anyone remembering.
297
+ ## Commands
135
298
 
136
- `npx arbiter publish --auto` is the one that works anywhere. It sets `hosted.auto` in `arbiter.json`, and from then on the board republishes whenever the record changes — after judging, after a screen changes state, after a picture is attached or removed. No GitHub, no CI, no git repository. Queueing decisions doesn't trigger it, since the queue is never published. If a republish fails — offline, service down — the command still succeeds and says the board is behind; the record is already written, and git is what holds it. `--no-auto` turns it off.
299
+ The ones you'll use most:
137
300
 
138
- `npx arbiter publish --on-push` is the GitHub route, and it writes `.github/workflows/arbiter.yml`, which runs `publish` when decisions land on the default branch, and sets the `ARBITER_PUBLISH_TOKEN` repository secret through `gh` if it's signed in (otherwise it prints the one-line instruction). Commit the workflow together with `.arbiter/hosted.json`. Under CI, `publish` only ever updates the board that file names — it refuses to create one, so a repo where the file wasn't committed can't mint orphan boards on every push.
301
+ ```bash
302
+ npx arbiterdesign init # install into this project
303
+ npx arbiter review # judge the queue in your browser
304
+ npx arbiter rules # list active rules
305
+ npx arbiter publish # put the board online and get a share link
306
+ npx arbiter pull # bring comments and requests back
307
+ ```
139
308
 
140
- ## Requests from the board
309
+ <details>
310
+ <summary><b>Full command reference</b></summary>
141
311
 
142
- A comment is input; it waits until the owner points at it. **Request change** on the board is different: someone wants something changed, so it gets an answer.
312
+ #### Setup
143
313
 
144
- 1. `npx arbiter pull` turns each one into a request, `R-0001`, in `.arbiter/requests.json` (commit it — everyone sees the same answers). Pulling twice never asks twice. If the person who asked deletes it on the board before the change is made, the next pull takes it off the queue and says so.
145
- 2. The owner answers — in chat with `/arbiter`, or on the **Requests** tab of `arbiter review`:
146
- - **Apply** — `record R-0001 --as apply`
147
- - **Apply, but…** — `record R-0001 --as apply --to "keep the tab, make the button red"`: do this instead of what was asked
148
- - **Decline** — `record R-0001 --as decline --why "…"`: the reason is required, because the requester reads it
149
- 3. Approving changes no code — only the agent can. In chat it makes the change right away; approved from the review page, it's made at the next `/arbiter`. The agent records what it did with `--request R-0001`, and that's what applies it. Only an approved request can be applied; a change the owner hasn't said yes to is refused.
150
- 4. `publish` carries the answers back: the requester sees *Open*, *Approved*, *Applied* — with what actually changed — or *Declined* with the reason, under their request.
314
+ | Command | What it does |
315
+ |---|---|
316
+ | `arbiter init [--destination git]` | Install into this project. |
317
+ | `arbiter setup --checkin <mode>` | How often the agent checks in: `feature`, `quiet` or `every`. |
318
+ | `arbiter setup --app <url>` | Where the app runs, so the agent can open screens for pictures. |
319
+ | `arbiter update [--check]` | Install the newest Arbiter, refresh the skill file, re-pin the workflow. |
151
320
 
152
- Nothing is applied without the owner, and the board never writes to git: requests come in through `pull`, answers go out through `publish`. Removing the last decision that applied a request opens the request again, for a fresh answer — the agent never remakes it unasked. A screen or decision with a request waiting on it (open, or approved and not yet made) can't be removed until the request is declined or applied.
321
+ #### Recording
153
322
 
154
- Whoever is signed in on the board chooses their own display name, and what they write is theirs, so neither is trusted: names arrive as one line, and the record can't be given a line, an entry or a field by anything it stores.
323
+ | Command | What it does |
324
+ |---|---|
325
+ | `arbiter record` | Walk through a decision at the terminal. |
326
+ | `arbiter record '<json>'` | Record now (what the agent calls). |
327
+ | `arbiter record --pending '<json>'` | Queue for later. |
328
+ | `arbiter record P-0003 --as rule` | Judge a queued item: `accept`, `rule`, `skip` or `fix --to "…"`. Add `--candidate C-0001` to link it, or `--against D-0009` to name the rule it goes against (with `accept`, it's logged as an exception to that rule). |
329
+ | `arbiter record --all --as accept` | Judge every queued item. Narrow with `--level polish` or `--trigger "Settings build"`. |
330
+ | `arbiter record --findings f.json` | Queue a scanner's findings for verdicts. |
331
+ | `arbiter record --retire D-0003 --why "…"` | Drop a rule with no replacement. |
332
+ | `arbiter record --reword D-0003 --to "…"` | Change a rule's wording. It keeps its id, and the old wording stays on the entry. |
333
+ | `arbiter record R-0001 --as apply` | Answer a request: `apply [--to "<instead>"]` or `decline --why "…"`. |
334
+ | `arbiter record '<json>' --request R-0001` | Record the change made for an approved request, which applies it. |
335
+ | `arbiter snapshot "<work>" --file x.png` | Attach a picture to a piece of work (or `--capture` on macOS). |
336
+
337
+ #### Reviewing and inspecting
338
+
339
+ | Command | What it does |
340
+ |---|---|
341
+ | `arbiter review` | Judge the queue, screens and requests in a browser page. |
342
+ | `arbiter rules [--dimension <name>] [--json]` | Active rules. |
343
+ | `arbiter rules --pending` | The queue, plus requests waiting on an answer. |
344
+ | `arbiter rules --archive` | Everything ever recorded. |
345
+ | `arbiter rules D-0003` | One decision (or `R-0001`, one request) in full. For a rule, also its exceptions and the clashes waiting on it, so the agent doesn't ask about the same screen twice. |
346
+ | `arbiter verify [id]` | Re-check a decision's claim against its files. |
347
+ | `arbiter sweep D-0004 [--queue]` | Find existing violations of a mechanical rule. |
348
+ | `arbiter drift` | Deviations per screen: accepts, unverified claims, broken rules. |
349
+
350
+ #### Screens
351
+
352
+ | Command | What it does |
353
+ |---|---|
354
+ | `arbiter candidate add "<name>"` | Track a generated direction. Options: `--feature f`, `--snapshot img`, `--capture`. |
355
+ | `arbiter candidate C-0002 --state …` | Set its state. |
356
+ | `arbiter board` | Candidates and their states. |
357
+ | `arbiter unlink D-0004` | Detach a decision from the screen it was recorded against. |
358
+ | `arbiter remove <id>` | Remove a decision, a screen (`C-0001`) or a picture (`--snapshot "<work>"`) that was never real. |
155
359
 
156
- ## Candidates
360
+ #### Sharing
361
+
362
+ | Command | What it does |
363
+ |---|---|
364
+ | `arbiter publish` | Board online at arbiter.design, with comments. Prints the share link. |
365
+ | `arbiter publish --to <url\|pages>` | Your own hosted Arbiter, or GitHub Pages. |
366
+ | `arbiter publish --auto` | Republish whenever the record changes. |
367
+ | `arbiter publish --on-push` | Write a GitHub Actions workflow that republishes on every push. |
368
+ | `arbiter pull` | Bring comments and reactions into `.arbiter/comments.json`, and requests into `.arbiter/requests.json`. |
369
+ | `arbiter export [--feature f] [--include-rules] [--open]` | Static folder of the board for people without the repo. |
370
+
371
+ #### Exit codes for `record`
157
372
 
158
- When several directions are generated for one feature, each is a candidate. A snapshot comes from the agent's browser tool (`--snapshot <image>`) or, on macOS, from you: `--capture` drops into drag-to-select and saves what you pick. Approving one supersedes the rest with the reason kept. Decisions link to a candidate; its page lists them. `npx arbiter publish` does all of the below in one go — switches to git, exports, commits, turns on GitHub Pages through `gh` if it's signed in, pushes, prints the link. It's the only command that touches the network, and only when you run it.
373
+ | Code | Meaning |
374
+ |---|---|
375
+ | `0` | Recorded. |
376
+ | `1` | Invalid input. |
377
+ | `2` | Overlaps an existing rule. Re-run with `--supersedes <id>` or `--keep-both`. |
378
+ | `3` | The 40-rule cap is reached. |
379
+ | `4` | Contradicted: the named files don't match the claim. |
159
380
 
160
- With `destination: "git"` in `arbiter.json`, every candidate change commits its page, a `CANDIDATES.md` index, and the export page under `docs/arbiter/` (never pushed). Turn on GitHub Pages for the `docs` folder once, and the board is served at `https://<owner>.github.io/<repo>/arbiter/` — always current, no login, no server. `board` prints the URL. Set `"pages": false` to skip, or `"pages": { "dir": "…", "includeRules": true }` to change it.
381
+ </details>
161
382
 
162
- ## The record
383
+ <details>
384
+ <summary><b>The record format</b></summary>
385
+ <br>
163
386
 
164
- ```
165
- id D-0001, sequential
166
- date ISO 8601
167
- author who decided
168
- class mechanical | judgment
169
- level feature | pattern | polish — how big a call; polish is never reviewed individually
170
- dimension structure | interaction | states | content | visual | motion | access
171
- change what happened, as a PM would say it — what the reviewer reads
172
- decision the same call as a rule someone could follow — what future sessions read
173
- rejected alternatives that lost, "<option> — <why>", one line each
174
- trigger the piece of work ("Settings build") — the grouping key for review
175
- verdict fix | accept | rule
176
- scope global | file:<path> | pattern:<name>
177
- rationale one line, required
178
- supersedes id | null
179
- commit short SHA | null
180
- files files the agent touched — evidence for verification
181
- paths where a rule applies (directories or files) — what sweep scans
182
- expect { present?: [..], absent?: [..] } — strings to check in files
183
- verified true | false | null (never checked / not checkable)
184
- candidate C-0001 | null
387
+ | Field | Meaning |
388
+ |---|---|
389
+ | `id` | `D-0001`, sequential. |
390
+ | `date` | ISO 8601. |
391
+ | `author` | Who decided. |
392
+ | `class` | `mechanical` (checkable in code) or `judgment`. |
393
+ | `level` | `feature`, `pattern` or `polish`. How big a call it is. Polish is never reviewed one by one. |
394
+ | `dimension` | `structure`, `interaction`, `states`, `content`, `visual`, `motion` or `access`. |
395
+ | `change` | What happened, in plain words. What the reviewer reads. |
396
+ | `decision` | The same call written as a rule. What future sessions read. |
397
+ | `rejected` | Alternatives that lost, one per line as `<option> — <why>`. |
398
+ | `trigger` | The piece of work, like `Settings build`. Used to group the review. |
399
+ | `verdict` | `fix`, `accept`, `rule` or `retire`. |
400
+ | `call` | Who made the call: `asked`, `corrected` or `agent`. `null` on records from before 0.1.7. |
401
+ | `against` | The rule this goes against, like `D-0011`, or `null`. Queued, it's a clash for review. Accepted, it's an exception to that rule. |
402
+ | `reworded` | The rule's earlier wordings, as `<old> (until 2026-10-13)`. Only `record --reword` adds one. |
403
+ | `scope` | `global`, `file:<path>` or `pattern:<name>`. |
404
+ | `rationale` | One line, required. |
405
+ | `supersedes` | The id it replaces, or `null`. |
406
+ | `commit` | Short SHA, or `null`. |
407
+ | `files` | Files the agent touched. Evidence for verification. |
408
+ | `paths` | Where a rule applies. What sweep scans. |
409
+ | `expect` | `{ present?: [..], absent?: [..] }`, strings to check in `files`. |
410
+ | `verified` | `true`, `false` or `null` (never checked, or not checkable). |
411
+ | `candidate` | `C-0001`, or `null`. |
412
+
413
+ Only `rule` verdicts go into `DECISIONS.md`. A rule that overlaps an active one is refused until you say whether it replaces it. Superseded rules leave the active file and stay in the archive. `accept` verdicts are never verified, since an exception is a deviation by definition.
414
+
415
+ Rewording is the one change made in place. The id stays, so everything that names the rule still points at it, and the entry keeps its earlier wording. A rule that now says something different isn't reworded. It's superseded.
416
+
417
+ </details>
418
+
419
+ ## Updating
420
+
421
+ ```bash
422
+ npx arbiter update
185
423
  ```
186
424
 
187
- Only `rule` verdicts enter `DECISIONS.md`. A `rule` whose scope overlaps an active rule is refused until you say whether it replaces the old one; superseded rules leave the active file and stay in the archive.
425
+ Two things can go out of date separately: the package in your devDependencies, and the skill file `init` copied into your project. Arbiter can tell when they don't match, without going online, and the agent will mention it in one line. `update` installs the newest package, refreshes the skill file, and re-pins the publish workflow if you have one. Your settings, `DECISIONS.md` and archive are left alone. `--check` reports without changing anything.
188
426
 
189
- ## Kill conditions
427
+ ## FAQ
190
428
 
191
- Fixed before Stage 0 started, per the roadmap. Do not move.
429
+ <details>
430
+ <summary><b>What counts as a decision?</b></summary>
192
431
 
193
- - **Stage 0** — if only mechanical verdicts get recorded after three weeks of use, the judgment layer isn't real.
194
- - **Stage 4 (candidates / board)** — build only if **5 or more** generated screens are in flight at once. If that never happens, cut it.
432
+ A call the agent made where a reasonable alternative existed: layout, flow, wording, states, what happens on error, and what it chose over. Not code details like imports, file names or plumbing. Each one reads Change, Rule, Rejected.
195
433
 
196
- ## Updating
434
+ </details>
435
+
436
+ <details>
437
+ <summary><b>How do I set it up?</b></summary>
438
+
439
+ Run `npx arbiterdesign init` in the folder your agent works in, or ask the agent to run it. It adds a few plain files and a one-line note telling the agent to read the rules before UI work. Nothing to sign up for, nothing to configure. From the next session, the agent records as it goes. Step by step, with what you'll see: [Get started](https://arbiter.design/get-started).
440
+
441
+ </details>
442
+
443
+ <details>
444
+ <summary><b>Do I have to write anything?</b></summary>
445
+
446
+ No. The agent records what it decided and what it chose over. You confirm, make it a rule, or skip, in chat or on the review page. Mid-session you can also just say *"make that a rule"* and it's recorded without a question.
197
447
 
198
- Two things go stale independently: the package pinned in your devDependencies, and the skill file `init` copied into the project — the agent's whole protocol. `init` stamps the skill file with the version that wrote it, so Arbiter can tell the two apart with no network: when they differ, the queue's JSON carries `update`, and the agent says one line. `npx arbiter update` installs the newest package, refreshes the skill file from it, and re-pins the publish workflow if there is one. Settings, `DECISIONS.md`, and the archive are untouched. `--check` reports without changing anything. Nothing checks the registry on its own.
448
+ </details>
449
+
450
+ <details>
451
+ <summary><b>Does it interrupt me while I'm iterating?</b></summary>
452
+
453
+ No. A screen you redesign six times is one piece of work, not six prompts. Decisions queue silently and surface in one line when you move on. You judge them when you want, or never.
454
+
455
+ </details>
456
+
457
+ <details>
458
+ <summary><b>Will I be reviewing hundreds of tiny decisions?</b></summary>
459
+
460
+ No. Every decision is sized as feature, pattern or polish. Feature and pattern items get a card each. Polish is one line per piece of work with a single **Confirm all**. A 7px height fix and a new settings architecture don't get the same treatment.
461
+
462
+ </details>
463
+
464
+ <details>
465
+ <summary><b>Will it stop the agent doing what I ask?</b></summary>
466
+
467
+ No, but it checks first. Ask for something a rule says otherwise and the agent asks once before building: follow the rule, or do it your way just this once. Either answer and it builds. Nothing fails, and the rule only changes if you say so.
468
+
469
+ </details>
470
+
471
+ <details>
472
+ <summary><b>Can I change my mind about a rule?</b></summary>
473
+
474
+ Yes. Make the new call and the old rule steps aside. It stays in the archive with the reason it was replaced, so the history reads as history. Nothing is deleted.
475
+
476
+ </details>
477
+
478
+ <details>
479
+ <summary><b>Where does the record live, and who can see it?</b></summary>
480
+
481
+ In your project, as plain-text files you own: `DECISIONS.md` and the `.arbiter/` folder beside it. The board is a copy at a private link. It's unlisted and never indexed, and people sign in by email to comment. Delete the board and you lose the comments, nothing else.
482
+
483
+ </details>
484
+
485
+ <details>
486
+ <summary><b>We already have a design system.</b></summary>
487
+
488
+ Good. Arbiter records decisions, not tokens. Rules can name your components and files (*"interactive elements use brand tokens, never raw hex"*) and sit beside whatever system you have. It captures the calls a design system doesn't: layout, flow, copy, and what was rejected.
489
+
490
+ </details>
491
+
492
+ <details>
493
+ <summary><b>Which agents does it work with?</b></summary>
494
+
495
+ Claude Code and Cursor get the whole loop: the agent reads your rules before UI work and records what it decides. Other agents that read a project's instructions file, like Codex, Copilot and Gemini CLI, follow the rules but don't record.
496
+
497
+ </details>
498
+
499
+ <details>
500
+ <summary><b>Who installs it, and what does the rest of the team need?</b></summary>
501
+
502
+ Whoever has the repo runs one command. Everyone else gets a link to the board. To comment or say "looks good", they sign in with an email link. No account to create, nothing to install.
503
+
504
+ </details>
505
+
506
+ <details>
507
+ <summary><b>Will it slow the agent down?</b></summary>
508
+
509
+ No. Active rules are capped at 40 and read once, before UI work, not on every turn. The archive of everything ever decided is never loaded.
510
+
511
+ </details>
199
512
 
200
513
  ## Development
201
514
 
@@ -204,3 +517,9 @@ npm install
204
517
  npm run build
205
518
  npm test
206
519
  ```
520
+
521
+ Requires Node 20 or newer. Issues and ideas are welcome on the [issue tracker](https://github.com/eddie199/arbiter/issues).
522
+
523
+ ## License
524
+
525
+ [MIT](LICENSE) © Edmond Hua