arbiterdesign 0.1.8 → 0.1.10

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.
Files changed (42) hide show
  1. package/README.md +288 -242
  2. package/dist/area-names.js +120 -0
  3. package/dist/areas.js +131 -0
  4. package/dist/board-types.js +9 -0
  5. package/dist/candidates.js +7 -1
  6. package/dist/commands/areas.js +153 -0
  7. package/dist/commands/candidate.js +4 -2
  8. package/dist/commands/decision.js +100 -0
  9. package/dist/commands/export.js +88 -125
  10. package/dist/commands/init.js +198 -73
  11. package/dist/commands/invite.js +67 -0
  12. package/dist/commands/publish.js +4 -4
  13. package/dist/commands/record.js +133 -8
  14. package/dist/commands/remove.js +1 -1
  15. package/dist/commands/rename.js +25 -11
  16. package/dist/commands/review.js +458 -78
  17. package/dist/commands/rules.js +22 -3
  18. package/dist/commands/setup.js +1 -0
  19. package/dist/commands/snapshot.js +24 -2
  20. package/dist/commands/sweep.js +1 -1
  21. package/dist/commands/update.js +5 -0
  22. package/dist/comments.js +24 -0
  23. package/dist/format.js +112 -7
  24. package/dist/handoff.js +286 -0
  25. package/dist/hook.js +82 -0
  26. package/dist/hosted.js +50 -17
  27. package/dist/index.js +99 -37
  28. package/dist/localboard.js +219 -0
  29. package/dist/lock.js +134 -0
  30. package/dist/overlap.js +16 -0
  31. package/dist/pictures.js +4 -0
  32. package/dist/settings.js +107 -0
  33. package/dist/store.js +164 -8
  34. package/dist/verify.js +4 -2
  35. package/dist/work.js +110 -1
  36. package/package.json +3 -2
  37. package/templates/SKILL.md +146 -51
  38. package/templates/board/board.css +2 -0
  39. package/templates/board/board.js +25 -0
  40. package/templates/board/index.html +15 -0
  41. package/templates/hooks/arbiter-board.cjs +50 -0
  42. package/templates/review.html +0 -757
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Board</title>
7
+ <link rel="stylesheet" href="board.css">
8
+ <!-- Dark only when chosen, as on the team board; applied before the first paint. -->
9
+ <script>try { if (localStorage.getItem('arbiter-theme') === 'dark') document.documentElement.setAttribute('data-theme', 'dark'); } catch (e) {}</script>
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ <script src="board.js"></script>
14
+ </body>
15
+ </html>
@@ -0,0 +1,50 @@
1
+ // Written by Arbiter (npx arbiter init). Claude Code runs it before each message you send
2
+ // (.claude/settings.json, UserPromptSubmit). When you've judged something on the local board that
3
+ // needs the code changed, or changed a design rule there, it tells the agent, once, so it acts on it
4
+ // now rather than at the next /arbiter. The rest of the time it says nothing.
5
+ 'use strict';
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ let root = process.env.CLAUDE_PROJECT_DIR;
10
+ if (!root) {
11
+ try { root = JSON.parse(fs.readFileSync(0, 'utf8')).cwd; } catch { /* no input: the current folder */ }
12
+ }
13
+ const dir = path.join(root || process.cwd(), '.arbiter');
14
+ const file = path.join(dir, 'last-review.json');
15
+ // What the agent was last told, as it was told it. `arbiter review --done` clears that much from the
16
+ // file once it's made; anything the board adds meanwhile stays. The board's file is only ever read here.
17
+ const seenFile = path.join(dir, 'last-review.seen.json');
18
+
19
+ let h;
20
+ try { h = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { process.exit(0); }
21
+ const todo = Array.isArray(h.todo) ? h.todo : [];
22
+ const rules = Array.isArray(h.rules) ? h.rules : [];
23
+ const reworded = Array.isArray(h.reworded) ? h.reworded : [];
24
+ const removed = Array.isArray(h.removed) ? h.removed : [];
25
+ const renamed = Array.isArray(h.renamed) ? h.renamed : [];
26
+ if (!todo.length && !rules.length && !reworded.length && !removed.length && !renamed.length) process.exit(0);
27
+ // Told already, and nothing new since.
28
+ const same = (a, b) => { const { told: _a, ...x } = a; const { told: _b, ...y } = b; return JSON.stringify(x) === JSON.stringify(y); };
29
+ try { if (same(JSON.parse(fs.readFileSync(seenFile, 'utf8')), h)) process.exit(0); } catch { /* not told yet */ }
30
+
31
+ const line = (t) =>
32
+ t.kind === 'fix' ? `- ${t.id}: they corrected it. The code still does "${t.change}"; make it do "${t.to}".`
33
+ : t.kind === 'follow' ? `- ${t.id}: they chose the rule ${t.rule}. Change the code back so it does "${t.to}".`
34
+ : `- ${t.id}: an approved request from ${t.author}${t.screen ? ` on ${t.screen}` : ''}: ${t.do}. Make it, then record it with --request ${t.id}.`;
35
+
36
+ const said = ['Arbiter: since your last turn, the user judged decisions on the local board.'];
37
+ if (todo.length) {
38
+ said.push(`${todo.length === 1 ? 'One change waits' : `${todo.length} changes wait`} for you. Before you answer their message, make ${todo.length === 1 ? 'it' : 'them'} as the arbiter skill's "Reviewing in the browser" says. ${todo.length === 1 ? "It's" : "They're"} recorded already, so don't judge or record ${todo.length === 1 ? 'it' : 'them'} again.`);
39
+ said.push(...todo.map(line));
40
+ }
41
+ if (rules.length) said.push(`New rules in DECISIONS.md, in force from now: ${rules.join(', ')}. Read them before your next UI change.`);
42
+ if (reworded.length) said.push('Rules they edited in DECISIONS.md. Follow them as they read now, not as you last read them:', ...reworded.map((r) => `- ${r.id} now says "${r.to}"`));
43
+ if (renamed.length) said.push('Work they renamed on the board. Use the new name as the trigger from now on:', ...renamed.map((r) => `- "${r.from}" is now "${r.to}"`));
44
+ if (removed.length) said.push('Rules they removed from DECISIONS.md. Stop following them; the code needs no change unless they ask:', ...removed.map((r) => `- ${r.id} ("${r.rule}"): ${r.why}`));
45
+ said.push(todo.length
46
+ ? 'Then run `npx arbiter review --done` (it clears what you were just told, and keeps anything they judge meanwhile; never delete the file yourself), say in one line what you changed, and answer their message.'
47
+ : 'Then run `npx arbiter review --done` and answer their message.');
48
+
49
+ try { fs.writeFileSync(seenFile, JSON.stringify(h, null, 2) + '\n'); } catch { /* it says it again next time */ }
50
+ process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: 'UserPromptSubmit', additionalContext: said.join('\n') } }));