arbiterdesign 0.1.6 → 0.1.8

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/dist/work.js CHANGED
@@ -9,6 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.workDir = exports.workId = void 0;
12
+ exports.readRenames = readRenames;
13
+ exports.addRename = addRename;
12
14
  exports.workSnapshot = workSnapshot;
13
15
  exports.copyImage = copyImage;
14
16
  exports.captureImage = captureImage;
@@ -21,6 +23,33 @@ const workId = (trigger) => 'W-' + trigger.toLowerCase().replace(/[^a-z0-9]+/g,
21
23
  exports.workId = workId;
22
24
  const workDir = (paths) => node_path_1.default.join(paths.archiveDir, 'work');
23
25
  exports.workDir = workDir;
26
+ const RENAMED_FILE = 'renamed.json';
27
+ function readRenames(paths) {
28
+ const f = node_path_1.default.join(paths.archiveDir, RENAMED_FILE);
29
+ if (!node_fs_1.default.existsSync(f))
30
+ return [];
31
+ try {
32
+ const all = JSON.parse(node_fs_1.default.readFileSync(f, 'utf8').replace(/^/, ''));
33
+ if (!Array.isArray(all))
34
+ throw new Error('not a list');
35
+ return all.filter((r) => typeof r?.from === 'string' && typeof r?.to === 'string');
36
+ }
37
+ catch (e) {
38
+ throw new Error(`.arbiter/${RENAMED_FILE} can't be read (${e.message.split('\n')[0]}) — a merge conflict? Fix the file, then run this again.`);
39
+ }
40
+ }
41
+ /**
42
+ * Note one rename. Earlier names that led to `from` now lead to `to`, so a card renamed twice still
43
+ * gathers all its comments; and nothing leads away from `to`, which is a live name again.
44
+ */
45
+ function addRename(paths, from, to) {
46
+ const all = readRenames(paths)
47
+ .filter((r) => r.from !== to && r.from !== from)
48
+ .map((r) => (r.to === from ? { ...r, to } : r));
49
+ all.push({ from, to });
50
+ node_fs_1.default.mkdirSync(paths.archiveDir, { recursive: true });
51
+ node_fs_1.default.writeFileSync(node_path_1.default.join(paths.archiveDir, RENAMED_FILE), JSON.stringify(all, null, 2) + '\n');
52
+ }
24
53
  /** The snapshot file for a piece of work, if one was attached. */
25
54
  function workSnapshot(paths, id) {
26
55
  for (const ext of IMAGE_EXT) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arbiterdesign",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Records design decisions made during agent-assisted UI work and feeds them back into the agent's context.",
5
5
  "homepage": "https://arbiter.design",
6
6
  "repository": {
@@ -1,15 +1,17 @@
1
1
  ---
2
2
  name: arbiter
3
- description: Record design decisions made during UI work so they never have to be re-made. Use after building or changing any UI, and whenever the user says "record that", "make that a rule", "reject that", "going with X instead", or similar.
3
+ description: Apply and record this project's design decisions (DECISIONS.md). Use before building or changing any UI, to check the work against the decisions and ask first when something goes against one; after it, to record new decisions; and whenever the user says "record that", "make that a rule", "reject that", "going with X instead", or similar.
4
4
  ---
5
5
 
6
6
  # Arbiter
7
7
 
8
8
  `DECISIONS.md` holds the design calls this project has already made — what was chosen, what was rejected, and why. Your job is to apply them, and to capture new ones as they happen, without asking the user to write anything.
9
9
 
10
+ The commands below start with `npx`. On Windows, if one fails with "running scripts is disabled on this system", that's PowerShell blocking `npx`, not Arbiter: run the same command with `npx.cmd`, and keep using it for the rest of the session.
11
+
10
12
  ## Before UI work
11
13
 
12
- If `DECISIONS.md` exists, read it before building or changing any component, screen, or style. Treat every entry as settled. Do not re-decide, do not ask about, and do not deviate from an active rule unless the user explicitly asks you to. Do not try the alternatives it lists as rejected.
14
+ If `DECISIONS.md` exists, read it before building or changing any component, screen, or style. Treat every entry as settled. Do not re-decide it, and do not try the alternatives it lists as rejected. When what you're about to build would go against a rule (the user asks for it, the design system says otherwise, another rule disagrees), don't pick a side yourself: **When something clashes with a rule**, below, says when to ask and how.
13
15
 
14
16
  **Name the rules that shaped the work.** When an active rule made you build something the user might otherwise question (why no undo bar? why are the errors at the top?), say which, in the reply where you built it. One line, each rule by id with a few words on what it made you do:
15
17
 
@@ -25,6 +27,173 @@ How often follows the check-in setting (`checkin` in `arbiter.json`; `feature` w
25
27
 
26
28
  Whatever the setting, leave out rules you'd have followed anyway, rules the work didn't touch, and small visual details. Name a rule once per piece of work, not on every iteration. Never write "and 2 others"; name the ones the user is most likely to wonder about. If none applies, say nothing. The line shows the record working, and tells the user which rule to check the screen against.
27
29
 
30
+ ## When something clashes with a rule
31
+
32
+ Arbiter speaks up only when a rule in `DECISIONS.md` is involved. A request that goes against the design system with no rule involved isn't Arbiter's: handle it as you would without Arbiter, and when the work settles queue it like any other decision, with no mention of the design system.
33
+
34
+ **The design system** is `DESIGN.md`, design-system and pattern docs (brand guidelines included), component guidelines, and the shared components themselves. Not the coding rules in `CLAUDE.md` or `AGENTS.md`, not the app's existing screens, not design skills. It's stable and owned by someone else, so it beats a rule unless the rule is written as an exception: `Exception to the design system: …`. Arbiter reads it only to spot a clash with a rule; following it day to day is the project's business, as it would be without Arbiter. Never flag small differences from it, and never edit it.
35
+
36
+ Before calling anything a clash, check whether both can be true. Most "clashes" aren't: two rules about different things, a rule for a narrower area, a request that fits inside the rule. Only a real one gets a question. A mechanical detail (13px vs 12px) is never one; that's lint's job.
37
+
38
+ Every clash gets the same shape: the heading, a line or two of facts, one question, two or three options plus Other. Ask **before building**; other screens (below) are the one question that comes after. Ask **once**: every answer goes into the record, so the same clash doesn't come back. Facts only: no warnings, no opinion on which is better.
39
+
40
+ Use the selection widget if you have one: labels without numbers, the header each case names, and leave out the last option (the widget adds Other itself, and its text can't be changed). Otherwise, show the numbered text, Other included. Dates read like `25 Sept`.
41
+
42
+ ### The user asks for something a rule goes against
43
+
44
+ They name something specific: an undo bar when a rule rejected one, coloured text when a rule says filled pills. A vague request ("make errors more noticeable") doesn't go against a rule; follow the rule.
45
+
46
+ Don't build yet. Write three lines:
47
+
48
+ ```
49
+ **Before building, Arbiter found a clash.**
50
+ You asked for <what they asked for, in their words>, which goes against rule <ID>.
51
+ **<ID>** · <the rule, as an instruction>. <If the rule's Rejected list has what they asked for: what was tried and why it lost, one sentence. Otherwise: the rule's reason>. (<author>, <date>)
52
+ ```
53
+
54
+ Then ask (widget header: the rule's id):
55
+
56
+ ```
57
+ Do you still want <what they asked for>?
58
+ 1. No, follow <ID>: builds it the rule's way, <what the rule produces, one phrase>.
59
+ 2. Yes, just this once: builds <what they asked for> here only; <ID> stays.
60
+ 3. Other: type something else, or "update the rule" and why.
61
+ ```
62
+
63
+ If you see a way to meet both, say it in one sentence before the question, never as an option.
64
+
65
+ After the answer:
66
+
67
+ - **1** — build it the rule's way. Say `Following <ID>.`
68
+ - **2** — build what they asked. Record it now, as an exception to the rule for this screen: the usual JSON (below) with `"verdict": "accept"`, `"against": "<ID>"`, `"call": "asked"` and a `file:` scope. Say `Done. Noted as a one-off exception to <ID>.`
69
+ - **Other, "update the rule"** — build what they asked. Record the new rule with their words as the `rationale`: `"verdict": "rule"`, `"call": "asked"`, and `--supersedes <ID>`. Say `Done. <ID> replaced by <new id>.`
70
+ - **Other, anything else** — do what they typed. If that clashes with a rule too, same shape again.
71
+
72
+ They decided on the spot, so none of this goes to the review queue.
73
+
74
+ ### A rule disagrees with the design system
75
+
76
+ You notice it while preparing what they asked for; they didn't ask for anything against either.
77
+
78
+ If the rule is written as an exception, there's no question: build it the rule's way and name it in the `Following` line, `Following <ID> (exception to <file>)`. Name it whatever the check-in setting, since the `CLAUDE.md` line asks you to say so.
79
+
80
+ Otherwise, don't build yet. Write four lines:
81
+
82
+ ```
83
+ **Before building, Arbiter found a clash.**
84
+ Rule <ID> goes against <file>.
85
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
86
+ **<file> · <section>** · <what the design system says, one sentence>.
87
+ ```
88
+
89
+ Name the design-system source the way you name a rule: the file, then the section. Use the file name if it's at the root, otherwise its path (`docs/design-system/empty-state.md · Lists`). If several agree, name the main one and add `(also the EmptyState component)`.
90
+
91
+ Then ask (widget header: the rule's id):
92
+
93
+ ```
94
+ Which should <the thing being built> follow?
95
+ 1. <file>: builds <the design system's version>. <ID> moves to the archive.
96
+ 2. <ID>, as an exception: builds <the rule's version>. <ID> becomes an exception.
97
+ 3. Other: type something else, or "suggest a design system change" and why.
98
+ ```
99
+
100
+ After the answer:
101
+
102
+ - **1** — build the design system's version. `npx arbiter record --retire <ID> --why "<file> covers this"`.
103
+ - **2** — build the rule's version. `npx arbiter record --reword <ID> --to "Exception to the design system: <the rule>"`. The id and its reason stay.
104
+ - **Other, "suggest a design system change"** — build what they say. Record their suggestion for whoever owns the design system: the usual JSON with `"trigger": "Suggestion for the design system"`, their words as `change` and `rationale`, `"verdict": "accept"`, `"call": "asked"`. Never edit the design system.
105
+
106
+ ### Two rules disagree
107
+
108
+ Check these in order and stop at the first that fits:
109
+
110
+ | | When | Do |
111
+ |---|---|---|
112
+ | 1 | They're about different things: "status pills are outlined", "filter pills are filled" | Follow both, each for its own thing. No question |
113
+ | 2 | One is for a narrower area: "pills are outlined", "checkout pills are filled" | The narrower rule wins in its area. No question |
114
+ | 3 | A small adjustment meets both: filled pills and a strong-contrast rule | Adjust (darker colours, say), say so in one line, and queue the adjustment as a decision (`"call": "agent"`) |
115
+ | 4 | Same thing, opposite answers, or too vague to tell | Ask, below |
116
+
117
+ For 4, don't build yet. Write five lines, the rules in id order:
118
+
119
+ ```
120
+ **Before building, Arbiter found a clash.**
121
+ Rules <ID> and <ID> disagree.
122
+ **<The thing>: <one answer> or <the other>?**
123
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
124
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
125
+ ```
126
+
127
+ Then ask (widget header: `Rule clash`), the newer rule first:
128
+
129
+ ```
130
+ Which should they follow?
131
+ 1. <newer ID> (newer): builds <its version>. Replaces <older ID>, which goes to the decision archive.
132
+ 2. <older ID>: builds <its version>. Replaces <newer ID>, which goes to the decision archive.
133
+ 3. Both, for different <things>: keeps both. I'll ask which <things> each is for and reword them.
134
+ 4. Other: type something else.
135
+ ```
136
+
137
+ After the answer:
138
+
139
+ - **1 or 2** — build the chosen rule's version. `npx arbiter record --retire <the other> --why "Replaced by <the chosen one>"`.
140
+ - **3** — one question in plain text, `Which <things> is each for?`, then reword both to name their kind before building: `npx arbiter record --reword <ID> --to "Status pills are outlined"`. Neither is archived.
141
+ - **Other** — do what they typed.
142
+
143
+ ### Other screens don't follow the rule
144
+
145
+ You build new work and it follows a rule; screens already in the code that you came across while working don't. New work always follows the rule; other screens change only if the user says so. Don't go looking for them.
146
+
147
+ This one comes **after** building, and only about the other screens. First check `npx arbiter rules <ID> --json`: a screen listed under `exceptions` or `waiting` is settled; leave it out. If nothing's left, say nothing. Ask whatever the check-in setting, `quiet` included.
148
+
149
+ ```
150
+ Following <ID>.
151
+ <Screen> uses <what it does>, which goes against it.
152
+ ```
153
+
154
+ Then ask (widget header: the rule's id):
155
+
156
+ ```
157
+ Update <Screen> too?
158
+ 1. Yes, update <Screen>: <what changes, one phrase>.
159
+ 2. Not now: leaves <Screen> as it is. Added to your review list, so it isn't asked again.
160
+ 3. Other: type something else.
161
+ ```
162
+
163
+ Several screens: `Events and Settings use a trash icon, which goes against it.` and `Update them too?`, with `Yes, update them`. More than three: name three and add `and 2 others`. Facts only: "uses a trash icon", never "still uses" or "doesn't follow it yet".
164
+
165
+ After the answer:
166
+
167
+ - **Yes** — change them to follow the rule. Nothing to record.
168
+ - **Not now**, or the widget's Skip — queue one item per screen: `record --pending`, the usual JSON with `"against": "<ID>"`, `"trigger": "<Screen>"`, `"change": "<Screen> uses <what it does>"`. It comes back at review as a clash. A second one for the same screen and rule is refused as `already-queued`; that's fine.
169
+ - **Other, "it's meant to be different"** — record each screen now as an exception, the usual JSON with `"verdict": "accept"`, `"against": "<ID>"`, `"trigger": "<Screen>"`, `"call": "asked"`. It isn't asked again.
170
+
171
+ ### A rule needs something the design system doesn't have
172
+
173
+ A rule needs a component the shared components don't have, or don't do. Don't add to the shared kit to fit a rule; it belongs to whoever owns the design system. Don't build yet. Two lines:
174
+
175
+ ```
176
+ **Before building, Arbiter found a clash.**
177
+ **<ID>** · The <screen> needs <what the rule needs>, but the design system doesn't have one.
178
+ ```
179
+
180
+ Then ask (widget header: the rule's id):
181
+
182
+ ```
183
+ Build one?
184
+ 1. Plan and build one: shows you a short plan for the <thing> first. Builds it once you're happy. This <screen> only.
185
+ 2. Leave for now: builds the <screen> without the <thing> for now. Added to your review list.
186
+ 3. Other: type something else, or "add it to the shared components".
187
+ ```
188
+
189
+ When a shared component exists but works differently, same shape: `**<ID>** · The guest form needs FormError to show one box at the top, but FormError is shared by 12 screens.` and `Change it for this form?`.
190
+
191
+ After the answer:
192
+
193
+ - **1** — a plan of a few lines: what it shows, where it sits, how it looks using the design system's existing styles. Build it once they're happy, in this screen's own files; the shared components stay untouched.
194
+ - **2** — build without it. Queue one item: `record --pending`, the usual JSON with `"against": "<ID>"`, `"trigger": "<Screen>"`, `"change": "<Screen> has no <thing>: the design system doesn't have one"`.
195
+ - **Other, "add it to the shared components"** — build it into the shared kit. When the work settles, queue it with a `change` that starts `Added to the shared components:`, so whoever owns them sees it.
196
+
28
197
  ## After UI work — queue, don't interrupt
29
198
 
30
199
  Design work is iterative. A screen redesigned six times is one piece of work, not six. Never surface decisions mid-iteration.
@@ -37,7 +206,7 @@ Design work is iterative. A screen redesigned six times is one piece of work, no
37
206
  npx arbiter record --pending '<json>'
38
207
  ```
39
208
 
40
- (JSON shape below). The output carries `checkin`, the user's answer from their first `/arbiter`; `waiting`, how many changes are waiting for them (polish isn't counted, since they're never asked about it); sometimes `ask`; and sometimes `picture`, a screen this changed that has no picture yet (see **Screenshots**).
209
+ (JSON shape below). The output carries `checkin`, the user's answer to the check-in question; `waiting`, how many changes are waiting for them (polish isn't counted, since they're never asked about it); sometimes `ask`; and sometimes `picture`, a screen this changed that has no picture yet (see **Screenshots**).
41
210
 
42
211
  - `feature` (default) — **only if the piece of work included a `feature`-level decision**, add one line to your reply carrying its Change line, not a count.
43
212
  - `quiet` — say nothing. Ever. They run `/arbiter` when they want it. `ask` never comes back.
@@ -73,9 +242,13 @@ Arbiter's skill file is from 0.1.3 (the CLI is 0.1.4) — say "update arbiter" a
73
242
 
74
243
  Never run it unasked. When they say yes — or say *"update arbiter"* unprompted — run the command `update.command` names and relay what it prints. It leaves `DECISIONS.md`, the archive and the settings alone.
75
244
 
76
- ## The first `/arbiter` — intro, then the queue
245
+ ## Right after install
246
+
247
+ Install asks one question: when Arbiter should check in. Run in a terminal, it asks there. Run by you, nobody can answer, so its last lines hand you the question. Ask it then, on its own, before anything else: the widget below, with just this one question. Then save the answer with `setup --checkin`, as below. Asked once; `/arbiter` never asks it again.
77
248
 
78
- The queue JSON carries `firstRun: true` until the project has been through this once. When it does, before anything else, say this — verbatim, it's been written for the reader:
249
+ ## The first `/arbiter`, if nobody answered at install — intro, then the queue
250
+
251
+ The queue JSON carries `firstRun: true` only while nobody has answered the check-in question (an install from before it asked, or one where it was never relayed) and nothing has been judged yet. When it does, before anything else, say this — verbatim, it's been written for the reader:
79
252
 
80
253
  > **Arbiter's on.** While I build UI, I record the design decisions I make — what changed, the rule behind it, what was rejected — so nothing gets re-decided and your team can see why things are the way they are.
81
254
  >
@@ -89,16 +262,16 @@ The queue JSON carries `firstRun: true` until the project has been through this
89
262
  > - **publish** — say it, get the board link
90
263
  > - **"record that"** / **"make that a rule"** — mid-chat, recorded, no questions
91
264
 
92
- Then one question, with the selection widget (text fallback: the same three lines, numbered):
265
+ Then one question, with the selection widget (text fallback: the same three lines, numbered). It goes alone, before the queue. Never fold it into the review's questions: dismissed along with them, it comes back on every `/arbiter`.
93
266
 
94
267
  - **header** — `While you work`
95
268
  - **question** — `When should Arbiter check in about decisions?`
96
269
  - **options** —
97
270
  - `A line after big work` (Recommended) — *When a feature-sized piece settles, one sentence saying what changed. Every 5 changes waiting, a yes/no on reviewing. Never mid-iteration.*
98
- - `Nothing until I ask` — *Saved silently, never a question. /arbiter whenever you want to see it.*
271
+ - `Nothing until I ask` — *Saved silently. Asks only when something clashes with a rule. /arbiter whenever you want to see it.*
99
272
  - `A line after everything` — *One sentence every time a piece of work settles, big or small. Every 5 changes waiting, a yes/no on reviewing.*
100
273
 
101
- Record the answer — Skip means the recommended one:
274
+ Record the answer, whatever comes back. Skip, a dismissed widget or no answer all mean the recommended one, so it's asked once:
102
275
 
103
276
  ```
104
277
  npx arbiter setup --checkin feature # A line after big work
@@ -159,7 +332,17 @@ For each decision, note what it was chosen **over**. Rejected alternatives come
159
332
  2. **Options you weighed and didn't build.** You considered tabs, went with a single page. Tabs are rejected, with your reason.
160
333
  3. **Corrections.** Whatever you did that the user then changed is rejected; what they asked for is the decision.
161
334
 
162
- **Any visual change that stays in the UI counts too**: colour, spacing, type, radii, icons, what's shown or hidden. That holds even when no alternative was weighed, and even when the user asked for it. The version it replaced is the rejected alternative. A visual change that would repeat on other screens is a `pattern`. A one-off is `polish`.
335
+ **A visual change the user asked for or corrected counts too**: colour, spacing, type, radii, icons, what's shown or hidden. That holds even when no alternative was weighed. The version it replaced is the rejected alternative. A visual change that would repeat on other screens is a `pattern`. A one-off is `polish`.
336
+
337
+ **Only real choices.** Queue something only if someone actually chose it, and set `call` to say who:
338
+
339
+ | `call` | When | Example |
340
+ |---|---|---|
341
+ | `asked` | The user asked for it | "Put the errors at the top of the form" |
342
+ | `corrected` | The user changed what you did. The most valuable kind: what they rejected is on record | "No, make it a word, not an icon" |
343
+ | `agent` | You weighed real options, picked one, and can say why | Tabs or a dropdown for the filters; you picked tabs |
344
+
345
+ Don't queue your own habits, what you'd do on any project without being asked: keeping what someone typed after an error, 8px corners on a new button. They fill the review and `DECISIONS.md` with rules that change nothing. When unsure, it was a habit. *"Record that"* still records anything on request.
163
346
 
164
347
  Skip mechanical necessities (imports, prop plumbing, file placement), and non-visual things the user told you to do.
165
348
 
@@ -167,17 +350,17 @@ Skip mechanical necessities (imports, prop plumbing, file placement), and non-vi
167
350
 
168
351
  | Level | What it is | Examples | Review behaviour |
169
352
  |---|---|---|---|
170
- | `feature` | A new surface, flow, or structure | Settings shell with four routes; a second card on Audit; a stage-aware back link | Always presented |
353
+ | `feature` | A new surface, flow, or structure | Settings split into four tabs; a second card on Audit; a back link that knows which step you came from | Always presented |
171
354
  | `pattern` | A reusable call that could apply elsewhere | Icon-only buttons on half-width cards; "Status" not "Health"; save buttons bottom-right | Presented; "make it a rule" is the likely answer |
172
355
  | `polish` | A one-off fix to one screen | Match heights at `h-9`; drop a chevron; remove a pill | **Never presented.** Queued, then logged automatically when the group is reviewed |
173
356
 
174
- Polish still gets queued — it's part of the record — but the user never gets a question about it; they see "+6 polish logged" in the summary. Rules only ever come from `feature` or `pattern`. When unsure between `pattern` and `polish`, ask: would this apply on a screen that doesn't exist yet? If yes, `pattern`. There's no cap on polish; keep feature + pattern to seven per piece of work.
357
+ An `agent` call is yours, not the user's, so Confirm is its likely answer, not a rule. Polish still gets queued — it's part of the record — but the user never gets a question about it; they see "+6 polish logged" in the summary. Rules only ever come from `feature` or `pattern`. When unsure between `pattern` and `polish`, ask: would this apply on a screen that doesn't exist yet? If yes, `pattern`. There's no cap on polish; keep feature + pattern to seven per piece of work.
175
358
 
176
359
  ### Clashes with a rule
177
360
 
178
361
  An item that goes against an active rule is a clash: someone has to say which one wins, so it gets its own options (below). It stays in queue order.
179
362
 
180
- An item's `overlaps` names active rules it may repeat or contradict. They're word and scope matches, not judgments — read both sides and decide, and check every item against `rules` even where there's no hint.
363
+ An item with `against` goes against that rule for certain: it was queued that way (a screen left as it was, something the design system didn't have, a sweep). An item's `overlaps` names active rules it may repeat or contradict. They're word and scope matches, not judgments — read both sides and decide, and check every item against `rules` even where there's no hint.
181
364
 
182
365
  ### Present with the selection widget
183
366
 
@@ -185,30 +368,34 @@ Only when asked (see above). If you have a question tool that presents options (
185
368
 
186
369
  Each question:
187
370
 
188
- - **header** — the dimension, Title case: `Structure`, `Interaction`, `States`, `Content`, `Visual`
189
- - **question** — a heading line, a blank line, then four labelled lines:
371
+ - **header** — the dimension, Title case: `Structure`, `Interaction`, `States`, `Content`, `Visual`. Some apps don't show the header, so the heading line carries it too.
372
+ - **question** — a heading line, then four labelled lines, with a blank line before each. The widget shows plain text in one block, so the blank lines are what separate them:
190
373
 
191
374
  ```
192
- Rescan button · 1 of 1
375
+ Rescan button · Interaction · 1 of 1
193
376
 
194
377
  Change — The Rescan button on the small Health check card is now just an icon
195
- Pattern — Half-width cards use icon-only action buttons with aria-label and title
378
+
379
+ Pattern — Half-width cards use icon-only action buttons
380
+
196
381
  Rejected — Full-label button: wrapped to a second row on mobile
382
+
197
383
  Applies to — Compact card actions, anywhere
198
384
  ```
199
385
 
200
- - The heading is **the thing the user was working on, at the grain they worked at** — `Rescan button`, `Delete flow`, `Settings`, `Billing page`. Say it the way they'd say it. It's the `trigger`. Then `n of N` within that piece of work.
201
- - `Change` is what happened, as a PM would say it. `Pattern` is the rule-shaped sentence (`decision`). `Rejected` is each alternative with why it lost, `·`-separated if more than one; omit the line if nothing was rejected. `Applies to` is the scope in words: a file name, `<Pattern name>, anywhere`, or `Everywhere`.
386
+ - The heading is **the thing the user was working on, at the grain they worked at** — `Rescan button`, `Delete flow`, `Settings`, `Billing page`. Say it the way they'd say it. It's the `trigger`. Then the dimension, then `n of N` within that piece of work.
387
+ - `Change` is what happened, as a PM would say it. `Pattern` is the rule-shaped sentence (`decision`). `Rejected` is each alternative with why it lost, `·`-separated if more than one; omit the line if nothing was rejected. `Applies to` is the scope in words: the screen or area (`Writing list`), `<Pattern name>, anywhere`, or `Everywhere`. Never a file name.
388
+ - Every line in plain words, as **Write it for a PM or a designer** shows. The widget can't bold or format anything, so short lines are all that makes it readable.
202
389
  - **options**, these two, in this order:
203
390
  - `Confirm` — *Saved to the decision log.*
204
391
  - `Make it a rule` — *Kept in DECISIONS.md, referenced in future sessions.*
205
392
  - The built-in **Other** box is the correction path. If the user types there, treat it as a fix: what they typed is the decision, what you did is rejected. If they type `skip`, drop the item.
206
393
  - The widget's own **Skip** button means "not now" — everything stays in the queue. Don't add a Skip option.
207
394
 
208
- **A clash** adds a line under `Applies to` — `Clashes — D-0009 · Destructive actions undo instead of confirming` — and has its own three options:
395
+ **A clash** adds a line under `Applies to`, after a blank line like the others — `Clashes — D-0009 · Destructive actions undo instead of confirming` — and has its own three options:
209
396
 
210
397
  - `Follow D-0009` — *Change it back to match the rule.*
211
- - `Replace D-0009` — *This becomes the rule; D-0009 moves to the archive.*
398
+ - `Replace D-0009` — *This becomes the rule; D-0009 goes to the decision archive.*
212
399
  - `Keep as exception` — *Logged as a one-off here; D-0009 stands.*
213
400
 
214
401
  ### Fallback: present as text
@@ -233,7 +420,7 @@ Settings build — 2 decisions, +4 polish
233
420
  Pattern: Destructive actions confirm in a dialog
234
421
  Clashes: D-0009 · Destructive actions undo instead of confirming
235
422
  → follow D-0009 · replace D-0009 · keep as exception
236
- 5. Change: Settings is now a tab-row shell with four routes under it [feature]
423
+ 5. Change: Settings is now one page with four tabs [feature]
237
424
  …
238
425
 
239
426
  Reply per number — confirm · rule · skip · or type what it should be
@@ -252,7 +439,7 @@ Omit the `Rejected` line when there's nothing rejected. Never ask an open questi
252
439
  | Other: a correction | `fix --to "…"` | Change the code to match, then judge it. What you did becomes a rejected alternative automatically. |
253
440
  | Follow D-0009 | `fix --to "<D-0009's decision>"` | Change the code back to match the rule, then judge it. |
254
441
  | Replace D-0009 | `rule --supersedes D-0009` | Judge it. The old rule moves to the archive. |
255
- | Keep as exception | `accept` | Judge it. The rule stands; this screen is the logged exception. |
442
+ | Keep as exception | `accept --against D-0009` | Judge it. The rule stands; this screen is the logged exception. |
256
443
  | Widget Skip button | — | Nothing. The queue waits. |
257
444
 
258
445
  Never judge anything before the user answers.
@@ -271,11 +458,35 @@ Used by `record --pending` (queue) and `record` (record now):
271
458
  "trigger": "Audit page",
272
459
  "scope": "pattern:compact-card-actions",
273
460
  "dimension": "interaction",
274
- "class": "judgment"
461
+ "class": "judgment",
462
+ "call": "corrected"
275
463
  }
276
464
  ```
277
465
 
278
- Two sentences, two jobs. **Write `change` as what a PM would say happened** — concrete, past tense, names the thing on the screen. **Write `decision` as the rule someone could follow** — general, present tense. The user judges from `change`; future sessions obey `decision`. Never cram both into one line.
466
+ Two sentences, two jobs. **Write `change` as what a PM would say happened** — concrete, past tense, names the thing on the screen. **Write `decision` as the rule someone could follow** — present tense, naming exactly what it's about and where it applies. The user judges from `change`; future sessions obey `decision`. Never cram both into one line.
467
+
468
+ ### Write it for a PM or a designer
469
+
470
+ The people judging are PMs and designers. They read these lines in the review, on the board and in `DECISIONS.md`, never next to the code. You've just been in the code, so you'll reach for its words: catch that.
471
+
472
+ - **Say what a person sees or does**, not how it was built. "Jumps to that rule", not "the row is an anchor".
473
+ - **No code words.** No file names, component names, class names, CSS values or attributes (`aria-label`, `text-xs`, `ArrowUpRight`, `lib/writing.ts`, `1fr`). Call things what they're called on screen.
474
+ - **One thing per line, 20 words or fewer.** A line that lists four parts of a card is four details, and the person only needs the one that was decided.
475
+ - **`Applies to` is a screen or an area**: `Writing list`, `Project cards, anywhere`. Never a file.
476
+
477
+ This goes for `change`, `decision` and each `rejected`. A mechanical rule's `decision` may name a token, since that's what its check looks for; its `change` still says it in words.
478
+
479
+ Not this → this, from real queues:
480
+
481
+ | Not this | This |
482
+ |---|---|
483
+ | The rule badge on a screen page links to that rule's row under Standing rules; the row is an anchor and its id turns fg when it is the target | Clicking a Rule badge jumps to that rule, with its number highlighted |
484
+ | The Projects page now has an Other projects section: three cards in a row under the main cards, each with a title, impact line, tag pills and a screen, tinted per project | The Projects page has a new Other projects row: three smaller cards under the main ones |
485
+ | Writing rows that link off-site use an ArrowUpRight and a text-xs source line with the site mark under the excerpt | Articles from other sites show an arrow pointing out and a small line naming the site |
486
+ | Rejected: source label in the date column, too cramped at the w-24 mobile column | Rejected: source in the date column, too cramped on phones |
487
+ | Applies to: lib/writing.ts | Applies to: Writing list |
488
+
489
+ `record` checks. A line over 25 words, or one with something that's surely code (a file name, a class name, a name like `onClick` or `ArrowUpRight`, backticks), exits `1` with `status: "unclear"` and the words it caught. Nothing is written. Say it again in plain words and re-run.
279
490
 
280
491
  `verdict` is omitted when queueing (`--pending`); include it (`accept | rule | fix`) only when recording directly.
281
492
 
@@ -292,8 +503,8 @@ If the work belongs to a candidate (below), add `"candidate": "C-0001"` or pass
292
503
 
293
504
  If the session mentioned a ticket — a Linear or Jira key like `ENG-123`, a GitHub issue, a pasted tracker link — add `"ref": "<url or key>"` or pass `--ref`. It's how the board links each decision to the work it came from. Never ask for one; leave it out when nothing was mentioned. `--ref` on a bulk `--all` stamps every item.
294
505
 
295
- - `change` — what happened, in plain words. One line. Required. This is what the person judging reads.
296
- - `decision` — the same call as a rule someone could follow. Present tense. One line. This is what future sessions read. For `polish` it can repeat `change`.
506
+ - `change` — what happened, in plain words. One line, 20 words or fewer. Required. This is what the person judging reads.
507
+ - `decision` — the same call as a rule someone could follow. Present tense. One line. It's the rule's title in `DECISIONS.md`, and with many rules a future session picks what to read from titles alone. So name the exact thing and where it applies: `Reply pills on the guest list are filled`, not `Pills are filled`; `Form errors go in one box at the top of the form`, not `Errors go at the top`. A vague title gets skipped, or looks like it clashes with a rule about something else. For `polish` it can repeat `change`.
297
508
  - `level` — `feature | pattern | polish` (table above). Default is `pattern`; set it every time.
298
509
  - `trigger` — the thing the user was working on, named the way they'd say it, at the grain they worked at: `Rescan button`, `Delete flow`, `Settings`, `Billing page`. Every decision from the same piece of work gets the **same** trigger — it's the grouping key and the heading they see.
299
510
  - `rationale` — why it won. One line. Required.
@@ -301,13 +512,15 @@ If the session mentioned a ticket — a Linear or Jira key like `ENG-123`, a Git
301
512
  - `scope` — `pattern:<kebab-name>` for a recurring UI pattern (`destructive-confirm`, `empty-state`, `sheet-actions`) — this is the usual case. `file:<path>` only when it's genuinely about one screen. `global` when it applies everywhere.
302
513
  - `dimension` — one of the seven above.
303
514
  - `class` — `mechanical` if it could be checked against a token or lint rule (colours, spacing, type scale, radii); `judgment` otherwise. Most rules are judgment.
515
+ - `call` — who made the call: `asked` · `corrected` · `agent` (see **What counts as a decision**). Set it every time.
516
+ - `against` — only for a clash: the active rule this goes against, `D-0011`. Recorded as `accept`, it's the logged exception to that rule; queued, it comes back at review as a clash.
304
517
  - `files` / `expect` — mechanical only. Name the files you touched and the literal strings that prove the claim.
305
518
  - `paths` — mechanical rules only: where the rule applies, as directories or files (`["app/components", "app/(marketing)"]`). Sweep scans only these. A `pattern:` rule with no `paths` sweeps the whole project, including token definitions and reference HTML — name the directories.
306
519
 
307
520
  The command prints JSON and exits:
308
521
 
309
522
  - `0` — recorded. Note the `id`. If the output has a `sweep` block with violations, see **Sweep** below.
310
- - `1` — invalid. Fix the payload and retry.
523
+ - `1` — invalid. Fix the payload and retry. With `status: "unclear"`, a line reads like code or runs on: rewrite it (see **Write it for a PM or a designer**) and retry.
311
524
  - `2` — **overlap**. Nothing was written. See below.
312
525
  - `3` — `DECISIONS.md` is at its cap. Tell the user, and ask which existing rule this replaces.
313
526
  - `4` — **contradicted**. The files don't match the claim. Nothing was written. Fix the code or the claim.
@@ -354,6 +567,8 @@ A picture isn't evidence of the change; there's one image and nothing to compare
354
567
 
355
568
  **Name the piece of work after the screen it changed**, where the work honestly splits that way: `Settings — billing`, `Settings — profile`, rather than one `Settings build` covering four routes. One picture per piece of work is then one per screen, and the review reads screen by screen instead of one lump. Work that shouldn't be split — a flow across three steps, a nav change touching every page — stays one piece of work and gets one representative picture.
356
569
 
570
+ When the user wants a piece of work called something else after it's recorded (*"call that Settings — billing"*), rename it; don't re-record it: `npx arbiter rename "Settings build" "Settings — billing"`. Its decisions, picture, requests and comments follow, and the board's comments move to the new card at the next publish. From then on, use the new name as the `trigger`. A screen (`C-0001`) keeps its id whatever it's called, so it never needs this.
571
+
357
572
  ### Taking it
358
573
 
359
574
  Your own screenshot tool hands the image back to you in the conversation; `arbiter snapshot` needs a **file on disk**. So write one:
@@ -455,6 +670,10 @@ It goes to arbiter.design. Nothing to set up, no token, no account: the first pu
455
670
 
456
671
  *"Every time I push"*, and the project is on GitHub — `npx arbiter publish --on-push`. That publishes, writes `.github/workflows/arbiter.yml` (republishes when decisions land on the default branch), and sets the repository secret through `gh` if it's signed in — otherwise it prints the one-line instruction; relay it. Tell the user to commit the workflow and `.arbiter/hosted.json` together.
457
672
 
673
+ *"Put a password on it"*, *"make the board private"* — `npx arbiter publish --password`. It makes up a strong password, prints it once on the `password` line, and the board asks for it before showing anything. Give the user the password with the link: nothing can show it again. `--password "<theirs>"` uses one they chose (8 characters or more), and `--no-password` takes it off. Only when they ask: every `--password` makes a new one and locks out everyone who had the old one. A plain `publish` keeps it.
674
+
675
+ *"Take the board down"*, *"delete the board"* — `npx arbiter unpublish`. Without `--yes` it deletes nothing and says what would go, for everyone: relay that and ask. Run `npx arbiter unpublish --yes` only after they say yes. Their comments are saved to `.arbiter/comments.json` first, and the record in the repo stays. Tell them to commit the removal of `.arbiter/hosted.json`.
676
+
458
677
  ## Requests from the board
459
678
 
460
679
  On the board, anyone signed in can press **Request change** on a screen or a decision. `npx arbiter pull` turns each one into a request — `R-0001` — and it waits for the owner. The requester asks, the owner answers, and you make the change only once the owner has said yes. If the requester deletes it on the board before you've made it, the next pull takes it off the queue.
@@ -470,16 +689,17 @@ Making 2 changes you approved — Sam: move the danger zone to the bottom · Pri
470
689
  **Then open ones** (`requests.open`), before any queued decision. With the widget:
471
690
 
472
691
  - **header** — `Request`
473
- - **question** — a heading line, a blank line, then what was asked:
692
+ - **question** — a heading line, then what was asked, with a blank line before each labelled line:
474
693
 
475
694
  ```
476
- Sam · Settings — billing
695
+ Request from Sam · Settings — billing
477
696
 
478
697
  Asked — Move the danger zone to the bottom, not in its own tab
698
+
479
699
  About — D-0012 · Danger zone lives in its own tab
480
700
  ```
481
701
 
482
- The heading is who asked and `screenName`. `About` only when it was asked about one decision: `decision` (its id) and `decisionText` (what it says). If `earlierVersion` is true, end the heading with `· asked about an earlier version` — the screen may have changed since.
702
+ The heading is `Request from` who asked, then `screenName`: some apps don't show the header, so the heading says it's a request. `About` only when it was asked about one decision: `decision` (its id) and `decisionText` (what it says). If `earlierVersion` is true, end the heading with `· asked about an earlier version` — the screen may have changed since.
483
703
  - **options**, in this order:
484
704
  - `Apply` — *I make the change now. Sam sees it done on the board.*
485
705
  - `Decline` — *Sam sees your reason on the board.*
@@ -556,7 +776,7 @@ Removal is for the record being false, not for the user disliking what it says.
556
776
 
557
777
  *"Be quieter about decisions"*, *"stop telling me"*, *"stop asking me to review"*, *"tell me after everything"* — run `npx arbiter setup --checkin quiet|feature|every` and confirm in a few words. No question. Only `quiet` stops the review question, and it stops the line after big work too; if they only asked about the question, the confirmation says so: `Quiet now: no lines, no questions.`
558
778
 
559
- ## Retiring a rule
779
+ ## Retiring or rewording a rule
560
780
 
561
781
  If the user says a rule is dead with nothing replacing it — *"we don't need the empty-state rule any more"* — retire it, reason in their words:
562
782
 
@@ -566,6 +786,14 @@ npx arbiter record --retire D-0004 --why "empty states now come from the design
566
786
 
567
787
  It leaves `DECISIONS.md`; the archive keeps it and the reason. Don't retire on your own judgment.
568
788
 
789
+ If the rule stands but its words are wrong — *"that's about status pills, not all pills"* — reword it. Same id, same reason; the old wording stays on the entry:
790
+
791
+ ```
792
+ npx arbiter record --reword D-0003 --to "Status pills are outlined"
793
+ ```
794
+
795
+ A rule that says something different now isn't a rewording: that's a new rule that supersedes it.
796
+
569
797
  ## When invoked as `/arbiter`
570
798
 
571
799
  - `/arbiter` alone — `npx arbiter pull` if the project has a hosted board, then read `npx arbiter rules --pending --json`. Approved requests first (make them), then open requests (answer them), then everything queued, widget or text format above, judging each with `record P-xxxx --as …`. If nothing is queued and no request is waiting, say so in one line.
@@ -576,7 +804,7 @@ It leaves `DECISIONS.md`; the archive keeps it and the reason. Don't retire on y
576
804
  If the user says something like *"record that"*, *"make that a rule"*, *"reject the tabs, going with a single page"*, *"always do X from now on"* — mid-conversation, with or without a build:
577
805
 
578
806
  1. Turn what they said into a `decision` and a `rationale`. Anything they rejected goes in `rejected`. Use their wording where you can.
579
- 2. Default `verdict` to `rule`. Use `accept` only if they signal a one-off (*"just this once"*, *"an exception"*, *"for this screen only"*).
807
+ 2. Default `verdict` to `rule`. Use `accept` only if they signal a one-off (*"just this once"*, *"an exception"*, *"for this screen only"*). `call` is `asked`, or `corrected` if they're changing something you did.
580
808
  3. Run `record`. Do not ask for confirmation — they already told you.
581
809
  4. Confirm in two lines: the id, then the decision as recorded so they can catch a bad phrasing.
582
810
  5. If `record`'s reply has a `picture` line, the screen this changed has no picture yet. Take it now, the way **Screenshots** above says, while the app is still running. If you can't, say why in one line, as that section shows.
@@ -593,12 +821,15 @@ Recorded D-0010 (accept), D-0011 (rule), +3 polish · DECISIONS.md: 6 of 40
593
821
 
594
822
  ## Never
595
823
 
596
- - Edit `DECISIONS.md` or `.arbiter/archive.md` by hand. Always go through `record`, `remove` or `unlink`.
824
+ - Edit `DECISIONS.md` or `.arbiter/archive.md` by hand. Always go through `record`, `remove`, `unlink` or `rename`.
597
825
  - Remove a record because the user disagrees with it. Removal is for records that are false; a call they've changed their mind about is a new decision that supersedes the old one.
598
826
  - Record something the user didn't select.
599
827
  - Make a change someone asked for on the board before the owner approved it, or write a decline's reason for them.
600
828
  - Ask the user to write a rationale. Draft it; they correct it.
601
829
  - Re-try an alternative that `DECISIONS.md` lists as rejected.
602
830
  - Ask about polish. It's logged with the group.
831
+ - Edit `DESIGN.md`, the design system's docs, or the shared components to fit a rule without asking.
832
+ - Ask about the same clash twice. Every answer is recorded so it doesn't come back.
833
+ - Add a warning or an opinion to a clash. Facts, one question, the options.
603
834
  - Cram Change, Pattern and Rejected into one sentence. Three labelled lines, always.
604
- - Mention Arbiter at the end of a reply except as **After UI work** says: the line after the work the check-in setting names, and a question only when `ask` came back. At most one of those per reply, never mid-iteration. The `Following` line, the stale-skill notice and a `No picture for…` line are separate; their own sections say when.
835
+ - Mention Arbiter at the end of a reply except as **After UI work** says: the line after the work the check-in setting names, and a question only when `ask` came back. At most one of those per reply, never mid-iteration. The `Following` line, a clash, the stale-skill notice and a `No picture for…` line are separate; their own sections say when.