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.
@@ -1,6 +1,6 @@
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
@@ -9,7 +9,7 @@ description: Record design decisions made during UI work so they never have to b
9
9
 
10
10
  ## Before UI work
11
11
 
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.
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 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
13
 
14
14
  **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
15
 
@@ -25,6 +25,173 @@ How often follows the check-in setting (`checkin` in `arbiter.json`; `feature` w
25
25
 
26
26
  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
27
 
28
+ ## When something clashes with a rule
29
+
30
+ 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.
31
+
32
+ **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.
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ 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`.
39
+
40
+ ### The user asks for something a rule goes against
41
+
42
+ 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.
43
+
44
+ Don't build yet. Write three lines:
45
+
46
+ ```
47
+ **Before building, Arbiter found a clash.**
48
+ You asked for <what they asked for, in their words>, which goes against rule <ID>.
49
+ **<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>)
50
+ ```
51
+
52
+ Then ask (widget header: the rule's id):
53
+
54
+ ```
55
+ Do you still want <what they asked for>?
56
+ 1. No, follow <ID>: builds it the rule's way, <what the rule produces, one phrase>.
57
+ 2. Yes, just this once: builds <what they asked for> here only; <ID> stays.
58
+ 3. Other: type something else, or "update the rule" and why.
59
+ ```
60
+
61
+ If you see a way to meet both, say it in one sentence before the question, never as an option.
62
+
63
+ After the answer:
64
+
65
+ - **1** — build it the rule's way. Say `Following <ID>.`
66
+ - **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>.`
67
+ - **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>.`
68
+ - **Other, anything else** — do what they typed. If that clashes with a rule too, same shape again.
69
+
70
+ They decided on the spot, so none of this goes to the review queue.
71
+
72
+ ### A rule disagrees with the design system
73
+
74
+ You notice it while preparing what they asked for; they didn't ask for anything against either.
75
+
76
+ 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.
77
+
78
+ Otherwise, don't build yet. Write four lines:
79
+
80
+ ```
81
+ **Before building, Arbiter found a clash.**
82
+ Rule <ID> goes against <file>.
83
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
84
+ **<file> · <section>** · <what the design system says, one sentence>.
85
+ ```
86
+
87
+ 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)`.
88
+
89
+ Then ask (widget header: the rule's id):
90
+
91
+ ```
92
+ Which should <the thing being built> follow?
93
+ 1. <file>: builds <the design system's version>. <ID> moves to the archive.
94
+ 2. <ID>, as an exception: builds <the rule's version>. <ID> becomes an exception.
95
+ 3. Other: type something else, or "suggest a design system change" and why.
96
+ ```
97
+
98
+ After the answer:
99
+
100
+ - **1** — build the design system's version. `npx arbiter record --retire <ID> --why "<file> covers this"`.
101
+ - **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.
102
+ - **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.
103
+
104
+ ### Two rules disagree
105
+
106
+ Check these in order and stop at the first that fits:
107
+
108
+ | | When | Do |
109
+ |---|---|---|
110
+ | 1 | They're about different things: "status pills are outlined", "filter pills are filled" | Follow both, each for its own thing. No question |
111
+ | 2 | One is for a narrower area: "pills are outlined", "checkout pills are filled" | The narrower rule wins in its area. No question |
112
+ | 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"`) |
113
+ | 4 | Same thing, opposite answers, or too vague to tell | Ask, below |
114
+
115
+ For 4, don't build yet. Write five lines, the rules in id order:
116
+
117
+ ```
118
+ **Before building, Arbiter found a clash.**
119
+ Rules <ID> and <ID> disagree.
120
+ **<The thing>: <one answer> or <the other>?**
121
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
122
+ **<ID>** · <the rule, as an instruction>. <its reason>. (<author>, <date>)
123
+ ```
124
+
125
+ Then ask (widget header: `Rule clash`), the newer rule first:
126
+
127
+ ```
128
+ Which should they follow?
129
+ 1. <newer ID> (newer): builds <its version>. Replaces <older ID>, which goes to the decision archive.
130
+ 2. <older ID>: builds <its version>. Replaces <newer ID>, which goes to the decision archive.
131
+ 3. Both, for different <things>: keeps both. I'll ask which <things> each is for and reword them.
132
+ 4. Other: type something else.
133
+ ```
134
+
135
+ After the answer:
136
+
137
+ - **1 or 2** — build the chosen rule's version. `npx arbiter record --retire <the other> --why "Replaced by <the chosen one>"`.
138
+ - **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.
139
+ - **Other** — do what they typed.
140
+
141
+ ### Other screens don't follow the rule
142
+
143
+ 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.
144
+
145
+ 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.
146
+
147
+ ```
148
+ Following <ID>.
149
+ <Screen> uses <what it does>, which goes against it.
150
+ ```
151
+
152
+ Then ask (widget header: the rule's id):
153
+
154
+ ```
155
+ Update <Screen> too?
156
+ 1. Yes, update <Screen>: <what changes, one phrase>.
157
+ 2. Not now: leaves <Screen> as it is. Added to your review list, so it isn't asked again.
158
+ 3. Other: type something else.
159
+ ```
160
+
161
+ 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".
162
+
163
+ After the answer:
164
+
165
+ - **Yes** — change them to follow the rule. Nothing to record.
166
+ - **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.
167
+ - **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.
168
+
169
+ ### A rule needs something the design system doesn't have
170
+
171
+ 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:
172
+
173
+ ```
174
+ **Before building, Arbiter found a clash.**
175
+ **<ID>** · The <screen> needs <what the rule needs>, but the design system doesn't have one.
176
+ ```
177
+
178
+ Then ask (widget header: the rule's id):
179
+
180
+ ```
181
+ Build one?
182
+ 1. Plan and build one: shows you a short plan for the <thing> first. Builds it once you're happy. This <screen> only.
183
+ 2. Leave for now: builds the <screen> without the <thing> for now. Added to your review list.
184
+ 3. Other: type something else, or "add it to the shared components".
185
+ ```
186
+
187
+ 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?`.
188
+
189
+ After the answer:
190
+
191
+ - **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.
192
+ - **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"`.
193
+ - **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.
194
+
28
195
  ## After UI work — queue, don't interrupt
29
196
 
30
197
  Design work is iterative. A screen redesigned six times is one piece of work, not six. Never surface decisions mid-iteration.
@@ -95,7 +262,7 @@ Then one question, with the selection widget (text fallback: the same three line
95
262
  - **question** — `When should Arbiter check in about decisions?`
96
263
  - **options** —
97
264
  - `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.*
265
+ - `Nothing until I ask` — *Saved silently. Asks only when something clashes with a rule. /arbiter whenever you want to see it.*
99
266
  - `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
267
 
101
268
  Record the answer — Skip means the recommended one:
@@ -159,7 +326,17 @@ For each decision, note what it was chosen **over**. Rejected alternatives come
159
326
  2. **Options you weighed and didn't build.** You considered tabs, went with a single page. Tabs are rejected, with your reason.
160
327
  3. **Corrections.** Whatever you did that the user then changed is rejected; what they asked for is the decision.
161
328
 
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`.
329
+ **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`.
330
+
331
+ **Only real choices.** Queue something only if someone actually chose it, and set `call` to say who:
332
+
333
+ | `call` | When | Example |
334
+ |---|---|---|
335
+ | `asked` | The user asked for it | "Put the errors at the top of the form" |
336
+ | `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" |
337
+ | `agent` | You weighed real options, picked one, and can say why | Tabs or a dropdown for the filters; you picked tabs |
338
+
339
+ 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
340
 
164
341
  Skip mechanical necessities (imports, prop plumbing, file placement), and non-visual things the user told you to do.
165
342
 
@@ -171,13 +348,13 @@ Skip mechanical necessities (imports, prop plumbing, file placement), and non-vi
171
348
  | `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
349
  | `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
350
 
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.
351
+ 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
352
 
176
353
  ### Clashes with a rule
177
354
 
178
355
  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
356
 
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.
357
+ 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
358
 
182
359
  ### Present with the selection widget
183
360
 
@@ -208,7 +385,7 @@ Each question:
208
385
  **A clash** adds a line under `Applies to` — `Clashes — D-0009 · Destructive actions undo instead of confirming` — and has its own three options:
209
386
 
210
387
  - `Follow D-0009` — *Change it back to match the rule.*
211
- - `Replace D-0009` — *This becomes the rule; D-0009 moves to the archive.*
388
+ - `Replace D-0009` — *This becomes the rule; D-0009 goes to the decision archive.*
212
389
  - `Keep as exception` — *Logged as a one-off here; D-0009 stands.*
213
390
 
214
391
  ### Fallback: present as text
@@ -252,7 +429,7 @@ Omit the `Rejected` line when there's nothing rejected. Never ask an open questi
252
429
  | Other: a correction | `fix --to "…"` | Change the code to match, then judge it. What you did becomes a rejected alternative automatically. |
253
430
  | Follow D-0009 | `fix --to "<D-0009's decision>"` | Change the code back to match the rule, then judge it. |
254
431
  | 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. |
432
+ | Keep as exception | `accept --against D-0009` | Judge it. The rule stands; this screen is the logged exception. |
256
433
  | Widget Skip button | — | Nothing. The queue waits. |
257
434
 
258
435
  Never judge anything before the user answers.
@@ -271,11 +448,12 @@ Used by `record --pending` (queue) and `record` (record now):
271
448
  "trigger": "Audit page",
272
449
  "scope": "pattern:compact-card-actions",
273
450
  "dimension": "interaction",
274
- "class": "judgment"
451
+ "class": "judgment",
452
+ "call": "corrected"
275
453
  }
276
454
  ```
277
455
 
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.
456
+ 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.
279
457
 
280
458
  `verdict` is omitted when queueing (`--pending`); include it (`accept | rule | fix`) only when recording directly.
281
459
 
@@ -293,7 +471,7 @@ If the work belongs to a candidate (below), add `"candidate": "C-0001"` or pass
293
471
  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
472
 
295
473
  - `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`.
474
+ - `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
475
  - `level` — `feature | pattern | polish` (table above). Default is `pattern`; set it every time.
298
476
  - `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
477
  - `rationale` — why it won. One line. Required.
@@ -301,6 +479,8 @@ If the session mentioned a ticket — a Linear or Jira key like `ENG-123`, a Git
301
479
  - `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
480
  - `dimension` — one of the seven above.
303
481
  - `class` — `mechanical` if it could be checked against a token or lint rule (colours, spacing, type scale, radii); `judgment` otherwise. Most rules are judgment.
482
+ - `call` — who made the call: `asked` · `corrected` · `agent` (see **What counts as a decision**). Set it every time.
483
+ - `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
484
  - `files` / `expect` — mechanical only. Name the files you touched and the literal strings that prove the claim.
305
485
  - `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
486
 
@@ -556,7 +736,7 @@ Removal is for the record being false, not for the user disliking what it says.
556
736
 
557
737
  *"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
738
 
559
- ## Retiring a rule
739
+ ## Retiring or rewording a rule
560
740
 
561
741
  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
742
 
@@ -566,6 +746,14 @@ npx arbiter record --retire D-0004 --why "empty states now come from the design
566
746
 
567
747
  It leaves `DECISIONS.md`; the archive keeps it and the reason. Don't retire on your own judgment.
568
748
 
749
+ 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:
750
+
751
+ ```
752
+ npx arbiter record --reword D-0003 --to "Status pills are outlined"
753
+ ```
754
+
755
+ A rule that says something different now isn't a rewording: that's a new rule that supersedes it.
756
+
569
757
  ## When invoked as `/arbiter`
570
758
 
571
759
  - `/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 +764,7 @@ It leaves `DECISIONS.md`; the archive keeps it and the reason. Don't retire on y
576
764
  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
765
 
578
766
  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"*).
767
+ 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
768
  3. Run `record`. Do not ask for confirmation — they already told you.
581
769
  4. Confirm in two lines: the id, then the decision as recorded so they can catch a bad phrasing.
582
770
  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.
@@ -600,5 +788,8 @@ Recorded D-0010 (accept), D-0011 (rule), +3 polish · DECISIONS.md: 6 of 40
600
788
  - Ask the user to write a rationale. Draft it; they correct it.
601
789
  - Re-try an alternative that `DECISIONS.md` lists as rejected.
602
790
  - Ask about polish. It's logged with the group.
791
+ - Edit `DESIGN.md`, the design system's docs, or the shared components to fit a rule without asking.
792
+ - Ask about the same clash twice. Every answer is recorded so it doesn't come back.
793
+ - Add a warning or an opinion to a clash. Facts, one question, the options.
603
794
  - 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.
795
+ - 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.
@@ -296,6 +296,7 @@ function card(d) {
296
296
  const line = (k, v, cls) => { dl.appendChild(el('dt', null, k)); dl.appendChild(el('dd', cls, v)); };
297
297
  if (d.change) line('Pattern', d.decision);
298
298
  for (const r of d.rejected) line('Rejected', r);
299
+ if (d.againstRule) line('Clashes', `${d.againstRule.id} · ${d.againstRule.decision}`);
299
300
  line('Why', d.rationale, 'muted');
300
301
  body.appendChild(dl);
301
302
  const meta = el('div', 'meta');
@@ -334,6 +335,16 @@ async function sendRow(d, li, body) {
334
335
 
335
336
  function actions(d, c) {
336
337
  const a = el('div', 'actions');
338
+ // Goes against a rule: someone has to say which wins. Same three choices as the review in chat.
339
+ const r = d.againstRule;
340
+ if (r) {
341
+ // The page records; it can't change code. Following the rule still needs the agent to do it.
342
+ a.appendChild(btn(`Follow ${r.id}`, 'primary', () => send(d, c, { as: 'fix', to: r.decision }, `Recorded. Ask your agent to change it to match ${r.id}.`)));
343
+ a.appendChild(btn(`Replace ${r.id}`, null, () => send(d, c, { as: 'rule', supersedes: r.id })));
344
+ a.appendChild(btn('Keep as exception', null, () => send(d, c, { as: 'accept' }, `Recorded as an exception to ${r.id}.`)));
345
+ a.appendChild(btn('Skip', 'quiet', () => send(d, c, { as: 'skip' })));
346
+ return a;
347
+ }
337
348
  a.appendChild(btn('Confirm', d.level === 'polish' ? 'primary' : null, () => send(d, c, { as: 'accept' })));
338
349
  if (d.level !== 'polish') a.appendChild(btn('Make it a rule', 'primary', () => send(d, c, { as: 'rule' })));
339
350
  a.appendChild(btn('Skip', 'quiet', () => send(d, c, { as: 'skip' })));
@@ -383,7 +394,7 @@ function contradictedPanel(d, c, res) {
383
394
  c.appendChild(p);
384
395
  }
385
396
 
386
- async function send(d, c, body) {
397
+ async function send(d, c, body, done) {
387
398
  c.querySelectorAll('button').forEach(b => b.disabled = true);
388
399
  const res = await (await fetch('/api/judge', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ id: d.id, ...body }) })).json();
389
400
  c.querySelectorAll('button').forEach(b => b.disabled = false);
@@ -392,7 +403,7 @@ async function send(d, c, body) {
392
403
  if (res.exitCode === 4) return contradictedPanel(d, c, res);
393
404
  if (res.exitCode !== 0) return messagePanel(c, (res.errors || ['Something went wrong']).join(' · '), 'bad');
394
405
  results[d.id] = { item: d, kind: res.status === 'skipped' ? 'skip' : 'ok',
395
- text: res.status === 'skipped' ? 'Skipped' : `Recorded ${res.id} as ${res.verdict}${res.supersedes ? ', replacing ' + res.supersedes : ''}` };
406
+ text: res.status === 'skipped' ? 'Skipped' : done ?? `Recorded ${res.id} as ${res.verdict}${res.supersedes ? ', replacing ' + res.supersedes : ''}` };
396
407
  await load();
397
408
  }
398
409