@olegkoval/agent-skills 1.87.3 → 1.89.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 (31) hide show
  1. package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +45 -17
  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/comment-voice.md +97 -0
  4. package/adapters/claude/olko-github-pr/skills/lekker-review/references/github-post.md +62 -38
  5. package/adapters/claude/olko-github-pr/skills/lekker-review/references/output-format.md +3 -2
  6. package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/comment-facts.mjs +151 -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/selftest.mjs +1 -1
  9. package/package.json +1 -1
  10. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  11. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  12. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  13. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  14. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  15. package/plugins/olko-github-pr/skills/lekker-review/README.md +50 -0
  16. package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +45 -17
  17. package/plugins/olko-github-pr/skills/lekker-review/fix-workflow.js +21 -8
  18. package/plugins/olko-github-pr/skills/lekker-review/references/codex-workflow.md +12 -0
  19. package/plugins/olko-github-pr/skills/lekker-review/references/comment-voice.md +97 -0
  20. package/plugins/olko-github-pr/skills/lekker-review/references/github-post.md +62 -38
  21. package/plugins/olko-github-pr/skills/lekker-review/references/output-format.md +3 -2
  22. package/plugins/olko-github-pr/skills/lekker-review/scripts/comment-facts.mjs +151 -0
  23. package/plugins/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +152 -0
  24. package/plugins/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +1 -1
  25. package/plugins/olko-github-pr/skills/lekker-review/workflow.js +51 -23
  26. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  27. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  28. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  29. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  30. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  31. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+ // Model and effort per lekker agent, picked from the PR's risk tier.
3
+ //
4
+ // Depth decides how many agents run; the tier decides how strong each one is.
5
+ // Effort comes before model size: a tier escalates effort first and moves to a
6
+ // bigger model only for risky changes. Finders stay one step below the gate
7
+ // (verifier), because the verifier decides what survives. The fast models
8
+ // (haiku, luna) only ever do first-pass triage or housekeeping.
9
+ //
10
+ // node model-matrix.mjs --host claude|codex [--risk <tier>] [--lines <n>]
11
+ // [--categories auth,billing,...] -- <changed-file>...
12
+ //
13
+ // `--categories` is the comma-joined `categories[].category` list from
14
+ // risk-paths.mjs. `--lines` is additions+deletions without lockfiles.
15
+ // Prints {host, tier, tierSource, reasons, visual, routing}.
16
+ import { pathToFileURL } from 'node:url'
17
+
18
+ export const TIERS = ['routine', 'standard', 'elevated', 'critical']
19
+ export const HOSTS = ['claude', 'codex']
20
+ export const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max']
21
+
22
+ // Roles that decide whether a finding survives. Never a fast model.
23
+ export const GATE_ROLES = ['verifier', 'critic']
24
+
25
+ const r = (model, effort) => ({ model, effort })
26
+ const same = cell => [cell, cell, cell, cell]
27
+
28
+ // One row per role: [routine, standard, elevated, critical].
29
+ export const MATRIX = {
30
+ claude: {
31
+ triage: same(r('haiku', 'medium')),
32
+ specialist: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('opus', 'xhigh')],
33
+ rules: [r('sonnet', 'medium'), r('sonnet', 'medium'), r('sonnet', 'high'), r('sonnet', 'high')],
34
+ verifier: [r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'high')],
35
+ critic: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'xhigh')],
36
+ prover: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
37
+ fixer: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
38
+ polish: same(r('sonnet', 'medium')),
39
+ housekeeping: same(r('haiku', 'low')),
40
+ },
41
+ codex: {
42
+ triage: same(r('gpt-6-luna', 'medium')),
43
+ specialist: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
44
+ rules: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high')],
45
+ verifier: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'high')],
46
+ critic: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
47
+ prover: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
48
+ fixer: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
49
+ polish: same(r('gpt-6.2-sol', 'medium')),
50
+ housekeeping: same(r('gpt-6-luna', 'low')),
51
+ },
52
+ }
53
+
54
+ // A UI-only diff: Codex has a model positioned for visual reasoning.
55
+ const VISUAL_SPECIALIST = { codex: r('gpt-6.1-terra', 'high') }
56
+
57
+ export const FAST_MODELS = ['haiku', 'gpt-6-luna']
58
+
59
+ const DOC_FILE = /(^|\/)(docs?\/.*|[^/]+\.(md|mdx|txt|rst)|LICENSE[^/]*)$/i
60
+ const UI_FILE = /\.(tsx|jsx|vue|svelte|css|scss|sass|less|liquid|html)$/i
61
+ const TEST_FILE = /(^|\/)(__tests__|tests?|spec)\/|\.(test|spec)\.[a-z]+$/i
62
+ const MIGRATION_FILE = /(^|\/)migrations?\/|\.sql$/i
63
+
64
+ const CRITICAL_CATEGORIES = ['auth', 'billing']
65
+ const ELEVATED_CATEGORIES = ['ci-workflow', 'installer']
66
+ const DEEP_LINES = 800
67
+ const DEEP_FILES = 25
68
+
69
+ // Each rule: [tier, reason, test]. First match wins, so order is severity order.
70
+ const TIER_RULES = [
71
+ ['critical', 'auth or billing paths', s => s.categories.some(c => CRITICAL_CATEGORIES.includes(c))],
72
+ ['elevated', 'CI workflow or installer paths', s => s.categories.some(c => ELEVATED_CATEGORIES.includes(c))],
73
+ ['elevated', 'migrations or SQL', s => s.files.some(f => MIGRATION_FILE.test(f))],
74
+ ['elevated', `more than ${DEEP_LINES} changed lines or ${DEEP_FILES} files`, s => s.lines > DEEP_LINES || s.files.length > DEEP_FILES],
75
+ ['routine', 'documentation only', s => s.files.length > 0 && s.files.every(f => DOC_FILE.test(f))],
76
+ ]
77
+
78
+ export function tierFor({ files = [], categories = [], lines = 0, override } = {}) {
79
+ if (override !== undefined) {
80
+ if (!TIERS.includes(override)) throw new Error(`unknown risk tier "${override}"; use one of ${TIERS.join(', ')}`)
81
+ return { tier: override, tierSource: 'override', reasons: ['--risk flag'] }
82
+ }
83
+ const signals = { files, categories, lines }
84
+ const hit = TIER_RULES.find(([, , test]) => test(signals))
85
+ return hit
86
+ ? { tier: hit[0], tierSource: 'auto', reasons: [hit[1]] }
87
+ : { tier: 'standard', tierSource: 'auto', reasons: ['default'] }
88
+ }
89
+
90
+ export function isVisual(files = []) {
91
+ const code = files.filter(f => !TEST_FILE.test(f) && !DOC_FILE.test(f))
92
+ return code.length > 0 && code.every(f => UI_FILE.test(f))
93
+ }
94
+
95
+ export function routingFor(host, tier, { visual = false } = {}) {
96
+ if (!HOSTS.includes(host)) throw new Error(`unknown host "${host}"; use one of ${HOSTS.join(', ')}`)
97
+ if (!TIERS.includes(tier)) throw new Error(`unknown risk tier "${tier}"`)
98
+ const column = TIERS.indexOf(tier)
99
+ const routing = Object.fromEntries(Object.entries(MATRIX[host]).map(([role, row]) => [role, row[column]]))
100
+ return visual && VISUAL_SPECIALIST[host] ? { ...routing, specialist: VISUAL_SPECIALIST[host] } : routing
101
+ }
102
+
103
+ const ROLE_LABELS = {
104
+ triage: 'Triage (scan depth, first pass only)',
105
+ specialist: 'Specialists x5 (quality, implementation, simplification, conventions, test-quality)',
106
+ rules: 'Project rules, deps checklist',
107
+ verifier: 'Verifier, critic re-examine, fix verifier',
108
+ critic: 'Completeness critic (deep)',
109
+ prover: 'Prover (writes the failing test)',
110
+ fixer: 'Fixer (--fix)',
111
+ polish: 'Comment polish (--post)',
112
+ housekeeping: 'Housekeeping',
113
+ }
114
+ const MODEL_NAMES = {
115
+ haiku: 'Haiku', sonnet: 'Sonnet', opus: 'Opus', fable: 'Fable',
116
+ 'gpt-6-luna': 'Luna', 'gpt-6.2-sol': 'Sol', 'gpt-6.2-astra': 'Astra', 'gpt-6.1-terra': 'Terra',
117
+ }
118
+
119
+ // The README table, rendered from MATRIX so the two cannot drift
120
+ // (tests/lekker-model-matrix.test.mjs asserts README contains it).
121
+ export function matrixMarkdown() {
122
+ const cell = (c, x) => `${MODEL_NAMES[c.model]} ${c.effort} / ${MODEL_NAMES[x.model]} ${x.effort}`
123
+ const rows = Object.keys(MATRIX.claude).map(role =>
124
+ `| ${ROLE_LABELS[role]} | ${TIERS.map((_, i) => cell(MATRIX.claude[role][i], MATRIX.codex[role][i])).join(' | ')} |`)
125
+ return [`| Agent | ${TIERS.join(' | ')} |`, `| --- |${TIERS.map(() => ' --- |').join('')}`, ...rows].join('\n')
126
+ }
127
+
128
+ function parseArgs(argv) {
129
+ const sep = argv.indexOf('--')
130
+ const flags = sep === -1 ? argv : argv.slice(0, sep)
131
+ const files = sep === -1 ? [] : argv.slice(sep + 1)
132
+ const value = name => {
133
+ const i = flags.indexOf(name)
134
+ return i === -1 ? undefined : flags[i + 1]
135
+ }
136
+ const categories = (value('--categories') ?? '').split(',').map(s => s.trim()).filter(Boolean)
137
+ return { host: value('--host'), override: value('--risk'), lines: Number(value('--lines') ?? 0), categories, files }
138
+ }
139
+
140
+ function main(argv) {
141
+ const { host, override, lines, categories, files } = parseArgs(argv)
142
+ try {
143
+ const { tier, tierSource, reasons } = tierFor({ files, categories, lines, override })
144
+ const visual = isVisual(files)
145
+ console.log(JSON.stringify({ host, tier, tierSource, reasons, visual, routing: routingFor(host, tier, { visual }) }))
146
+ } catch (error) {
147
+ console.error(`model-matrix: ${error.message}`)
148
+ process.exit(2)
149
+ }
150
+ }
151
+
152
+ if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) main(process.argv.slice(2))
@@ -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.87.3",
3
+ "version": "1.89.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.87.3",
4
+ "version": "1.89.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.87.3",
4
+ "version": "1.89.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.87.3",
4
+ "version": "1.89.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.87.3",
4
+ "version": "1.89.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.87.3",
4
+ "version": "1.89.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -29,6 +29,56 @@ 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
+
71
+ ## Comment voice
72
+
73
+ With `--post`, inline comments follow `references/comment-voice.md`: the ask,
74
+ then why it matters in plain words, then the fix. One agent rewrites the drafts
75
+ for readability, and `scripts/comment-facts.mjs` reverts any comment whose
76
+ code names, file references, numbers, links, suggestion blocks, negations or
77
+ will/may/must wording changed. The voice rules are
78
+ adapted from [Clarity](https://github.com/addyosmani/clarity) by Addy Osmani
79
+ (MIT). Clarity is optional: when it is installed
80
+ (`npx skills add addyosmani/clarity`), the rewrite also uses its editing guide.
81
+
32
82
  ## Requirements
33
83
 
34
84
  Claude Code or OpenAI Codex, plus `git` and an authenticated `gh`. Claude uses
@@ -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]"
50
50
  ---
51
51
 
52
52
  # Lekker Review
@@ -328,6 +328,24 @@ 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
 
333
351
  **`--fix` flag:** parse and store as `FIX_MODE=true`. Fix mode needs a real
@@ -439,7 +457,7 @@ skip the review because the log failed, just say `run log unavailable`.
439
457
  | Context: issue-tracker/CI/diff/existing-reviews | always | always | always | always |
440
458
  | Context: chat/docs/framework-docs/monitoring/prior-review-memory (optional, MCP-dependent) | skip | skip | included | included + broader recall |
441
459
  | 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) |
460
+ | 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
461
  | Per-finding verification | none | Criticals + Importants | Criticals + Importants | Criticals + Importants |
444
462
  | Completeness critic | skip | skip | skip | included |
445
463
  | Proof-of-bug (failing test per Critical or composed-boundary Important) | skip | skip | included (max 5) | included (max 5) |
@@ -803,7 +821,8 @@ args: {
803
821
  cycle, // finding-state.mjs begin output; omit when unknown
804
822
  suppressed, // rejected/intentional findings never to re-raise
805
823
  recurringClasses, // shown in the rethink verdict
806
- testRunner: <worktree.json testRunner, null for scan>
824
+ testRunner: <worktree.json testRunner, null for scan>,
825
+ routing: ROUTING // from model-matrix.mjs; omit when unset
807
826
  }
808
827
  ```
809
828
 
@@ -824,10 +843,10 @@ that only when a specific run needs a smaller footprint.
824
843
 
825
844
  The workflow runs three phases:
826
845
 
827
- - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]` on `haiku`; medium/deep
846
+ - **Review:** deps uses the single `deps` checklist agent; scan uses `[triage-quality, triage-logic]`; medium/deep
828
847
  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.
848
+ test-quality). Scan, medium and deep also run `project-rules`, which only
849
+ checks the diff against each project rule. Models come from `routing`. Agents receive DIFF_FILE + CONTEXT_FILE by path.
831
850
  All run concurrently: the stage is self-limiting at one agent per
832
851
  dimension. All reviewers run to completion before verification starts.
833
852
  Override per run with the `reviewBatchPlan` arg (e.g. `[1]` runs them
@@ -850,7 +869,7 @@ The workflow runs three phases:
850
869
  - **Critic (deep only):** completeness critic gets the full deduped finding
851
870
  list + DIFF_FILE; its findings go through verifier agents before promotion.
852
871
  - **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
872
+ each Critical without a `rule` tag gets one prover agent (`references/agents/prover.md`, `routing.prover`, max 5, run
854
873
  `maxConcurrent` at a time) that writes a test asserting the CORRECT behaviour,
855
874
  runs it in the worktree, and captures it failing because of the bug. The proof rides on the finding as
856
875
  `proof: {attempted, proven, outcome, reason, testCode?, testCommand?, redOutput?}`.
@@ -865,9 +884,13 @@ Findings have schema:
865
884
  `badCode` and `fix` are schema-required: an empty string is allowed only on
866
885
  `observation` / `idiomatic` findings.
867
886
 
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.
887
+ Model tiers: every agent role (triage, specialist, rules, verifier, critic,
888
+ prover) takes its model and effort from `routing`, chosen by the risk tier;
889
+ see the matrix in `README.md`. Critic re-examine and critic-verify agents use
890
+ the verifier's route. Without `routing` the workflow keeps its defaults:
891
+ triage on `haiku`, everything else on `sonnet`, verifiers and provers at effort
892
+ high. Only the synthesis in Step 3 runs on the session model. The workflow
893
+ returns the routes it used as `routing`; quote them in the Review Cost block.
871
894
 
872
895
  Return value from the workflow:
873
896
  `{engine, findings, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, acCoverage, coverageVerdict, mutationSlip, mockSmells, agentCount, outputTokens, turnTokensTotal}`
@@ -1297,7 +1320,8 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1297
1320
  ```
1298
1321
  scriptPath: <scratchpad>/fix-workflow.js
1299
1322
  args: { repoSlug, prNumber, targetLabel, worktreePath, diffFile, contextFile,
1300
- promptDir, findings: [<selected findings verbatim>], acList }
1323
+ promptDir, findings: [<selected findings verbatim>], acList,
1324
+ routing: ROUTING }
1301
1325
  ```
1302
1326
  `targetLabel` is required whenever `prNumber` is null, same as the review
1303
1327
  workflow. `acList` is the acceptance criteria from `context.json`, passed as
@@ -1307,10 +1331,10 @@ Read `references/fix-mode.md` and follow it. Shape of the run:
1307
1331
  verdict without verified comparison evidence is downgraded automatically.
1308
1332
  In Codex, run the Fix mode section of `references/codex-workflow.md` with
1309
1333
  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
1334
+ Agent selection is host-specific. Claude uses one fix agent per file
1335
+ (`routing.fixer`; never two on the same file), then a read-only fix-verifier
1336
+ per file (`routing.verifier`). Codex uses one `worker` fixer per file, then a
1337
+ read-only `default` verifier per file, with the same routes. Every verifier reads the actual `git diff`; allow one
1314
1338
  retry max on a non-`good` verdict.
1315
1339
  4. Revert every group the verifier did not pass.
1316
1340
  5. Run `scripts/verify-fixes.sh <WORKTREE_PATH> <scratchpad>/fix-verify.json tests`
@@ -1437,7 +1461,11 @@ just created a PR, in which case use that PR number.
1437
1461
 
1438
1462
  Follow `references/github-post.md`:
1439
1463
  - Build a JSON payload with Critical + Important findings as inline comments
1440
- (only for lines present in the diff hunks).
1464
+ (only for lines present in the diff hunks), written in the ask / why / fix
1465
+ shape from `references/comment-voice.md`.
1466
+ - Polish the inline comments with one agent, then merge through
1467
+ `scripts/comment-facts.mjs`, which reverts any comment whose facts drifted
1468
+ (github-post.md Step 2b). Report `comments polished: N/M` in one line.
1441
1469
  - POST via `gh api repos/<REPO_SLUG>/pulls/<PR_NUMBER>/reviews` with NO
1442
1470
  `event` field (creates PENDING, visible only to you).
1443
1471
  - Verify post-condition: fetch review list, confirm PENDING state exists.
@@ -1487,7 +1515,7 @@ so a nearby finding about a different problem still counts; read recall as an
1487
1515
  upper bound.
1488
1516
 
1489
1517
  If you maintain a persistent notes/memory system across reviews, launch ONE
1490
- background Agent with `model: 'haiku'`, passing the review file path +
1518
+ background Agent with `routing.housekeeping` (default `model: 'haiku'`), passing the review file path +
1491
1519
  repo-short-name + PR author login, instructed to follow
1492
1520
  `references/post-review.md` if you've written one for your own setup:
1493
1521
  - 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:
@@ -0,0 +1,97 @@
1
+ # comment-voice.md -- how an inline PR comment reads
2
+
3
+ Used twice by `references/github-post.md`: when drafting inline comments, and by
4
+ the polish agent that rewrites them before posting. Adapted for code review from
5
+ [Clarity](https://github.com/addyosmani/clarity) by Addy Osmani (MIT). When the
6
+ full Clarity skill is installed, the polish agent also reads its
7
+ `references/edit.md`; this file stays the authority on shape and length.
8
+
9
+ ## The reader
10
+
11
+ The PR author, reading one comment at a time in a narrow column, often between
12
+ other work. They know their own code. They do not know what the reviewer agents
13
+ found, which identifiers the finding hinges on, or why it matters. A comment
14
+ succeeds when the author understands the problem and acts without opening the
15
+ saved review.
16
+
17
+ ## Shape
18
+
19
+ ```
20
+ <The ask: one sentence, plain words, what to change and where.>
21
+
22
+ **Why:** <what goes wrong, for whom, and when, in plain words first. Then the
23
+ mechanism, naming the code only where the author needs it to find the spot.
24
+ One concrete scenario when it makes the failure believable.>
25
+
26
+ <A ```suggestion block when the fix exactly replaces the commented lines,
27
+ otherwise: **Fix:** <one sentence>.>
28
+ <!-- lekker:<dimension> -->
29
+ ```
30
+
31
+ - **Length:** under ~900 characters, not counting the suggestion block. Short
32
+ enough to read in one pass; long enough to carry the why.
33
+ - **The ask comes first,** in the imperative or as "Please ...". No severity
34
+ label, no restated title, no preamble.
35
+ - **The why names a consequence a person cares about:** a double charge, a
36
+ silently skipped sync, a crash on empty input, a test that cannot fail. Say it
37
+ before the identifiers. "Two copies of the tie-break disagree" is the
38
+ mechanism; "the customer can be charged twice" is the reason to fix it.
39
+ - **One scenario, not two.** Use real values from the finding (the quantities,
40
+ the IDs, the input that breaks it). Never invent one.
41
+
42
+ ## Rules carried over from Clarity
43
+
44
+ 1. **Facts are locked.** Every code identifier, `file:line`, number, URL and
45
+ suggestion block in the draft survives unchanged. No new number, scenario,
46
+ cause or claim appears. Keep the strength of each claim: "can" stays "can",
47
+ never "will", and every "not" stays. `scripts/comment-facts.mjs` reverts a
48
+ comment when backticked code, file references, camelCase or snake_case
49
+ names, signed numbers, links, suggestion blocks, the count of negations or
50
+ the set of words like will/may/must changed. It cannot judge other meaning
51
+ changes in plain prose, so the rest of this rule is on the writer.
52
+ 2. **Mechanism over importance.** Cut "critical", "crucial", "important to
53
+ note", "significant risk". State what happens and let the author judge.
54
+ 3. **No specific-looking vagueness.** "This could cause issues in some cases" is
55
+ not a reason. If the finding does not say which case, keep the draft's
56
+ wording rather than inventing one.
57
+ 4. **Name the actor.** "The retry job writes the line twice", not "a duplicate
58
+ write may occur".
59
+ 5. **Least invasive change.** A clear draft sentence stays as it is. The polish
60
+ pass fixes what makes a comment hard to read; it does not restyle for taste.
61
+ 6. **No surface residue.** No "Great catch", "Just flagging", "Note that",
62
+ "It's worth mentioning", "Hope this helps", no praise, no em dashes.
63
+ 7. **Stop on the last useful thought.** No recap, no "let me know".
64
+
65
+ ## Example
66
+
67
+ Draft (accurate, but the author has to decode it):
68
+
69
+ ```
70
+ Please extract one shared winner-picker used by both files, keyed on FO value.
71
+ This ranks value → units → id; `x.ts:104` ranks shipped-qty → id, so FO-A
72
+ (qty 1, one $100 item) vs FO-B (qty 3, three $10 items) gives A here and B
73
+ there. Idempotency is keyed per `fulfillmentOrderGid` with no cross-FO check,
74
+ so a fallback run that writes A's line followed by an exact-path retry on B
75
+ writes the same charge twice.
76
+ ```
77
+
78
+ Polished (same facts, readable on first pass):
79
+
80
+ ```
81
+ Please use one shared function to pick the winning fulfillment order, here and
82
+ in `x.ts:104`.
83
+
84
+ **Why:** the two copies pick different winners for the same order, and the
85
+ shared line gets charged twice. This file ranks by value, then units, then id;
86
+ `x.ts:104` ranks by shipped quantity, then id. With FO-A (qty 1, one $100 item)
87
+ and FO-B (qty 3, three $10 items), this file picks A and `x.ts:104` picks B. The
88
+ duplicate check is keyed per `fulfillmentOrderGid` with no cross-FO check, so a
89
+ fallback run that writes A's line followed by an exact-path retry on B writes
90
+ the same charge twice.
91
+
92
+ **Fix:** extract one winner-picker keyed on fulfillment order value and call it
93
+ from both files.
94
+ ```
95
+
96
+ Every number, identifier and `file:line` from the draft is still there, and
97
+ nothing new was added.