@olegkoval/agent-skills 1.91.0 → 1.93.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.
- package/.github/prompts/self-critique.prompt.md +90 -232
- package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +13 -7
- package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +20 -15
- package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +21 -0
- package/adapters/claude/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +17 -1
- package/adapters/claude/olko-reflection/skills/self-critique/SKILL.md +90 -232
- package/adapters/claude/olko-reflection/skills/self-critique/references/rules.md +67 -0
- package/adapters/claude/olko-reflection/skills/self-critique/references/scoring.md +99 -0
- package/adapters/claude/olko-reflection/skills/self-critique/references/setup.md +62 -0
- package/adapters/claude/olko-reflection/skills/self-critique/scripts/claim-ledger.mjs +152 -9
- package/adapters/claude/olko-reflection/skills/self-critique/scripts/rule-store.mjs +34 -12
- package/adapters/claude/olko-reflection/skills/self-critique/scripts/run-store.mjs +133 -0
- package/adapters/cursor/olko-reflection/skills/self-critique/SKILL.md +90 -232
- package/adapters/cursor/olko-reflection/skills/self-critique/references/rules.md +67 -0
- package/adapters/cursor/olko-reflection/skills/self-critique/references/scoring.md +99 -0
- package/adapters/cursor/olko-reflection/skills/self-critique/references/setup.md +62 -0
- package/adapters/cursor/olko-reflection/skills/self-critique/scripts/claim-ledger.mjs +152 -9
- package/adapters/cursor/olko-reflection/skills/self-critique/scripts/rule-store.mjs +34 -12
- package/adapters/cursor/olko-reflection/skills/self-critique/scripts/run-store.mjs +133 -0
- package/adapters/grok/olko-reflection/skills/self-critique/SKILL.md +90 -232
- package/adapters/grok/olko-reflection/skills/self-critique/references/rules.md +67 -0
- package/adapters/grok/olko-reflection/skills/self-critique/references/scoring.md +99 -0
- package/adapters/grok/olko-reflection/skills/self-critique/references/setup.md +62 -0
- package/adapters/grok/olko-reflection/skills/self-critique/scripts/claim-ledger.mjs +152 -9
- package/adapters/grok/olko-reflection/skills/self-critique/scripts/rule-store.mjs +34 -12
- package/adapters/grok/olko-reflection/skills/self-critique/scripts/run-store.mjs +133 -0
- package/package.json +1 -1
- package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-github-pr/skills/lekker-review/README.md +18 -11
- package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +13 -7
- package/plugins/olko-github-pr/skills/lekker-review/scripts/model-matrix.mjs +20 -15
- package/plugins/olko-github-pr/skills/lekker-review/scripts/run-log.mjs +21 -0
- package/plugins/olko-github-pr/skills/lekker-review/scripts/selftest.mjs +17 -1
- package/plugins/olko-github-pr/skills/lekker-review/workflow.js +25 -2
- package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-reflection/skills/self-critique/SKILL.md +90 -232
- package/plugins/olko-reflection/skills/self-critique/references/rules.md +67 -0
- package/plugins/olko-reflection/skills/self-critique/references/scoring.md +99 -0
- package/plugins/olko-reflection/skills/self-critique/references/setup.md +62 -0
- package/plugins/olko-reflection/skills/self-critique/scripts/claim-ledger.mjs +152 -9
- package/plugins/olko-reflection/skills/self-critique/scripts/rule-store.mjs +34 -12
- package/plugins/olko-reflection/skills/self-critique/scripts/run-store.mjs +133 -0
- package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
|
@@ -12,16 +12,12 @@ Run an adversarial review of **your own previous answer** and report the result
|
|
|
12
12
|
|
|
13
13
|
## Overview
|
|
14
14
|
|
|
15
|
-
A confident answer is not a verified one.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
The point is to surface error before the user does, to make "is this actually right?" a measured
|
|
22
|
-
quantity instead of a vibe, and to make the same mistake cost less the second time than it did the
|
|
23
|
-
first. A critique that ends at a score has bought one corrected answer. A critique that ends at a
|
|
24
|
-
durable rule has bought every answer after it.
|
|
15
|
+
A confident answer is not a verified one. A separate critic agent tries to refute your last answer
|
|
16
|
+
against live sources and hunts for the related issue or pattern you missed. The score is computed
|
|
17
|
+
from a labelled claim ledger. You revise under a ratchet, report honestly including where you were
|
|
18
|
+
wrong, and convert what the critic caught into a rule that survives the session. A critique that ends
|
|
19
|
+
at a score has bought one corrected answer; one that ends at a durable rule has bought every answer
|
|
20
|
+
after it.
|
|
25
21
|
|
|
26
22
|
## When to Use
|
|
27
23
|
|
|
@@ -33,174 +29,120 @@ durable rule has bought every answer after it.
|
|
|
33
29
|
Do not use for trivial one-shot replies or simple chat. The overhead only pays off on load-bearing
|
|
34
30
|
answers.
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
which calls the bundled scripts.
|
|
32
|
+
Setup notes (state dir, Cursor install, the optional Stop-hook nudge): `references/setup.md`.
|
|
33
|
+
Penalties, anchors, ledger shape and integrity checks: `references/scoring.md`.
|
|
39
34
|
|
|
40
35
|
## Procedure
|
|
41
36
|
|
|
42
37
|
1. **Snapshot the target.** Capture your last substantial answer verbatim and the original task
|
|
43
|
-
text. This is `v1`.
|
|
38
|
+
text. This is `v1`. Create the run folder (outside the repo, one per run) and use it for every
|
|
39
|
+
file below:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
RUN=$(node <skill>/scripts/run-store.mjs new --cwd "$PWD")
|
|
43
|
+
```
|
|
44
44
|
|
|
45
45
|
Write your claim list before you re-read the answer's prose, and put a real receipt against each
|
|
46
46
|
claim: a quoted field, a `file:line` whose body you actually opened, a command and its output.
|
|
47
|
-
A claim you cannot receipt at snapshot time is already a finding
|
|
47
|
+
A claim you cannot receipt at snapshot time is already a finding: mark it `unverifiable` yourself
|
|
48
48
|
rather than waiting for the critic to find it. Grep output, a file name, a path, an endpoint
|
|
49
|
-
string, or the behaviour of a sibling module are not receipts for what code does
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
string, or the behaviour of a sibling module are not receipts for what code does.
|
|
50
|
+
|
|
51
|
+
Save the list to `$RUN/author-claims.json` as an array of `{ id, text, load_bearing, receipt }`.
|
|
52
|
+
Do NOT show it to the critic in round one.
|
|
53
|
+
|
|
54
|
+
**Replay pass.** Before spawning the critic, check the answer against this skill's own rules.
|
|
55
|
+
Resolve the memory dir as the auto-memory dir for the current project, else the repo's
|
|
56
|
+
`.claude/memory`; if neither exists, skip replay, evidence-check, and prune with a one-line note.
|
|
57
|
+
Run `node <skill>/scripts/rule-store.mjs checklist --dir <memory dir>`. It lists only rules marked
|
|
58
|
+
`rule_store: self-critique`; open only those files and read each body before testing the answer
|
|
59
|
+
against it (names and descriptions alone are insufficient). Do not read the rest of the memory
|
|
60
|
+
dir. Tag each hit `(recurring)` in the report and record it with
|
|
61
61
|
`node <skill>/scripts/rule-store.mjs fire <name> --dir <memory dir> --date <today>`.
|
|
62
|
-
Fire counters and pruning apply only to rules in this memory directory. Rules routed to
|
|
63
|
-
`CLAUDE.md`, `AGENTS.md`, or the shared store are neither counted nor pruned.
|
|
64
62
|
|
|
65
63
|
2. **Spawn the critic (blind).** Launch one independent agent with live-source access (issue tracker,
|
|
66
64
|
code host, error monitor, the repo). Round one input is the original task text and the answer
|
|
67
65
|
verbatim, nothing else: the critic extracts the claims itself and never sees your list or sources.
|
|
68
|
-
Use the prompt template below. The critic
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
score is computed in Step 2b.
|
|
66
|
+
Use the prompt template below. The critic returns one fenced JSON block with `claims`, `missed`,
|
|
67
|
+
`where_wrong`, `shapes` and `verdict`. There is no `score` field. **Save the returned JSON
|
|
68
|
+
verbatim** as `$RUN/critic-r<N>.json` (N is the round); the ledger is checked against it.
|
|
72
69
|
|
|
73
70
|
2b. **Merge into the ledger.** Match the critic's claims to yours by meaning and set `origin` on
|
|
74
|
-
each: `both`, `author` (only you found it), `critic` (only the critic found it). Every
|
|
75
|
-
|
|
76
|
-
or `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{ "version": 1,
|
|
88
|
-
"claims": [{ "id": "c1", "text": "...", "load_bearing": true, "origin": "both",
|
|
89
|
-
"status": "verified", "checked_by": "command", "receipt": "quoted output" }],
|
|
90
|
-
"missed": [{ "id": "m1", "text": "...", "load_bearing": false, "checked_by": "read" }] }
|
|
71
|
+
each: `both`, `author` (only you found it), `critic` (only the critic found it). Every entry
|
|
72
|
+
carries its link back: `author_id` (the id in `author-claims.json`) for `author` and `both`,
|
|
73
|
+
`critic_ref` (`"r1:claims.3"` or `"r1:missed.1"`) for `critic` and `both` and on every `missed`
|
|
74
|
+
entry. Nothing from either side may be left out: every author claim and every critic item needs
|
|
75
|
+
an entry. Every critic finding with `checked_by: inferred` must be re-verified by you before it
|
|
76
|
+
may become `verified` or `refuted`; if you cannot, it stays `inferred` (and costs the same as
|
|
77
|
+
unverifiable when load-bearing). Save `$RUN/ledger-v1.json`, then run, always with all three
|
|
78
|
+
flags that apply (`--prev` from round two on):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node <skill>/scripts/claim-ledger.mjs score $RUN/ledger-v1.json \
|
|
82
|
+
--author $RUN/author-claims.json --critic r1=$RUN/critic-r1.json [--prev $RUN/ledger-v<N-1>.json]
|
|
83
|
+
node <skill>/scripts/claim-ledger.mjs summary $RUN/ledger-v1.json
|
|
91
84
|
```
|
|
92
85
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
A ledger that drops a claim, cites a missing critic item, or loses an id from the previous round
|
|
87
|
+
exits 2 with the errors as JSON: fix the ledger, not the check. Output with
|
|
88
|
+
`"integrity": "unchecked"` was run without those flags and may not be reported as a score.
|
|
89
|
+
Claims found by only one side go under "Asymmetric claims".
|
|
90
|
+
|
|
91
|
+
3. **Decide and loop.** After each round run
|
|
92
|
+
`node <skill>/scripts/claim-ledger.mjs status $RUN/ledger-v1.json [$RUN/ledger-v2.json ...]`.
|
|
93
|
+
It prints `first_score`, `final_score`, `trajectory`, `open` (`load_bearing` and `other` counts)
|
|
94
|
+
and `done`. **Stop when** `done` is true (no load-bearing claim is refuted, unverifiable or
|
|
95
|
+
inferred, and no load-bearing missed item remains, inferred ones included), OR nothing left open can be fixed by a
|
|
96
|
+
revision (say why in "Declined findings"), OR 3 rounds have run. There is no score threshold:
|
|
97
|
+
the critic-only penalty can never be revised away, so a score target would loop on nothing.
|
|
98
|
+
|
|
99
|
+
Otherwise revise the answer to produce `v2`, write `$RUN/ledger-v2.json` (it keeps every earlier
|
|
100
|
+
claim id), and run
|
|
101
|
+
`node <skill>/scripts/claim-ledger.mjs ratchet $RUN/ledger-v1.json $RUN/ledger-v2.json --author $RUN/author-claims.json --critic r1=$RUN/critic-r1.json --critic r2=$RUN/critic-r2.json`.
|
|
102
|
+
A lower re-score discards the revision and you keep the winner. Round two and later hand the
|
|
103
|
+
critic your receipts for the still-open claims (it is no longer blind). **Hard cap: 3 critic
|
|
104
|
+
rounds.**
|
|
109
105
|
|
|
110
106
|
**Cost.** The critic runs on a mid-tier model (Sonnet class) by default. Escalate one tier only
|
|
111
107
|
when a mid-tier round found nothing and the answer is load-bearing. When the budget is tight,
|
|
112
108
|
verify load-bearing claims first.
|
|
113
109
|
|
|
114
|
-
4. **Report, always, even after a single round.**
|
|
115
|
-
- **
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
4. **Report, always, even after a single round.** Lead with two numbers, then the rest in order:
|
|
111
|
+
- **Headline** - the first-answer score (round 1, what the user would have got without this
|
|
112
|
+
skill) and the open-defect count from `status` (load-bearing and other). The first-answer
|
|
113
|
+
score is the honest quality number; the final score only measures the revision.
|
|
114
|
+
- **Corrected answer (`v_final`)** - restated in full, not as a diff. After a single round with
|
|
115
|
+
no revision, restate `v1` unchanged and label it unrevised. If load-bearing defects are still
|
|
116
|
+
open, give their count and the stop reason beside it; never call that outcome clean.
|
|
117
|
+
- **Score trajectory** - for example `72 -> 88 -> 94 (+22 pts)`, all computed. If only one round
|
|
118
|
+
ran with `done` true, state `no revision needed`; if it stopped with load-bearing defects open, say that instead. Add the trend from
|
|
119
|
+
`node <skill>/scripts/run-store.mjs history --cwd "$PWD"` (first-answer score per run).
|
|
120
|
+
- **Claim ledger** - the `summary` table for the ledger the ratchet kept, and its `score` with
|
|
121
|
+
`integrity: checked`.
|
|
121
122
|
- **Where you were wrong** - consolidated, each item with the receipt the critic cited.
|
|
122
123
|
- **Asymmetric claims** - claims only you found, and claims only the critic found.
|
|
123
124
|
- **Recurring rules fired** - each stored rule the replay pass hit, with its new `fires` count.
|
|
124
|
-
- **Iterations to satisfy** - how many critic rounds it took (1 means it was solid first pass).
|
|
125
|
-
- **Score trajectory** - for example `72 -> 88 -> 94 (+22 pts)`, all computed scores. If only one
|
|
126
|
-
round ran, state `no revision needed`.
|
|
125
|
+
- **Iterations to satisfy** - how many critic rounds it took (1 with `done` true means it was solid first pass).
|
|
127
126
|
- **Unverifiable** - anything you should not present as fact.
|
|
128
127
|
- **Declined findings** - ledger items you chose not to fix, with the reason. Silently dropping
|
|
129
128
|
one looks identical to missing it.
|
|
130
|
-
- **Rules written**
|
|
131
|
-
- **Rules proposed for deletion** - the candidates from the prune pass, or `none`.
|
|
132
|
-
|
|
133
|
-
5. **Convert the outcome into a durable rule.** See below. Skipping this step is what makes the
|
|
134
|
-
same critique necessary again next week.
|
|
135
|
-
|
|
136
|
-
## Step 5: turn the critique into something that outlives the session
|
|
137
|
-
|
|
138
|
-
A score is a measurement, not an improvement. The improvement is the rule you write down, in a
|
|
139
|
-
place a future session actually reads, before you move on.
|
|
140
|
-
|
|
141
|
-
**Not every finding earns a rule.** Write one only when the finding passes both gates:
|
|
142
|
-
|
|
143
|
-
- **Recurrence** - the same *shape* of mistake could plausibly happen again on a different task.
|
|
144
|
-
- **Cost** - it would have reached the user, cost real rework, or damaged their credibility with
|
|
145
|
-
someone else.
|
|
146
|
-
|
|
147
|
-
A one-off factual slip, a typo, or a finding fully explained by this task's specifics fails both.
|
|
148
|
-
Writing a rule for it pollutes the store, and a littered store is worse than a thin one, because
|
|
149
|
-
the next session stops reading it.
|
|
150
|
-
|
|
151
|
-
**Write the shape, not the incident.** The incident is the evidence; the shape is the rule. Ask
|
|
152
|
-
what class of reasoning produced the error, then name that class:
|
|
129
|
+
- **Rules written** and **Rules proposed for deletion** (Step 5), or `none`.
|
|
153
130
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
| Called an endpoint a read because the path was a noun and a sibling module imported | A conclusion drawn from evidence that does not cover the claim |
|
|
157
|
-
| Priced an open design question as "small" in the same sentence that asked which design was wanted | Never attach a size to an answer you are simultaneously asking for |
|
|
158
|
-
| Described a batch from the one member that was checked | Check the risk-deciding field on every member before describing the set |
|
|
131
|
+
5. **Convert the outcome into a durable rule.** Skipping this step is what makes the same critique
|
|
132
|
+
necessary again next week. Write a rule only when the finding passes both gates:
|
|
159
133
|
|
|
160
|
-
**
|
|
134
|
+
- **Recurrence** - the same *shape* of mistake could plausibly happen again on a different task.
|
|
135
|
+
- **Cost** - it would have reached the user, cost real rework, or damaged their credibility.
|
|
161
136
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
**Each rule carries three things.** Without all three the next session cannot act on it:
|
|
172
|
-
|
|
173
|
-
- **The rule**, stated as the shape, in the imperative.
|
|
174
|
-
- **Why**, with the incident and its receipt, dated. A rule with no cost attached gets argued away.
|
|
175
|
-
- **How to apply**, naming the moment the rule fires ("before drafting outbound text", "before
|
|
176
|
-
describing a batch"), not just the principle.
|
|
177
|
-
|
|
178
|
-
Before writing to shared persistence, redact the incident evidence, including when using
|
|
179
|
-
`context-repo` or `shared-knowledge-artifact`, while still including the incident and its dated
|
|
180
|
-
receipt. This redaction requirement does not apply to local agent memory or repository-rule writes.
|
|
181
|
-
|
|
182
|
-
**Dedupe before writing.** Read the store first. If a rule of the same shape exists, add one dated
|
|
183
|
-
evidence line to it instead of creating a second entry, with at most three evidence lines per rule.
|
|
184
|
-
A fourth incident means the rule named the incident, not the shape: rewrite the rule text and keep
|
|
185
|
-
the three most recent evidence lines. Link related rules instead of restating them. Only when the
|
|
186
|
-
memory directory resolved in Step 1 exists, run
|
|
187
|
-
`node <skill>/scripts/rule-store.mjs evidence-check --dir <memory dir>` before writing and report
|
|
188
|
-
any rule it flags. Skip this command when neither supported memory directory exists.
|
|
189
|
-
|
|
190
|
-
**Memory rule identity and counters.** Mark each rule stored by this workflow with
|
|
191
|
-
`rule_store: self-critique` under `metadata:` in its memory file's frontmatter. Mark an existing
|
|
192
|
-
rule only after reading it and confirming it belongs to this workflow. Only marked rules are
|
|
193
|
-
pruning candidates; unrelated project and user memories are excluded. A memory rule's `fires` and
|
|
194
|
-
`last_fired` live under `metadata:` and are written only by `fire`. Rules routed to `CLAUDE.md`,
|
|
195
|
-
`AGENTS.md`, or the shared store are neither counted nor pruned.
|
|
196
|
-
|
|
197
|
-
**Prune pass.** At the end of this step, only when a valid memory directory is available, run
|
|
198
|
-
`node <skill>/scripts/rule-store.mjs prune --dir <memory dir> --idle-days 60`. List the candidates
|
|
199
|
-
in the report under "Rules proposed for deletion". Skip this command when neither supported memory
|
|
200
|
-
directory exists. Never delete a rule without the user's reply.
|
|
201
|
-
|
|
202
|
-
**Then close the loop.** State in your report where the rule was written and what it says, so the
|
|
203
|
-
user can veto it. A rule the user has not seen is a rule they cannot correct.
|
|
137
|
+
A one-off factual slip, a typo, or a finding fully explained by this task's specifics fails both;
|
|
138
|
+
a littered store is worse than a thin one. Write the shape (the class of reasoning that produced
|
|
139
|
+
the error), not the incident. Route it to the narrowest store, in this order, and only one:
|
|
140
|
+
(1) the user's or project's agent memory, (2) the repo's `CLAUDE.md` / `AGENTS.md`, (3) a shared
|
|
141
|
+
cross-session store. Each rule carries three things: **the rule** in the imperative, **why** (the
|
|
142
|
+
incident, dated, with its receipt), and **how to apply** (the moment it fires). Mark memory rules
|
|
143
|
+
`rule_store: self-critique`, dedupe before writing, run the prune pass, and tell the user what you
|
|
144
|
+
wrote so they can veto it. Shapes table, routing detail, dedupe, redaction, identity and the
|
|
145
|
+
prune pass: `references/rules.md`.
|
|
204
146
|
|
|
205
147
|
## Critic prompt template
|
|
206
148
|
|
|
@@ -248,98 +190,14 @@ the default stance is that the answer is wrong until a live source proves otherw
|
|
|
248
190
|
>
|
|
249
191
|
> Do not output a score. It is computed from your claims.
|
|
250
192
|
|
|
251
|
-
### Score anchors
|
|
252
|
-
|
|
253
|
-
The score is `100` minus penalties, floored at 0. Calibrate against these three ledgers (all claims
|
|
254
|
-
`origin: both`; `node <skill>/scripts/claim-ledger.mjs anchors` prints them as JSON).
|
|
255
|
-
|
|
256
|
-
**Strong, score 95**
|
|
257
|
-
|
|
258
|
-
| id | load_bearing | status | checked_by |
|
|
259
|
-
| --- | --- | --- | --- |
|
|
260
|
-
| a1 | no | inferred | inferred |
|
|
261
|
-
|
|
262
|
-
**Middling, score 72**
|
|
263
|
-
|
|
264
|
-
| id | load_bearing | status | checked_by |
|
|
265
|
-
| --- | --- | --- | --- |
|
|
266
|
-
| b1 | no | refuted | read |
|
|
267
|
-
| b2 | no | refuted | read |
|
|
268
|
-
| b3 | no | unverifiable | read |
|
|
269
|
-
| b4 | no | unverifiable | read |
|
|
270
|
-
|
|
271
|
-
**Weak, score 40**
|
|
272
|
-
|
|
273
|
-
| id | load_bearing | status | checked_by |
|
|
274
|
-
| --- | --- | --- | --- |
|
|
275
|
-
| c1 | yes | refuted | read |
|
|
276
|
-
| c2 | yes | refuted | read |
|
|
277
|
-
| c3 | yes | unverifiable | read |
|
|
278
|
-
|
|
279
|
-
Penalties:
|
|
280
|
-
|
|
281
|
-
| Finding | Points off |
|
|
282
|
-
| --- | --- |
|
|
283
|
-
| refuted, load-bearing | 25 |
|
|
284
|
-
| refuted | 10 |
|
|
285
|
-
| unverifiable, load-bearing | 10 |
|
|
286
|
-
| unverifiable | 4 |
|
|
287
|
-
| inferred, accepted | 5 |
|
|
288
|
-
| missed, load-bearing | 15 |
|
|
289
|
-
| missed | 5 |
|
|
290
|
-
| verified but found only by the critic | 5 |
|
|
291
|
-
|
|
292
|
-
## Optional: auto-offer via a Claude Code Stop hook
|
|
293
|
-
|
|
294
|
-
A hook is a shell command, so it cannot run this loop itself. What it can do is **nudge**: after a
|
|
295
|
-
substantial answer, it offers the review and you run the skill only if the user says yes.
|
|
296
|
-
|
|
297
|
-
The hook ships with this skill at `scripts/critique-nudge.mjs`. Register it as a `Stop` hook in your
|
|
298
|
-
Claude Code settings (`.claude/settings.json` for a team, `.claude/settings.local.json` for
|
|
299
|
-
yourself):
|
|
300
|
-
|
|
301
|
-
```json
|
|
302
|
-
{
|
|
303
|
-
"hooks": {
|
|
304
|
-
"Stop": [
|
|
305
|
-
{
|
|
306
|
-
"hooks": [
|
|
307
|
-
{
|
|
308
|
-
"type": "command",
|
|
309
|
-
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/critique-nudge.mjs\"",
|
|
310
|
-
"timeout": 15
|
|
311
|
-
}
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
]
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
Copy `scripts/critique-nudge.mjs` to `.claude/hooks/critique-nudge.mjs` (or point the command at
|
|
320
|
-
wherever you keep it). After an answer whose final prose is at least 1500 characters, the hook blocks
|
|
321
|
-
the turn once and instructs the agent to append a one-line "critical-thinking review" offer, then
|
|
322
|
-
stop. Two loop guards keep it from firing forever: it does nothing when `stop_hook_active` is set, and
|
|
323
|
-
nothing when the answer already contains the offer phrase. On any malformed input it exits silently
|
|
324
|
-
and never blocks the user.
|
|
325
|
-
|
|
326
|
-
The 1500-character threshold is a heuristic with a known ceiling: it misses short but dense
|
|
327
|
-
tool-heavy turns. If that matters, extend the script to also count tool calls since the last user
|
|
328
|
-
message.
|
|
329
|
-
|
|
330
193
|
## Notes
|
|
331
194
|
|
|
332
|
-
- One critic round is fine and common. If the answer was already solid, report
|
|
195
|
+
- One critic round is fine and common. If the answer was already solid (`done` true), report
|
|
333
196
|
`iterations: 1, no revision needed` and the single score rather than forcing a revision.
|
|
334
197
|
- Diversity beats redundancy: if a claim can fail in more than one way, give the critic distinct
|
|
335
198
|
lenses (correctness, completeness, does-it-reproduce) instead of repeating the same check.
|
|
336
199
|
- The critic verifies against live sources; it does not rewrite the answer or score it. You revise;
|
|
337
200
|
the score is recomputed from the ledger.
|
|
338
|
-
- In round two, hand the critic your receipts for the claims still open, so it spends its budget on
|
|
339
|
-
the claims still standing instead of re-deriving the ones already settled.
|
|
340
201
|
- A critic finding you disagree with is worth one challenge. Put the reasoning to it and let it rule;
|
|
341
202
|
if it concedes, that is a real answer for the report, and the reasoning is what the user needs to
|
|
342
203
|
see either way.
|
|
343
|
-
- The honest test of Step 5 is not that a rule was written, it is that the next task of the same
|
|
344
|
-
class does not need this skill to catch the same thing. If it does, the rule named the incident
|
|
345
|
-
instead of the shape - rewrite it, do not add another.
|
|
@@ -29,7 +29,6 @@ description: >
|
|
|
29
29
|
the PR", provides a GitHub PR URL, or asks for a pull request review in any
|
|
30
30
|
form.
|
|
31
31
|
license: MIT
|
|
32
|
-
model: sonnet
|
|
33
32
|
allowed-tools: Bash, Read, Write, Edit, Agent, Workflow, AskUserQuestion, Artifact, spawn_agent, wait_agent, followup_task, send_message, interrupt_agent, list_agents
|
|
34
33
|
compatibility: >
|
|
35
34
|
Claude Code and OpenAI Codex. Claude uses Workflow/Agent/Artifact. Codex uses
|
|
@@ -46,7 +45,7 @@ metadata:
|
|
|
46
45
|
- multi-agent
|
|
47
46
|
- workflow
|
|
48
47
|
- quality
|
|
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] [--crossvendor] [--quiet-decisions]"
|
|
48
|
+
argument-hint: "<github-pr-url | repo pr-number | repo pr-title | branch [ref]> [scan|medium|deep|deps] [--post] [--fix] [--base <ref>] [--risk routine|standard|large|elevated|critical] [--crossvendor] [--quiet-decisions]"
|
|
50
49
|
---
|
|
51
50
|
<!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
|
|
52
51
|
|
|
@@ -344,7 +343,7 @@ it in one line and leave `ROUTING` unset: every agent then keeps the
|
|
|
344
343
|
workflow's built-in default (`sonnet`, `haiku` for triage). The full matrix is in `README.md`
|
|
345
344
|
under "Models and effort".
|
|
346
345
|
|
|
347
|
-
**`--risk routine|standard|elevated|critical` flag:** parse and pass to
|
|
346
|
+
**`--risk routine|standard|large|elevated|critical` flag:** parse and pass to
|
|
348
347
|
`model-matrix.mjs` as `--risk`. It overrides the detected tier, never the depth.
|
|
349
348
|
|
|
350
349
|
**`--crossvendor` flag:** pass `--crossvendor` to `model-matrix.mjs`. The gate
|
|
@@ -487,14 +486,21 @@ node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/run-log.mjs" decide <RU
|
|
|
487
486
|
|
|
488
487
|
## Progress line
|
|
489
488
|
|
|
490
|
-
|
|
489
|
+
`run-log.mjs` already prints this line on stderr for `start`, each `mark`
|
|
490
|
+
(`context`, `review`, `synthesis` as `post`, `fix`, `post`), each `decide` (as a
|
|
491
|
+
compass line) and `finish`. So the Bash tool result of those calls carries the
|
|
492
|
+
boat; copy the line into your own text at each milestone and end the final
|
|
493
|
+
message with the `success` or `failure` line. `LEKKER_PROGRESS=off` silences it.
|
|
494
|
+
|
|
495
|
+
For the milestones the run log does not mark (`verify`, `critic`, `prove`), run
|
|
491
496
|
`node "${CLAUDE_PLUGIN_ROOT}/skills/lekker-review/scripts/lekker-progress.mjs" --stage <stage> --message "<short fact>"`
|
|
492
497
|
(foreground, it returns in under a second; in Codex use the absolute path to
|
|
493
498
|
`scripts/lekker-progress.mjs` beside the selected `SKILL.md`). It prints one
|
|
494
499
|
status line (a boat drifting toward a lighthouse), animates only on a real
|
|
495
|
-
terminal
|
|
496
|
-
|
|
497
|
-
|
|
500
|
+
terminal (the Bash tool is not one, so expect the static line), and always
|
|
501
|
+
exits 0. It is decoration: run it after the milestone's own output, never
|
|
502
|
+
instead of it, and keep every count and reason in the report too. Add `--ascii`
|
|
503
|
+
on terminals that mis-measure emoji.
|
|
498
504
|
|
|
499
505
|
| Milestone | Stage | Message, e.g. |
|
|
500
506
|
| --- | --- | --- |
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// Prints {host, tier, tierSource, reasons, visual, routing}.
|
|
18
18
|
import { pathToFileURL } from 'node:url'
|
|
19
19
|
|
|
20
|
-
export const TIERS = ['routine', 'standard', 'elevated', 'critical']
|
|
20
|
+
export const TIERS = ['routine', 'standard', 'large', 'elevated', 'critical']
|
|
21
21
|
export const HOSTS = ['claude', 'codex']
|
|
22
22
|
export const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max']
|
|
23
23
|
|
|
@@ -25,29 +25,32 @@ export const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max']
|
|
|
25
25
|
export const GATE_ROLES = ['verifier', 'critic']
|
|
26
26
|
|
|
27
27
|
const r = (model, effort) => ({ model, effort })
|
|
28
|
-
const same = cell => [cell, cell, cell, cell]
|
|
28
|
+
const same = cell => [cell, cell, cell, cell, cell]
|
|
29
29
|
|
|
30
|
-
// One row per role: [routine, standard, elevated, critical].
|
|
30
|
+
// One row per role: [routine, standard, large, elevated, critical].
|
|
31
|
+
// `large` (500-800 lines) keeps the finders on the standard route and moves only the
|
|
32
|
+
// verifier to the strong model at medium effort: finders are most of the spend
|
|
33
|
+
// (PR 83: 9.8M of 12.1M cache reads), the verifier decides what survives.
|
|
31
34
|
export const MATRIX = {
|
|
32
35
|
claude: {
|
|
33
36
|
triage: same(r('haiku', 'medium')),
|
|
34
|
-
specialist: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('opus', 'xhigh')],
|
|
35
|
-
rules: [r('sonnet', 'medium'), r('sonnet', 'medium'), r('sonnet', 'high'), r('sonnet', 'high')],
|
|
36
|
-
verifier: [r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'high')],
|
|
37
|
-
critic: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'high'), r('fable', 'xhigh')],
|
|
38
|
-
prover: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
|
|
39
|
-
fixer: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
|
|
37
|
+
specialist: [r('sonnet', 'medium'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high'), r('opus', 'xhigh')],
|
|
38
|
+
rules: [r('sonnet', 'medium'), r('sonnet', 'medium'), r('sonnet', 'medium'), r('sonnet', 'high'), r('sonnet', 'high')],
|
|
39
|
+
verifier: [r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'medium'), r('opus', 'high'), r('fable', 'high')],
|
|
40
|
+
critic: [r('sonnet', 'medium'), r('sonnet', 'high'), r('opus', 'medium'), r('opus', 'high'), r('fable', 'xhigh')],
|
|
41
|
+
prover: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
|
|
42
|
+
fixer: [r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('sonnet', 'high'), r('opus', 'high')],
|
|
40
43
|
polish: same(r('sonnet', 'medium')),
|
|
41
44
|
housekeeping: same(r('haiku', 'low')),
|
|
42
45
|
},
|
|
43
46
|
codex: {
|
|
44
47
|
triage: same(r('gpt-6-luna', 'medium')),
|
|
45
|
-
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')],
|
|
46
|
-
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')],
|
|
47
|
-
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')],
|
|
48
|
-
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')],
|
|
49
|
-
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')],
|
|
50
|
-
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')],
|
|
48
|
+
specialist: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
|
|
49
|
+
rules: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high')],
|
|
50
|
+
verifier: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'medium'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'high')],
|
|
51
|
+
critic: [r('gpt-6.2-sol', 'medium'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'medium'), r('gpt-6.2-astra', 'high'), r('gpt-6.2-astra', 'xhigh')],
|
|
52
|
+
prover: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
|
|
53
|
+
fixer: [r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-sol', 'high'), r('gpt-6.2-astra', 'high')],
|
|
51
54
|
polish: same(r('gpt-6.2-sol', 'medium')),
|
|
52
55
|
housekeeping: same(r('gpt-6-luna', 'low')),
|
|
53
56
|
},
|
|
@@ -67,6 +70,7 @@ const CRITICAL_CATEGORIES = ['auth', 'billing']
|
|
|
67
70
|
const ELEVATED_CATEGORIES = ['ci-workflow', 'installer']
|
|
68
71
|
const DEEP_LINES = 800
|
|
69
72
|
const DEEP_FILES = 25
|
|
73
|
+
const LARGE_LINES = 500
|
|
70
74
|
|
|
71
75
|
// Each rule: [tier, reason, test]. First match wins, so order is severity order.
|
|
72
76
|
const TIER_RULES = [
|
|
@@ -75,6 +79,7 @@ const TIER_RULES = [
|
|
|
75
79
|
['elevated', 'migrations or SQL', s => s.files.some(f => MIGRATION_FILE.test(f))],
|
|
76
80
|
['elevated', `more than ${DEEP_LINES} changed lines or ${DEEP_FILES} files`, s => s.lines > DEEP_LINES || s.files.length > DEEP_FILES],
|
|
77
81
|
['routine', 'documentation only', s => s.files.length > 0 && s.files.every(f => DOC_FILE.test(f))],
|
|
82
|
+
['large', `more than ${LARGE_LINES} changed lines`, s => s.lines > LARGE_LINES],
|
|
78
83
|
]
|
|
79
84
|
|
|
80
85
|
export function tierFor({ files = [], categories = [], lines = 0, override } = {}) {
|
|
@@ -26,12 +26,15 @@
|
|
|
26
26
|
// runs/<runId>/timeline.jsonl
|
|
27
27
|
// runs/<runId>/<attached files>
|
|
28
28
|
//
|
|
29
|
+
// `start`, `mark`, `decide` and `finish` also print the lekker-progress status line on stderr.
|
|
30
|
+
//
|
|
29
31
|
// `finish` may be called more than once for one run (after the review, again
|
|
30
32
|
// after fix mode); every call appends a fresh row and the newest one wins.
|
|
31
33
|
|
|
32
34
|
import { readFileSync, writeFileSync, appendFileSync, existsSync, mkdirSync, mkdtempSync, copyFileSync, readdirSync, statSync, rmSync } from 'node:fs';
|
|
33
35
|
import { homedir } from 'node:os';
|
|
34
36
|
import { basename, join } from 'node:path';
|
|
37
|
+
import { frame, STAGES } from './lekker-progress.mjs';
|
|
35
38
|
|
|
36
39
|
const STATE_DIR = process.env.LEKKER_STATE_DIR || join(homedir(), '.local', 'state', 'lekker-review');
|
|
37
40
|
const RUNS_DIR = join(STATE_DIR, 'runs');
|
|
@@ -40,6 +43,8 @@ const PROJECTS_DIR = process.env.LEKKER_CLAUDE_PROJECTS || join(homedir(), '.cla
|
|
|
40
43
|
const REVMUX_TASKS = process.env.LEKKER_REVMUX_TASKS_DIR || join(homedir(), 'code-reviews', 'revmux-tasks');
|
|
41
44
|
|
|
42
45
|
const DECISION_KINDS = ['depth', 'tier', 'route', 'finding', 'fix', 'post'];
|
|
46
|
+
// Run-log phase -> progress stage. `synthesis` is "review saved", so it shares the `post` slot.
|
|
47
|
+
const PHASE_STAGE = { start: 'start', context: 'context', review: 'review', synthesis: 'post', fix: 'fix', post: 'post' };
|
|
43
48
|
const argv = process.argv.slice(2);
|
|
44
49
|
const cmd = argv[0];
|
|
45
50
|
|
|
@@ -54,6 +59,17 @@ function flags(name) {
|
|
|
54
59
|
}
|
|
55
60
|
const has = (name) => argv.includes('--' + name);
|
|
56
61
|
|
|
62
|
+
// The Bash tool is never a TTY, and a skill step that says "decoration" gets skipped, so the
|
|
63
|
+
// run log (called at every milestone) prints the status line itself. It goes to stderr so
|
|
64
|
+
// stdout stays the single JSON object callers parse; LEKKER_PROGRESS=off silences it.
|
|
65
|
+
function progress(stage, message) {
|
|
66
|
+
if (process.env.LEKKER_PROGRESS === 'off' || !STAGES[stage]) return;
|
|
67
|
+
try {
|
|
68
|
+
const ascii = has('ascii') || Boolean(process.env.LEKKER_PROGRESS_ASCII);
|
|
69
|
+
process.stderr.write(`${frame(stage, STAGES[stage][0] ?? 0, { message, ascii })}\n`);
|
|
70
|
+
} catch { /* decoration must never fail a review */ }
|
|
71
|
+
}
|
|
72
|
+
|
|
57
73
|
const readJson = (p) => {
|
|
58
74
|
try { return JSON.parse(readFileSync(p, 'utf8')); } catch { return null; }
|
|
59
75
|
};
|
|
@@ -167,6 +183,7 @@ if (cmd === 'start') {
|
|
|
167
183
|
writeFileSync(join(dir, 'run.json'), JSON.stringify(meta, null, 2) + '\n');
|
|
168
184
|
appendFileSync(join(dir, 'timeline.jsonl'), JSON.stringify({ phase: 'start', at: startedAt }) + '\n');
|
|
169
185
|
console.log(JSON.stringify({ runId, dir }));
|
|
186
|
+
progress('start', `${repo} ${target}, ${meta.depth ?? 'depth unset'}`);
|
|
170
187
|
} else if (cmd === 'mark') {
|
|
171
188
|
const [runId, phase] = [argv[1], argv[2]];
|
|
172
189
|
if (!phase) fail('mark needs <runId> <phase>');
|
|
@@ -174,6 +191,7 @@ if (cmd === 'start') {
|
|
|
174
191
|
if (!existsSync(dir)) fail(`no run ${runId}`);
|
|
175
192
|
appendFileSync(join(dir, 'timeline.jsonl'), JSON.stringify({ phase, at: new Date().toISOString(), note: flag('note') ?? undefined }) + '\n');
|
|
176
193
|
console.log(JSON.stringify({ runId, phase }));
|
|
194
|
+
progress(PHASE_STAGE[phase], flag('note') ?? (phase === 'synthesis' ? 'review synthesized' : undefined));
|
|
177
195
|
} else if (cmd === 'decide') {
|
|
178
196
|
const runId = argv[1];
|
|
179
197
|
const dir = runDir(runId);
|
|
@@ -193,6 +211,7 @@ if (cmd === 'start') {
|
|
|
193
211
|
const lines = rows.map(({ kind, what, why }) => JSON.stringify({ at, kind, what, why }) + '\n').join('');
|
|
194
212
|
appendFileSync(join(dir, 'timeline.jsonl'), lines);
|
|
195
213
|
console.log(JSON.stringify({ runId, decisions: rows.length }));
|
|
214
|
+
rows.forEach(({ what, why }) => progress('decision', `${what}: ${why}`));
|
|
196
215
|
} else if (cmd === 'attach') {
|
|
197
216
|
const runId = argv[1];
|
|
198
217
|
const dir = runDir(runId);
|
|
@@ -235,6 +254,8 @@ if (cmd === 'start') {
|
|
|
235
254
|
append(row);
|
|
236
255
|
const unresolved = workflows.filter((w) => w.durationS == null).map((w) => w.wfId);
|
|
237
256
|
console.log(JSON.stringify({ runId, ledger: LEDGER, wallS: row.wallS, tokensTotal: row.tokensTotal, unresolvedWorkflows: unresolved }));
|
|
257
|
+
if (row.status === 'ok') progress('success', row.verdict ?? undefined);
|
|
258
|
+
else progress('failure', row.note ?? row.status);
|
|
238
259
|
} else if (cmd === 'report') {
|
|
239
260
|
const days = Number(flag('days', '30'));
|
|
240
261
|
const rows = latestRows(days);
|