@olegkoval/agent-skills 1.88.0 → 1.90.0

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 (33) hide show
  1. package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +112 -20
  2. package/adapters/claude/olko-github-pr/skills/lekker-review/references/codex-workflow.md +12 -0
  3. package/adapters/claude/olko-github-pr/skills/lekker-review/references/github-post.md +3 -2
  4. package/adapters/claude/olko-github-pr/skills/lekker-review/references/output-format.md +23 -2
  5. package/adapters/claude/olko-github-pr/skills/lekker-review/references/traces.md +1 -1
  6. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/lekker-progress.mjs +106 -0
  7. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +152 -0
  8. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +27 -2
  9. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +1 -1
  10. package/package.json +1 -1
  11. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  12. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  13. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  14. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  15. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  16. package/plugins/olko-github-pr/skills/lekker-review/README.md +53 -0
  17. package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +112 -20
  18. package/plugins/olko-github-pr/skills/lekker-review/fix-workflow.js +21 -8
  19. package/plugins/olko-github-pr/skills/lekker-review/references/codex-workflow.md +12 -0
  20. package/plugins/olko-github-pr/skills/lekker-review/references/github-post.md +3 -2
  21. package/plugins/olko-github-pr/skills/lekker-review/references/output-format.md +23 -2
  22. package/plugins/olko-github-pr/skills/lekker-review/references/traces.md +1 -1
  23. package/plugins/olko-github-pr/skills/lekker-review/scripts/lekker-progress.mjs +106 -0
  24. package/plugins/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +152 -0
  25. package/plugins/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +27 -2
  26. package/plugins/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +1 -1
  27. package/plugins/olko-github-pr/skills/lekker-review/workflow.js +79 -23
  28. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  29. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  30. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  31. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  32. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  33. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
@@ -11,6 +11,8 @@
11
11
  // node run-log.mjs start --repo <slug> --target <pr-N|branch-x> --mode pr|branch \
12
12
  // --depth <d> --engine workflow|revmux [--fix] [--host claude]
13
13
  // node run-log.mjs mark <runId> <phase> [--note <text>]
14
+ // node run-log.mjs decide <runId> --kind depth|tier|route|finding|fix|post --what <text> --why <text>
15
+ // node run-log.mjs decide <runId> --from-json <file> array of {kind, what, why}
14
16
  // node run-log.mjs attach <runId> <file>...
15
17
  // node run-log.mjs finish <runId> --status ok|failed|aborted [--verdict lgtm|lgtm-with-changes|needs-work]
16
18
  // [--review-file <path>] [--artifact-url <url>] [--wf <wf_id>]... [--note <text>]
@@ -37,6 +39,7 @@ const LEDGER = join(STATE_DIR, 'runs.jsonl');
37
39
  const PROJECTS_DIR = process.env.LEKKER_CLAUDE_PROJECTS || join(homedir(), '.claude', 'projects');
38
40
  const REVMUX_TASKS = process.env.LEKKER_REVMUX_TASKS_DIR || join(homedir(), 'code-reviews', 'revmux-tasks');
39
41
 
42
+ const DECISION_KINDS = ['depth', 'tier', 'route', 'finding', 'fix', 'post'];
40
43
  const argv = process.argv.slice(2);
41
44
  const cmd = argv[0];
42
45
 
@@ -171,6 +174,25 @@ if (cmd === 'start') {
171
174
  if (!existsSync(dir)) fail(`no run ${runId}`);
172
175
  appendFileSync(join(dir, 'timeline.jsonl'), JSON.stringify({ phase, at: new Date().toISOString(), note: flag('note') ?? undefined }) + '\n');
173
176
  console.log(JSON.stringify({ runId, phase }));
177
+ } else if (cmd === 'decide') {
178
+ const runId = argv[1];
179
+ const dir = runDir(runId);
180
+ if (!existsSync(dir)) fail(`no run ${runId}`);
181
+ const fromJson = flag('from-json');
182
+ const raw = fromJson ? readJson(fromJson) : [{ kind: flag('kind'), what: flag('what'), why: flag('why') }];
183
+ if (!Array.isArray(raw)) fail(`--from-json ${fromJson} must hold an array of {kind, what, why}`);
184
+ const text = (v) => (typeof v === 'string' ? v.replace(/\s+/g, ' ').trim() : '');
185
+ const rows = raw.map((d, i) => ({ kind: text(d?.kind), what: text(d?.what), why: text(d?.why), i }));
186
+ const bad = rows.find((r) => !DECISION_KINDS.includes(r.kind) || !r.what || !r.why);
187
+ if (bad) {
188
+ fail(!DECISION_KINDS.includes(bad.kind)
189
+ ? `decision ${bad.i}: unknown kind "${bad.kind}" (use ${DECISION_KINDS.join('|')})`
190
+ : `decision ${bad.i}: --what and --why must be non-empty`);
191
+ }
192
+ const at = new Date().toISOString();
193
+ const lines = rows.map(({ kind, what, why }) => JSON.stringify({ at, kind, what, why }) + '\n').join('');
194
+ appendFileSync(join(dir, 'timeline.jsonl'), lines);
195
+ console.log(JSON.stringify({ runId, decisions: rows.length }));
174
196
  } else if (cmd === 'attach') {
175
197
  const runId = argv[1];
176
198
  const dir = runDir(runId);
@@ -188,7 +210,10 @@ if (cmd === 'start') {
188
210
  const meta = readJson(join(dir, 'run.json'));
189
211
  if (!meta) fail(`no run ${runId}`);
190
212
  const finishedAt = new Date().toISOString();
191
- const timeline = [...readJsonl(join(dir, 'timeline.jsonl')), { phase: 'finish', at: finishedAt }];
213
+ const rows = readJsonl(join(dir, 'timeline.jsonl'));
214
+ // Decision rows have no phase; keeping them out of the timeline keeps phaseDurations exact.
215
+ const timeline = [...rows.filter((r) => r.phase && r.phase !== 'finish'), { phase: 'finish', at: finishedAt }];
216
+ const decisions = rows.filter((r) => r.kind);
192
217
  const workflows = flags('wf').map((id) => summariseWorkflow(findWorkflowRecord(id) || { runId: id }));
193
218
  const reviewWf = workflows.find((w) => w.name === 'lekker-review-core') || null;
194
219
  const row = {
@@ -206,7 +231,7 @@ if (cmd === 'start') {
206
231
  artifactUrl: flag('artifact-url'),
207
232
  note: flag('note', meta.note ?? null),
208
233
  };
209
- writeFileSync(join(dir, 'run.json'), JSON.stringify({ ...row, timeline }, null, 2) + '\n');
234
+ writeFileSync(join(dir, 'run.json'), JSON.stringify({ ...row, timeline, decisions }, null, 2) + '\n');
210
235
  append(row);
211
236
  const unresolved = workflows.filter((w) => w.durationS == null).map((w) => w.wfId);
212
237
  console.log(JSON.stringify({ runId, ledger: LEDGER, wallS: row.wallS, tokensTotal: row.tokensTotal, unresolvedWorkflows: unresolved }));
@@ -333,7 +333,7 @@ console.log('\ndeps depth: routing, classifier, line validation')
333
333
  check('workflow.js defines dimensionsFor', Boolean(dimsSrc), true)
334
334
  if (dimsSrc) {
335
335
  const dimensionsFor = new Function(dimsSrc + '\nreturn dimensionsFor')()
336
- const M = { review: 'r', triage: 't' }
336
+ const M = { specialist: { model: 's' }, triage: { model: 't' }, rules: { model: 'r' } }
337
337
  check('deps runs exactly one agent', dimensionsFor('deps', M).map(d => d.file), ['deps.md'])
338
338
  check('scan runs the triage pair plus project-rules', dimensionsFor('scan', M).map(d => d.key), ['triage-quality', 'triage-logic', 'project-rules'])
339
339
  check('medium runs five specialists plus project-rules', dimensionsFor('medium', M).length, 6)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olegkoval/agent-skills",
3
- "version": "1.88.0",
3
+ "version": "1.90.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-apple-kit",
3
3
  "description": "Build and ship Apple platform apps: macOS menubar apps, App Store submissions.",
4
- "version": "1.88.0",
4
+ "version": "1.90.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-creative",
3
3
  "description": "Creative and personal projects: photo galleries, music players, listings, wiki editing.",
4
- "version": "1.88.0",
4
+ "version": "1.90.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-garmin-kit",
3
3
  "description": "Build, test and publish Garmin Connect IQ watch faces.",
4
- "version": "1.88.0",
4
+ "version": "1.90.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-git-tools",
3
3
  "description": "Everyday git and GitHub CLI operations: conventional commits, branch hygiene.",
4
- "version": "1.88.0",
4
+ "version": "1.90.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-github-pr",
3
3
  "description": "Drive GitHub pull requests to merge-ready: review-bot loops, CI fixes, descriptions, dependency triage.",
4
- "version": "1.88.0",
4
+ "version": "1.90.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -29,6 +29,45 @@ This skill spends most of its budget trying to disprove itself.
29
29
  the real `git diff`, and the captured proof re-run. If the proof stays red the
30
30
  group is reverted. Nothing is pushed without explicit confirmation.
31
31
 
32
+ ## Models and effort
33
+
34
+ The model is not the main lever: a reviewer finds more when it spends effort
35
+ checking callers, tests, error paths and assumptions. So each agent's effort
36
+ rises with the PR's risk first, and the model grows only for risky changes.
37
+ Not every agent gets the same tier: the agents that find issues stay one step
38
+ below the verifier, because the verifier decides what survives. Haiku and Luna
39
+ only ever do a cheap first pass, never the final check.
40
+
41
+ Each host uses its own vendor's models: Claude Code runs Claude models, Codex
42
+ runs Codex models. Cells read `Claude / Codex`.
43
+
44
+ | Agent | routine | standard | elevated | critical |
45
+ | --- | --- | --- | --- | --- |
46
+ | Triage (scan depth, first pass only) | Haiku medium / Luna medium | Haiku medium / Luna medium | Haiku medium / Luna medium | Haiku medium / Luna medium |
47
+ | Specialists x5 (quality, implementation, simplification, conventions, test-quality) | Sonnet medium / Sol medium | Sonnet high / Sol high | Opus high / Astra high | Opus xhigh / Astra xhigh |
48
+ | Project rules, deps checklist | Sonnet medium / Sol medium | Sonnet medium / Sol medium | Sonnet high / Sol high | Sonnet high / Sol high |
49
+ | Verifier, critic re-examine, fix verifier | Sonnet high / Sol high | Sonnet high / Sol high | Opus high / Astra high | Fable high / Astra high |
50
+ | Completeness critic (deep) | Sonnet medium / Sol medium | Sonnet high / Sol high | Opus high / Astra high | Fable xhigh / Astra xhigh |
51
+ | Prover (writes the failing test) | Sonnet high / Sol high | Sonnet high / Sol high | Sonnet high / Sol high | Opus high / Astra high |
52
+ | Fixer (--fix) | Sonnet high / Sol high | Sonnet high / Sol high | Sonnet high / Sol high | Opus high / Astra high |
53
+ | Comment polish (--post) | Sonnet medium / Sol medium | Sonnet medium / Sol medium | Sonnet medium / Sol medium | Sonnet medium / Sol medium |
54
+ | Housekeeping | Haiku low / Luna low | Haiku low / Luna low | Haiku low / Luna low | Haiku low / Luna low |
55
+
56
+ The risk tier is picked from the changed files, and `--risk <tier>` overrides it:
57
+
58
+ | Tier | When |
59
+ | --- | --- |
60
+ | routine | every changed file is documentation (`*.md`, `*.mdx`, `*.txt`, `*.rst`, `docs/`, `LICENSE`) |
61
+ | standard | everything else |
62
+ | elevated | CI workflows or installers, migrations or `*.sql`, or more than 800 changed lines or 25 files |
63
+ | critical | auth or billing paths |
64
+
65
+ Depth and tier are separate: depth decides how many agents run, the tier
66
+ decides how strong each one is. A UI-only diff runs the Codex specialists on
67
+ Terra high, the Codex model positioned for visual reasoning. The main loop
68
+ (context gathering and the final write-up) runs on your session model. The
69
+ table is generated from `scripts/model-matrix.mjs`; a test fails if they drift.
70
+
32
71
  ## Comment voice
33
72
 
34
73
  With `--post`, inline comments follow `references/comment-voice.md`: the ask,
@@ -67,6 +106,20 @@ Depth is auto-selected from the diff size when you do not name one: `scan` under
67
106
  150 changed lines and 5 files, `deep` over 800 changed lines or 25 files or when
68
107
  the diff touches migrations or `*.sql`, `medium` otherwise.
69
108
 
109
+ ## Progress and decisions
110
+
111
+ Every run keeps a decision log: the depth and why, the risk tier and why, the
112
+ model each role got, and for each Critical or Important finding whether the
113
+ verifier kept, downgraded or dropped it, with its one-line reason. The same
114
+ lines end up in the saved review under `## 🧭 Decisions`; `--quiet-decisions`
115
+ leaves that block out (the log still records everything).
116
+
117
+ While it runs, the skill prints one status line per milestone with
118
+ `scripts/lekker-progress.mjs --stage <stage> --message "<fact>"`: a small boat
119
+ drifting over a tide line toward a lighthouse, and a `🧭` compass line for each
120
+ decision. It animates only on a real terminal; in captured output, with
121
+ `NO_COLOR`, or with `--ascii` it prints a single plain line with no escape codes.
122
+
70
123
  ## Regenerating the posters
71
124
 
72
125
  The posters are self-contained HTML in `assets/`. Open either file in a browser
@@ -46,7 +46,7 @@ metadata:
46
46
  - multi-agent
47
47
  - workflow
48
48
  - quality
49
- argument-hint: "<github-pr-url | repo pr-number | repo pr-title | branch [ref]> [scan|medium|deep|deps] [--post] [--fix] [--base <ref>]"
49
+ argument-hint: "<github-pr-url | repo pr-number | repo pr-title | branch [ref]> [scan|medium|deep|deps] [--post] [--fix] [--base <ref>] [--risk routine|standard|elevated|critical] [--quiet-decisions]"
50
50
  ---
51
51
 
52
52
  # Lekker Review
@@ -328,8 +328,30 @@ and gather the newly required Track B sources before Step 2. Branch mode uses
328
328
  Track A's merge-base diff. State final depth and whether auto-selected in the
329
329
  review header.
330
330
 
331
+ **Risk tier and model routing (every depth, after AUTO-DEPTH):** depth decides
332
+ how many agents run; the risk tier decides which model and effort each one
333
+ gets. Run `scripts/model-matrix.mjs` with the same shell-free process API as the
334
+ risk check, using `--host claude|codex` from Host selection, `--lines` as
335
+ additions+deletions without lockfiles, `--categories` as the comma-joined
336
+ `categories[].category` from the risk-paths output, and `--risk <tier>` only
337
+ when the user passed it:
338
+ `execFileSync('node', [matrixScript, '--host', HOST, '--lines', String(lines), '--categories', cats, '--', ...changedPaths])`.
339
+ Store the printed JSON as `ROUTING_RESULT` and its `routing` object as
340
+ `ROUTING`. State the tier in the review header:
341
+ `Risk tier: <tier> (<auto: reason | --risk>)`. On classifier failure, report
342
+ it in one line and leave `ROUTING` unset: every agent then keeps the
343
+ workflow's built-in default (`sonnet`, `haiku` for triage). The full matrix is in `README.md`
344
+ under "Models and effort".
345
+
346
+ **`--risk routine|standard|elevated|critical` flag:** parse and pass to
347
+ `model-matrix.mjs` as `--risk`. It overrides the detected tier, never the depth.
348
+
331
349
  **`--post` flag:** parse and store as `POST_REVIEW=true`.
332
350
 
351
+ **`--quiet-decisions` flag:** parse and store as `QUIET_DECISIONS=true`: the
352
+ saved review omits the `## 🧭 Decisions` block. The run log still records every
353
+ decision.
354
+
333
355
  **`--fix` flag:** parse and store as `FIX_MODE=true`. Fix mode needs a real
334
356
  checkout, so `--fix` forces Track A (worktree setup) to run even when
335
357
  depth=scan. If the user did NOT pass `--fix`, leave `FIX_MODE=false` for now -
@@ -430,6 +452,54 @@ at each step boundary: `context` (Step 1), `review` (Step 2), `synthesis`
430
452
  (Step 3), `fix` (Step 4), `post` (Step 5). A marker is one line of JSON; never
431
453
  skip the review because the log failed, just say `run log unavailable`.
432
454
 
455
+ **Record the first decisions.** Right after `start`, write the two decisions made
456
+ before the log existed, one call each (`what` is the value, `why` the rule that
457
+ picked it, a short phrase; `--why` is mandatory):
458
+
459
+ ```bash
460
+ node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --kind depth --what <depth> --why "<AUTO-DEPTH rule | explicit>"
461
+ node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --kind tier --what <tier> --why "<auto: reason | --risk>"
462
+ ```
463
+
464
+ `decide` accepts only the kinds `depth`, `tier`, `route`, `finding`, `fix` and
465
+ `post`, and rejects an empty `--what` or `--why`; a failed call is
466
+ `run log unavailable`, never a reason to stop.
467
+
468
+ ---
469
+
470
+ ## Progress line
471
+
472
+ At each milestone below, run
473
+ `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/lekker-progress.mjs" --stage <stage> --message "<short fact>"`
474
+ (foreground, it returns in under a second; in Codex use the absolute path to
475
+ `scripts/lekker-progress.mjs` beside the selected `SKILL.md`). It prints one
476
+ status line (a boat drifting toward a lighthouse), animates only on a real
477
+ terminal, and always exits 0. It is decoration: run it after the milestone's own
478
+ output, never instead of it, and keep every count and reason in the report too.
479
+ Add `--ascii` on terminals that mis-measure emoji.
480
+
481
+ | Milestone | Stage | Message, e.g. |
482
+ | --- | --- | --- |
483
+ | Step 0 parsed the request | `start` | `owner/repo#42, medium, tier standard` |
484
+ | Step 1 context ready | `context` | `worktree ready, 4 sources` |
485
+ | Step 2 workflow started | `review` | `5 specialists + rules` |
486
+ | Step 2 verify began | `verify` | `verifying 6 findings` |
487
+ | Step 2 critic began (deep) | `critic` | `3 angles to re-examine` |
488
+ | Step 2 prove began | `prove` | `2 provers` |
489
+ | Step 3 review saved | `post` | `saved, 1 Critical, 2 Important` |
490
+ | Step 4 fixes applied | `fix` | `3 of 4 applied` |
491
+ | Step 5 posted | `post` | `5 inline comments, pending` |
492
+ | Run finished | `success` | `lgtm-with-changes, 1 Important` |
493
+ | Run failed or stopped | `failure` | `worktree setup failed` |
494
+
495
+ Every decision you write with `run-log.mjs decide` is also printed once, right
496
+ after it, with `--stage decision --message "<what>: <why>"`. That prints a
497
+ compass line without moving the boat, for example `verifier -> opus high:
498
+ elevated, migrations`, `dropped src/a.ts:12: not reachable from any caller`, or
499
+ `code smell kept as Idiomatic: duplicated tie-break, two copies disagree`. For
500
+ the workflow's bulk `decisions`, print the `route` entries as one line and each
501
+ `finding` entry on its own line.
502
+
433
503
  ---
434
504
 
435
505
  ## Depth gate
@@ -439,7 +509,7 @@ skip the review because the log failed, just say `run log unavailable`.
439
509
  | Context: issue-tracker/CI/diff/existing-reviews | always | always | always | always |
440
510
  | Context: chat/docs/framework-docs/monitoring/prior-review-memory (optional, MCP-dependent) | skip | skip | included | included + broader recall |
441
511
  | Worktree + static checks | included (`npm ci` per changed lockfile) | skip (WORKTREE_PATH=null) unless `--fix` | included | included |
442
- | Review agents | 1 deps checklist | 2 triage (haiku) + project-rules (sonnet) | 5 specialists + project-rules (sonnet) | 5 specialists + project-rules (sonnet) |
512
+ | Review agents (model and effort per risk tier, see README) | 1 deps checklist | 2 triage + project-rules | 5 specialists + project-rules | 5 specialists + project-rules |
443
513
  | Per-finding verification | none | Criticals + Importants | Criticals + Importants | Criticals + Importants |
444
514
  | Completeness critic | skip | skip | skip | included |
445
515
  | Proof-of-bug (failing test per Critical or composed-boundary Important) | skip | skip | included (max 5) | included (max 5) |
@@ -803,7 +873,8 @@ args: {
803
873
  cycle, // finding-state.mjs begin output; omit when unknown
804
874
  suppressed, // rejected/intentional findings never to re-raise
805
875
  recurringClasses, // shown in the rethink verdict
806
- testRunner: <worktree.json testRunner, null for scan>
876
+ testRunner: <worktree.json testRunner, null for scan>,
877
+ routing: ROUTING // from model-matrix.mjs; omit when unset
807
878
  }
808
879
  ```
809
880
 
@@ -824,10 +895,10 @@ that only when a specific run needs a smaller footprint.
824
895
 
825
896
  The workflow runs three phases:
826
897
 
827
- - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]` on `haiku`; medium/deep
898
+ - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]`; medium/deep
828
899
  use 5 specialists (quality, implementation, simplification, conventions,
829
- test-quality) on `sonnet`. Scan, medium and deep also run `project-rules`
830
- (sonnet), which only checks the diff against each project rule. Agents receive DIFF_FILE + CONTEXT_FILE by path.
900
+ test-quality). Scan, medium and deep also run `project-rules`, which only
901
+ checks the diff against each project rule. Models come from `routing`. Agents receive DIFF_FILE + CONTEXT_FILE by path.
831
902
  All run concurrently: the stage is self-limiting at one agent per
832
903
  dimension. All reviewers run to completion before verification starts.
833
904
  Override per run with the `reviewBatchPlan` arg (e.g. `[1]` runs them
@@ -850,7 +921,7 @@ The workflow runs three phases:
850
921
  - **Critic (deep only):** completeness critic gets the full deduped finding
851
922
  list + DIFF_FILE; its findings go through verifier agents before promotion.
852
923
  - **Prove (medium/deep, worktree and an installed test runner required):**
853
- each Critical without a `rule` tag gets one prover agent (`references/agents/prover.md`, sonnet, max 5, run
924
+ each Critical without a `rule` tag gets one prover agent (`references/agents/prover.md`, `routing.prover`, max 5, run
854
925
  `maxConcurrent` at a time) that writes a test asserting the CORRECT behaviour,
855
926
  runs it in the worktree, and captures it failing because of the bug. The proof rides on the finding as
856
927
  `proof: {attempted, proven, outcome, reason, testCode?, testCommand?, redOutput?}`.
@@ -865,15 +936,29 @@ Findings have schema:
865
936
  `badCode` and `fix` are schema-required: an empty string is allowed only on
866
937
  `observation` / `idiomatic` findings.
867
938
 
868
- Model tiers: triage on `haiku`, specialists on `sonnet`, verifiers + critic +
869
- provers on `sonnet`, housekeeping on `haiku`. Only the synthesis in Step 3 runs
870
- on the session model.
939
+ Model tiers: every agent role (triage, specialist, rules, verifier, critic,
940
+ prover) takes its model and effort from `routing`, chosen by the risk tier;
941
+ see the matrix in `README.md`. Critic re-examine and critic-verify agents use
942
+ the verifier's route. Without `routing` the workflow keeps its defaults:
943
+ triage on `haiku`, everything else on `sonnet`, verifiers and provers at effort
944
+ high. Only the synthesis in Step 3 runs on the session model. The workflow
945
+ returns the routes it used as `routing`; quote them in the Review Cost block.
871
946
 
872
947
  Return value from the workflow:
873
- `{engine, findings, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, acCoverage, coverageVerdict, mutationSlip, mockSmells, agentCount, outputTokens, turnTokensTotal}`
948
+ `{engine, findings, decisions, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, acCoverage, coverageVerdict, mutationSlip, mockSmells, agentCount, outputTokens, turnTokensTotal}`
874
949
  `outputTokens` is this workflow's own output spend; `turnTokensTotal` is the
875
950
  whole turn's shared pool (main loop included).
876
951
 
952
+ `decisions` is `[{kind, what, why}]`: one `route` entry per role and one
953
+ `finding` entry per Critical/Important the verifier ruled on (kept, downgraded
954
+ or dropped, with its one-line reason). The workflow also `log()`s each as it is
955
+ decided, but it cannot write files, so right after it returns write them to the
956
+ run log in one call (a missing `decisions` on a host that returns none is fine):
957
+ `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RUN_ID> --from-json <scratchpad>/decisions.json`,
958
+ with `decisions` saved to `<scratchpad>/decisions.json` first. The Codex and
959
+ revmux engines return no `decisions`; write only the `depth` and `tier`
960
+ entries for them.
961
+
877
962
  Wait for the workflow to complete before proceeding to Step 3.
878
963
 
879
964
  ### ENGINE=revmux
@@ -1225,7 +1310,10 @@ the run (review and fix) and
1225
1310
  `--artifact-url`: the newest row wins. A run that dies part-way still gets
1226
1311
  `node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" finish <RUN_ID> --status failed --note <why>`.
1227
1312
 
1228
- Then print the full review as the response.
1313
+ Then print the full review as the response. Unless `QUIET_DECISIONS=true`, or
1314
+ the run log was unavailable, it carries the `## 🧭 Decisions` block from
1315
+ `references/output-format.md`, built only from the decisions written to the run
1316
+ log, and saved in the review file with it.
1229
1317
 
1230
1318
  **Closer goes last.** The run's FINAL message (this one, or the later summary
1231
1319
  after Step 4 / 4.6 / 5 when those run) ends with `CLOSER.md_terminal` as its
@@ -1297,7 +1385,8 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1297
1385
  ```
1298
1386
  scriptPath: <scratchpad>/fix-workflow.js
1299
1387
  args: { repoSlug, prNumber, targetLabel, worktreePath, diffFile, contextFile,
1300
- promptDir, findings: [<selected findings verbatim>], acList }
1388
+ promptDir, findings: [<selected findings verbatim>], acList,
1389
+ routing: ROUTING }
1301
1390
  ```
1302
1391
  `targetLabel` is required whenever `prNumber` is null, same as the review
1303
1392
  workflow. `acList` is the acceptance criteria from `context.json`, passed as
@@ -1307,10 +1396,10 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1307
1396
  verdict without verified comparison evidence is downgraded automatically.
1308
1397
  In Codex, run the Fix mode section of `references/codex-workflow.md` with
1309
1398
  the same inputs, including `acList`, and result schema.
1310
- Agent selection is host-specific. Claude uses one `sonnet` fix agent per
1311
- file (never two on the same file), then a read-only `sonnet` fix-verifier per
1312
- file. Codex uses one `worker` fixer per file, then a read-only `default`
1313
- verifier per file. Every verifier reads the actual `git diff`; allow one
1399
+ Agent selection is host-specific. Claude uses one fix agent per file
1400
+ (`routing.fixer`; never two on the same file), then a read-only fix-verifier
1401
+ per file (`routing.verifier`). Codex uses one `worker` fixer per file, then a
1402
+ read-only `default` verifier per file, with the same routes. Every verifier reads the actual `git diff`; allow one
1314
1403
  retry max on a non-`good` verdict.
1315
1404
  4. Revert every group the verifier did not pass.
1316
1405
  5. Run `scripts/verify-fixes.sh <WORKTREE_PATH> <scratchpad>/fix-verify.json tests`
@@ -1353,7 +1442,9 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1353
1442
  confirm it equals `$worktree_head_sha`. Then refresh the review marker for
1354
1443
  the new sha (Step 3).
1355
1444
  8. Print the per-finding status table and append `## 🔧 Fixes applied` to the
1356
- saved review file.
1445
+ saved review file. Record each applied finding, and each one skipped, with
1446
+ `run-log.mjs decide <RUN_ID> --kind fix --what "<file:line title>" --why "<applied | skipped: reason>"`
1447
+ (or one `--from-json` call).
1357
1448
 
1358
1449
  Fix-agent tokens are additional spend: add a `Fix agents:` line to the
1359
1450
  `## 💰 Review Cost` block.
@@ -1445,7 +1536,8 @@ Follow `references/github-post.md`:
1445
1536
  - POST via `gh api repos/<REPO_SLUG>/pulls/<PR_NUMBER>/reviews` with NO
1446
1537
  `event` field (creates PENDING, visible only to you).
1447
1538
  - Verify post-condition: fetch review list, confirm PENDING state exists.
1448
- - Print count + link.
1539
+ - Print count + link, and record it with
1540
+ `run-log.mjs decide <RUN_ID> --kind post --what "<N inline comments + body>" --why "<what was left out and why, or 'all Critical/Important posted'>"`.
1449
1541
  - Observation and Idiomatic findings go in the review body, never inline.
1450
1542
  - When `CLOSER` is set, its `md_github` is the last thing in the review body.
1451
1543
  - Never submit the review programmatically.
@@ -1491,7 +1583,7 @@ so a nearby finding about a different problem still counts; read recall as an
1491
1583
  upper bound.
1492
1584
 
1493
1585
  If you maintain a persistent notes/memory system across reviews, launch ONE
1494
- background Agent with `model: 'haiku'`, passing the review file path +
1586
+ background Agent with `routing.housekeeping` (default `model: 'haiku'`), passing the review file path +
1495
1587
  repo-short-name + PR author login, instructed to follow
1496
1588
  `references/post-review.md` if you've written one for your own setup:
1497
1589
  - Log durable patterns (recurring findings, confirmed false positives) scoped
@@ -62,10 +62,23 @@ const {
62
62
  findings,
63
63
  acList,
64
64
  targetLabel: fixTargetLabelArg,
65
+ routing,
65
66
  } = input
66
67
 
67
68
  const targetLabel = fixTargetLabelArg || `PR #${prNumber}`
68
69
 
70
+ // Same contract as routeOf in workflow.js: the routing arg from
71
+ // scripts/model-matrix.mjs, with today's defaults when a cell is absent.
72
+ const VALID_EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max']
73
+ function routeOf(role, fallback) {
74
+ const cell = routing && routing[role]
75
+ const valid = Boolean(cell) && typeof cell.model === 'string' && cell.model.length > 0
76
+ && (cell.effort === undefined || VALID_EFFORTS.includes(cell.effort))
77
+ return valid ? { model: cell.model, effort: cell.effort } : fallback
78
+ }
79
+ const FIXER = routeOf('fixer', { model: 'sonnet', effort: 'high' })
80
+ const FIX_VERIFIER = routeOf('verifier', { model: 'sonnet', effort: 'high' })
81
+
69
82
  if (!repoSlug || (!prNumber && !fixTargetLabelArg) || !worktreePath || !promptDir || !Array.isArray(findings)) {
70
83
  throw new Error(
71
84
  'lekker-review fix workflow: missing required args (got type ' + typeof args +
@@ -275,8 +288,8 @@ async function fixStage(group) {
275
288
  label: `fix:${group.file}`,
276
289
  phase: 'Fix',
277
290
  schema: FIX_RESULT_SCHEMA,
278
- model: 'sonnet',
279
- effort: 'high',
291
+ model: FIXER.model,
292
+ effort: FIXER.effort,
280
293
  })
281
294
 
282
295
  if (!result) {
@@ -381,8 +394,8 @@ async function verifyStage(state) {
381
394
  label: `fix-verify:${state.file}`,
382
395
  phase: 'Fix-verify',
383
396
  schema: FIX_VERDICT_SCHEMA,
384
- model: 'sonnet',
385
- effort: 'high',
397
+ model: FIX_VERIFIER.model,
398
+ effort: FIX_VERIFIER.effort,
386
399
  }))
387
400
 
388
401
  // One retry only (VERIFICATION.md: surface retries, never loop).
@@ -395,8 +408,8 @@ async function verifyStage(state) {
395
408
  label: `fix-retry:${state.file}`,
396
409
  phase: 'Fix',
397
410
  schema: FIX_RESULT_SCHEMA,
398
- model: 'sonnet',
399
- effort: 'high',
411
+ model: FIXER.model,
412
+ effort: FIXER.effort,
400
413
  })
401
414
 
402
415
  if (retryResult) {
@@ -406,8 +419,8 @@ async function verifyStage(state) {
406
419
  label: `fix-reverify:${state.file}`,
407
420
  phase: 'Fix-verify',
408
421
  schema: FIX_VERDICT_SCHEMA,
409
- model: 'sonnet',
410
- effort: 'high',
422
+ model: FIX_VERIFIER.model,
423
+ effort: FIX_VERIFIER.effort,
411
424
  }))
412
425
  }
413
426
  }
@@ -64,6 +64,18 @@ Re-read each JSON file before
64
64
  trusting it. Invalid JSON or a missing required field makes that agent result
65
65
  unavailable; do not infer what it meant from prose.
66
66
 
67
+ ## Model routing
68
+
69
+ SKILL.md runs `scripts/model-matrix.mjs --host codex` and passes its `routing`
70
+ object. Every `spawn_agent` call sets `model` and `reasoning_effort` from the
71
+ role's route and `fork_turns: "none"` (Codex requires it whenever a spawn
72
+ overrides the model). Roles: `triage` (triage dimensions), `specialist` (the
73
+ five specialists), `rules` (`project-rules`, `deps`), `verifier` (verifiers,
74
+ critic re-examine and critic-verify, fix verifiers), `critic` (completeness
75
+ critic), `prover`, `fixer`, `housekeeping`. Without `routing`, omit all three
76
+ fields so agents inherit the session model, as before. Record the route used
77
+ per agent in the `agents` receipt.
78
+
67
79
  ## Review stage
68
80
 
69
81
  Select dimensions exactly as the Claude workflow does:
@@ -153,8 +153,9 @@ an earlier run can never be merged into this one.
153
153
  1. Create the run directory once: `mktemp -d /tmp/lekker-polish.XXXXXX`, and
154
154
  use its printed path as `<POLISH_DIR>`. Copy the payload:
155
155
  `cp <PAYLOAD> <POLISH_DIR>/draft.json`.
156
- 2. Launch ONE agent (`model: 'sonnet'`; in Codex, one native agent or inline
157
- when none is available) with this brief: rewrite each `comments[].body` in
156
+ 2. Launch ONE agent on `ROUTING.polish` (model and effort; default
157
+ `model: 'sonnet'` when `ROUTING` is unset; in Codex, one native agent with
158
+ that route, or inline when none is available) with this brief: rewrite each `comments[].body` in
158
159
  `<POLISH_DIR>/draft.json` per `${SKILL_ROOT}/references/comment-voice.md`
159
160
  and write the full payload to `<POLISH_DIR>/polished.json`, same order, same
160
161
  `path`, `line` and `side`. Keep every identifier, `file:line`, number, link,
@@ -230,12 +230,33 @@ section if empty.)*
230
230
 
231
231
  ---
232
232
 
233
+ ## 🧭 Decisions
234
+
235
+ *(Why the run went the way it did. Built from the decisions written to the run
236
+ log; omit the whole section with `--quiet-decisions`, and when the run log is
237
+ unavailable.)*
238
+
239
+ - **Depth:** <depth>, <the AUTO-DEPTH rule or "explicit">
240
+ - **Tier:** <tier> (<auto: reason | --risk>)
241
+ - **Routes:** <role> <model> [<effort>] · <role> <model> [<effort>] · ... (<"risk tier routing" | "default model">)
242
+ - **Findings:** <K> kept · <D> downgraded · <X> dropped *(Critical/Important only, counted from the `finding` decisions)*
243
+ - <kept | downgraded | dropped> `<file:line>` <title>: <verifier's one-line reason>
244
+
245
+ Exact rules: one bullet per Critical/Important finding the verifier ruled on,
246
+ in the order they were decided, reason copied from the decision's `why` without
247
+ the leading outcome word. No bullets and `Findings: none verified` when no
248
+ `finding` decisions exist (for example `scan` with no Criticals, or the revmux
249
+ engine). Never add decisions that were not written to the run log.
250
+
251
+ ---
252
+
233
253
  ## 💰 Review Cost
234
254
 
235
255
  ```
236
256
  Depth: <📦 deps | ⚡ scan | 🔍 medium | 🔬 deep>
237
257
  Diff size: ~<N> lines (~<N> tokens)
238
- Agents run: <N total>: <breakdown, e.g. "5 reviewers (sonnet) + 6 verifiers (sonnet) + 2 provers (sonnet) + 1 critic (sonnet)">
258
+ Agents run: <N total>: <breakdown, e.g. "5 reviewers (sonnet/high) + 6 verifiers (opus/high) + 2 provers (sonnet/high) + 1 critic (opus/high)">
259
+ Risk tier: <tier> (<auto: reason | --risk>), routes from the workflow's `routing` return value
239
260
  Rule checks: <N> hard-rule finding(s) validated with rule-specific checks (omit the line when 0)
240
261
  Context sources: <the subset of issue-tracker / chat / docs / framework-docs / monitoring / CI / prior-review-memory actually used>
241
262
 
@@ -257,7 +278,7 @@ Per-MTok pricing (input/output) - verified 2026-10-15 from the claude-api refere
257
278
 
258
279
  The main-loop line uses the session model's rate from this list. When the session model is not listed, say so in the cost block rather than leaving the main loop out silently.
259
280
 
260
- Reviewer agents, verifiers, provers, and the critic all run on sonnet; triage and housekeeping on haiku. Only the main loop (context gathering + this synthesis) runs on the session model: use the session model's actual ID for that tier.
281
+ Each agent role runs on the model and effort its risk tier assigns (README "Models and effort"); price each role at its own model. Only the main loop (context gathering + this synthesis) runs on the session model: use the session model's actual ID for that tier.
261
282
 
262
283
  For the Codex engine, use the model and usage metadata actually exposed by the
263
284
  native collaboration surface. Never relabel Codex agents as Claude tiers and
@@ -6,7 +6,7 @@ points at, and copies the numbers out of, everything else.
6
6
  | Trace | Path | Written by | Kept | What it answers |
7
7
  |---|---|---|---|---|
8
8
  | Run ledger | `~/.local/state/lekker-review/runs.jsonl` | `scripts/run-log.mjs finish`, `backfill` | forever (one line per run) | how long, how many tokens, findings, drops, proofs, verdict, per engine and depth |
9
- | Run archive | `~/.local/state/lekker-review/runs/<runId>/` | `run-log.mjs start/mark/attach/finish` | 90 days (`prune`) | `run.json` with timeline, plus the run's `findings.json`, `worktree.json`, `preflight.json`, `context.json` |
9
+ | Run archive | `~/.local/state/lekker-review/runs/<runId>/` | `run-log.mjs start/mark/decide/attach/finish` | 90 days (`prune`) | `run.json` with timeline and decisions (also appended live to `timeline.jsonl`), plus the run's `findings.json`, `worktree.json`, `preflight.json`, `context.json` |
10
10
  | Dependency ledger | `~/.local/state/lekker-review/deps.json` | `scripts/deps.mjs` | forever | which optional tools were installed or skipped, versions, last upstream check |
11
11
  | Review report | `~/code-reviews/<date>-<target>-<repo>.md` | Step 3 | forever | the review as printed, including the `Review Cost` block |
12
12
  | revmux archive | `~/code-reviews/revmux-tasks/<task>/<NN-run>/` | revmux, plus `revmux.stderr.log` from `scripts/revmux-engine.sh` | forever, never edit | `events.jsonl` (agent start, degraded, retried), `agents/*.jsonl` (per-agent cost and usage), `revmux.stderr.log` (why a round degraded; rounds before 2026-10-20 have none) |