@olegkoval/agent-skills 1.27.0 → 1.28.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 (51) hide show
  1. package/.claude-plugin/plugin.json +2 -1
  2. package/README.md +4 -3
  3. package/catalog/skills.json +18 -0
  4. package/package.json +1 -1
  5. package/packages/software-development/lekker-review/SKILL.md +519 -0
  6. package/packages/software-development/lekker-review/adapters/claude/plugin.json +5 -0
  7. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/SKILL.md +520 -0
  8. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/completeness-critic.md +21 -0
  9. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/conventions.md +124 -0
  10. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/fix-verifier.md +84 -0
  11. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/fixer.md +120 -0
  12. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/implementation.md +53 -0
  13. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/prover.md +135 -0
  14. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/quality.md +72 -0
  15. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/simplification.md +45 -0
  16. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/test-quality.md +170 -0
  17. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/triage-logic.md +27 -0
  18. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/triage-quality.md +41 -0
  19. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/agents/verifier.md +295 -0
  20. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/artifact-page.md +143 -0
  21. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/context-gathering.md +162 -0
  22. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/fix-mode.md +329 -0
  23. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/github-post.md +205 -0
  24. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/house-rules.md +76 -0
  25. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/references/output-format.md +232 -0
  26. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/scripts/changed-files.sh +77 -0
  27. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/scripts/setup-worktree.sh +337 -0
  28. package/packages/software-development/lekker-review/adapters/claude/skills/lekker-review/scripts/verify-fixes.sh +231 -0
  29. package/packages/software-development/lekker-review/fix-workflow.js +273 -0
  30. package/packages/software-development/lekker-review/references/agents/completeness-critic.md +21 -0
  31. package/packages/software-development/lekker-review/references/agents/conventions.md +124 -0
  32. package/packages/software-development/lekker-review/references/agents/fix-verifier.md +84 -0
  33. package/packages/software-development/lekker-review/references/agents/fixer.md +120 -0
  34. package/packages/software-development/lekker-review/references/agents/implementation.md +53 -0
  35. package/packages/software-development/lekker-review/references/agents/prover.md +135 -0
  36. package/packages/software-development/lekker-review/references/agents/quality.md +72 -0
  37. package/packages/software-development/lekker-review/references/agents/simplification.md +45 -0
  38. package/packages/software-development/lekker-review/references/agents/test-quality.md +170 -0
  39. package/packages/software-development/lekker-review/references/agents/triage-logic.md +27 -0
  40. package/packages/software-development/lekker-review/references/agents/triage-quality.md +41 -0
  41. package/packages/software-development/lekker-review/references/agents/verifier.md +295 -0
  42. package/packages/software-development/lekker-review/references/artifact-page.md +143 -0
  43. package/packages/software-development/lekker-review/references/context-gathering.md +162 -0
  44. package/packages/software-development/lekker-review/references/fix-mode.md +329 -0
  45. package/packages/software-development/lekker-review/references/github-post.md +205 -0
  46. package/packages/software-development/lekker-review/references/house-rules.md +76 -0
  47. package/packages/software-development/lekker-review/references/output-format.md +232 -0
  48. package/packages/software-development/lekker-review/scripts/changed-files.sh +77 -0
  49. package/packages/software-development/lekker-review/scripts/setup-worktree.sh +337 -0
  50. package/packages/software-development/lekker-review/scripts/verify-fixes.sh +231 -0
  51. package/packages/software-development/lekker-review/workflow.js +602 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-agent-skills",
3
3
  "description": "Agent-agnostic skill catalog for Codex, Claude, Cursor, Grok, Copilot, Windsurf, Kiro, and other skill-aware tools.",
4
- "version": "1.26.0",
4
+ "version": "1.27.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -9,6 +9,7 @@
9
9
  "repository": "https://github.com/oleg-koval/agent-skills",
10
10
  "license": "MIT",
11
11
  "skills": [
12
+ "./packages/software-development/lekker-review",
12
13
  "./packages/software-development/self-critique",
13
14
  "./packages/software-development/docs-index-keeper",
14
15
  "./packages/software-development/semantic-release-beta",
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <p><strong>Agent-agnostic skill catalog for Codex, Claude, Cursor, Grok, Copilot, Windsurf, Kiro, and other skill-aware tools.</strong></p>
4
4
  <p>
5
5
  <img src="https://img.shields.io/badge/license-MIT-16a34a" alt="MIT license">
6
- <img src="https://img.shields.io/badge/skills-24-2563eb" alt="24 skills">
6
+ <img src="https://img.shields.io/badge/skills-40-2563eb" alt="40 skills">
7
7
  <img src="https://img.shields.io/badge/platforms-Codex%20%7C%20Claude%20%7C%20Cursor%20%7C%20Grok%20%7C%20Copilot%20%7C%20Windsurf%20%7C%20Kiro-111827" alt="Codex Claude Cursor Grok Copilot Windsurf Kiro">
8
8
  <img src="https://img.shields.io/badge/status-public%20catalog-16a34a" alt="Public catalog">
9
9
  </p>
@@ -139,11 +139,11 @@ packages/{category}/{skill}/SKILL.md
139
139
 
140
140
  </details>
141
141
 
142
- ## All 39 Skills
142
+ ## All 40 Skills
143
143
 
144
144
  Each entry links to its `SKILL.md`. Reference any skill by its `olko:*` lookup name in a new agent session.
145
145
 
146
- ### Software development (34)
146
+ ### Software development (35)
147
147
 
148
148
  | Skill | What it does | Use when |
149
149
  |-------|-------------|----------|
@@ -160,6 +160,7 @@ Each entry links to its `SKILL.md`. Reference any skill by its `olko:*` lookup n
160
160
  | [geminiloop](packages/software-development/geminiloop/SKILL.md) | Iteratively drives a GitHub PR to zero unresolved Gemini Code Assist comments, treating each as a claim to verify — fixing the correct ones and rebutting the rest with evidence | Clearing a Gemini Code Assist review whose findings need checking first |
161
161
  | [gh-cli](packages/software-development/gh-cli/SKILL.md) | Guides GitHub CLI usage for repos, PRs, Actions, releases, issues, and all related GitHub operations | Working with GitHub from the command line and needing reliable `gh` commands |
162
162
  | [git-commit](packages/software-development/git-commit/SKILL.md) | Creates conventional commits with diff-aware staging and message generation | Asking to commit changes or wanting a conventional commit message from the current diff |
163
+ | [lekker-review](packages/software-development/lekker-review/SKILL.md) | Runs a FAANG-quality PR review in an isolated worktree: 5 parallel specialist agents, adversarial finding verification, proof-of-bug tests for Criticals, and an optional --fix mode that applies and commits its own findings (Claude Code only — needs the Workflow tool) | Reviewing a GitHub PR beyond what a single-pass review or a bot reviewer catches |
163
164
  | [macos-menubar-app](packages/software-development/macos-menubar-app/SKILL.md) | Builds a production-quality macOS menubar or notch app in SwiftUI — MenuBarExtra setup, sandbox entitlements, keyboard shortcuts, sound effects | Building a native macOS utility that lives in the menu bar or Dynamic Island notch |
164
165
  | [mvp-oneshot](packages/software-development/mvp-oneshot/SKILL.md) | Takes a rough product idea and produces a scoped, testable MVP plan and initial implementation in a single pass | Going from idea to a shippable one-week MVP without losing scope |
165
166
  | [obsidian-pr-sync](packages/software-development/obsidian-pr-sync/SKILL.md) | Fetches open GitHub PRs assigned to you or requesting review and writes a grouped age-sorted section into today's Obsidian daily note | Syncing GitHub review queue to Obsidian at the start of the day or on demand |
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "agent-skills",
3
3
  "packages": [
4
+ {
5
+ "name": "lekker-review",
6
+ "lookupName": "olko:lekker-review",
7
+ "category": "software-development",
8
+ "path": "packages/software-development/lekker-review",
9
+ "description": "FAANG-quality PR code review: isolated worktree checkout, context gathering from your issue tracker/chat/docs/CI/monitoring, 5 parallel specialist review agents, adversarial finding verification, proof-of-bug tests for Criticals, and an optional --fix mode that applies and commits its own findings.",
10
+ "tags": [
11
+ "code-review",
12
+ "pull-request",
13
+ "github",
14
+ "multi-agent",
15
+ "workflow",
16
+ "quality"
17
+ ],
18
+ "adapters": [
19
+ "claude"
20
+ ]
21
+ },
4
22
  {
5
23
  "name": "self-critique",
6
24
  "lookupName": "olko:self-critique",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olegkoval/agent-skills",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,519 @@
1
+ ---
2
+ name: lekker-review
3
+ description: >
4
+ FAANG-quality PR code review, adaptable to any team. Checks out the branch in an
5
+ isolated worktree, gathers context from your issue tracker, chat, docs, CI
6
+ checks, and (optionally) production monitoring, runs 5 parallel specialized
7
+ review agents (quality/implementation/simplification/conventions/test-quality),
8
+ verifies every finding against the diff, then outputs a single unified markdown
9
+ review — file + risk + bad code + why it's wrong + fix — ready to paste directly
10
+ into GitHub. Saves every review to ~/code-reviews/*.md. Covers business logic,
11
+ scalability, complexity, data integrity, security, integration contracts, error
12
+ handling, and migration safety. Critical findings come with PROOF: a prover
13
+ agent writes a failing test in the worktree demonstrating each bug, and fix
14
+ mode later re-runs it to show the fix flips it green. Every review also
15
+ publishes a private living artifact page whose URL stays stable across
16
+ re-reviews, so the author watches findings close commit by commit.
17
+ With --fix (or by accepting the post-review offer) it also APPLIES its own
18
+ Critical/Important findings as real code in the worktree, verifies each edit,
19
+ commits them, and pushes to the PR branch only after explicit confirmation.
20
+ Use when the user says "review this PR", "lekker review", "check this PR",
21
+ "do a code review on PR #N", "review and fix this PR", "apply the review
22
+ fixes", provides a GitHub PR URL, or asks for a pull request review in any
23
+ form.
24
+ license: MIT
25
+ allowed-tools: Bash, Read, Write, Edit, Agent, Workflow, AskUserQuestion, Artifact
26
+ compatibility: Claude Code only. Requires the Workflow tool (multi-agent orchestration)
27
+ and the Artifact tool (living review page) — other Agent Skills-compatible tools
28
+ without an equivalent to Workflow cannot run the review/verify/critic pipeline this
29
+ skill depends on. Requires git and gh (GitHub CLI) authenticated.
30
+ metadata:
31
+ targets: [_source-only]
32
+ author: Oleg Koval
33
+ tags:
34
+ - code-review
35
+ - pull-request
36
+ - github
37
+ - multi-agent
38
+ - workflow
39
+ - quality
40
+ argument-hint: "<github-pr-url | repo pr-number | repo pr-title> [scan|medium|deep] [--post] [--fix]"
41
+ ---
42
+
43
+ # Lekker Review
44
+
45
+ FAANG-grade code review. Isolated worktree checkout, full context gathering
46
+ (issue tracker + chat + docs + framework docs + monitoring + CI, whichever
47
+ you have MCP tools configured for), then 5 parallel specialized review
48
+ agents, a finding-verification pass, and one unified markdown output.
49
+
50
+ Each finding contains: **file + risk** · **bad code verbatim** · **why it's
51
+ wrong** · **fix with code example** - ready to paste directly into GitHub.
52
+ Reviews are saved to `~/code-reviews/` for future reference.
53
+
54
+ Optionally the skill then **applies** its own findings (`--fix`): fix agents edit
55
+ the worktree, a read-only verifier checks each edit against the real `git diff`,
56
+ static checks run, one commit lands per file, and nothing is pushed until the
57
+ user says so. Procedure in `references/fix-mode.md`.
58
+
59
+ No nitpicking. Critical and Important findings are reserved for things that
60
+ could cause bugs, outages, data loss, security incidents, or real performance
61
+ problems at scale.
62
+
63
+ **HARD RULE: the `## 💰 Review Cost` block is mandatory.** Every review MUST
64
+ end with a fully-populated cost block (token + price breakdown, real numbers,
65
+ no `<N>` placeholders). A review without the cost block is incomplete. If you
66
+ are about to present the review without it, stop and compute it first.
67
+
68
+ ---
69
+
70
+ ## Set up before first use
71
+
72
+ This skill ships with **no** hard rules of its own — `references/house-rules.md`
73
+ is a template. Fill it in with your team's own non-negotiable conventions
74
+ (type safety, pagination, PR-title format, repo-placement taxonomy, stack
75
+ context) before relying on the Critical-severity hard-rule gate. Until then,
76
+ the 5 specialist agents still run and still find real bugs — they just don't
77
+ have a codified "always Critical" rule list to check against.
78
+
79
+ If any hard rule you define carries a `rule` tag (e.g. `"TS-1"`), reviewer
80
+ agents attach that tag to matching findings and the workflow **skips
81
+ adversarial verification** for them. This is deliberate: the verifier's five
82
+ challenges ask runtime-failure questions ("does this fail on a normal
83
+ execution?", "can you write the failing test?") that a standards violation
84
+ can never answer, so verifying them systematically drops the very findings
85
+ your policy declares non-negotiable. A tagged finding keeps its Critical
86
+ severity; the workflow returns how many were exempted as `hardRuleCount`, and
87
+ each carries a `verifierReasoning` saying so.
88
+
89
+ `${CLAUDE_PLUGIN_ROOT}` below refers to this skill's own installed directory
90
+ — resolve every `references/...` and script path relative to it.
91
+
92
+ ---
93
+
94
+ ## Step 0 - Parse input
95
+
96
+ Accept any of:
97
+ - Full GitHub URL: `https://github.com/owner/repo/pull/123`
98
+ - Repo + number: `my-service 42`
99
+ - Repo + partial title: `my-service "add offline orders"`
100
+
101
+ If the user gives a short repo name without an org/owner, ask once which
102
+ org/owner it belongs to (or use a default you've configured), then build
103
+ `REPO_SLUG` as `<owner>/<name>`.
104
+
105
+ Derive and carry these variables through every subsequent step:
106
+ - `REPO_SLUG` (e.g. `my-org/my-service`)
107
+ - `PR_NUMBER`
108
+ - `PR_BRANCH` (from `gh pr view`)
109
+ - `PR_URL` = `https://github.com/<REPO_SLUG>/pull/<PR_NUMBER>`
110
+
111
+ **Depth:** explicit keyword `scan`, `medium`, or `deep` wins. If absent, run
112
+ `gh pr view <PR_NUMBER> --repo <REPO_SLUG> --json additions,deletions,changedFiles`
113
+ and apply AUTO-DEPTH:
114
+ - `scan` if additions+deletions < 150 AND changedFiles <= 5
115
+ - `deep` if additions+deletions > 800 OR changedFiles > 25 OR diff touches
116
+ `migrations/` or `*.sql`
117
+ - `medium` otherwise
118
+
119
+ State the chosen depth (and whether it was auto-selected) in the review header.
120
+
121
+ **`--post` flag:** parse and store as `POST_REVIEW=true`.
122
+
123
+ **`--fix` flag:** parse and store as `FIX_MODE=true`. Fix mode needs a real
124
+ checkout, so `--fix` forces Track A (worktree setup) to run even when
125
+ depth=scan. If the user did NOT pass `--fix`, leave `FIX_MODE=false` for now -
126
+ Step 4 offers it after the review is printed.
127
+
128
+ **`--no-artifact` flag:** parse and store as `ARTIFACT=false` (default true).
129
+ Skips Step 3.5 (living review artifact) silently.
130
+
131
+ **Re-review detection:** run
132
+ `ls ~/code-reviews/*-pr-<PR_NUMBER>-<repo-short-name>.md 2>/dev/null | sort | tail -1`
133
+ to find the newest prior review for this PR (repo-short-name = last segment of
134
+ REPO_SLUG; keeps PR numbers from colliding across repos). If found, grep it for
135
+ `\*\*Head:\*\*` and extract the short sha. Set `PREV_SHA=<sha>` and
136
+ `PREV_REVIEW_FILE=<path>`. If no Head line exists in the file (older format),
137
+ treat as a full review and leave PREV_SHA unset. Also grep the same file for
138
+ `\*\*Artifact:\*\*` and set `PREV_ARTIFACT_URL=<url>` (null when absent) - Step
139
+ 3.5 republishes to the SAME url so the artifact stays a living page for this PR.
140
+
141
+ ---
142
+
143
+ ## Depth gate
144
+
145
+ | Step | scan | medium | deep |
146
+ |-----------------------------|-----------------------|---------------------|----------------------------|
147
+ | Context: issue-tracker/CI/diff/existing-reviews | always | always | always |
148
+ | Context: chat/docs/framework-docs/monitoring/prior-review-memory (optional, MCP-dependent) | skip | included | included + broader recall |
149
+ | Worktree + static checks | skip (WORKTREE_PATH=null) unless `--fix` | included | included |
150
+ | Review agents | 2 triage (haiku) | 5 specialists (sonnet) | 5 specialists (sonnet) |
151
+ | Per-finding verification | none | Criticals only (hard rules exempt) | Criticals + Importants (hard rules exempt) |
152
+ | Completeness critic | skip | skip | included |
153
+ | Proof-of-bug (failing test per Critical) | skip | included (max 5) | included (max 5) |
154
+ | Living review artifact | included | included | included |
155
+ | Housekeeping (optional memory/notes writeback) | skip | included | included |
156
+ | `--post` | supported | supported | supported |
157
+ | `--fix` / fix offer | supported (forces worktree) | supported | supported |
158
+
159
+ For scan: note `⚡ scan - worktree unavailable, static checks skipped` in the
160
+ review header. When `--fix` forced the worktree at scan depth, drop that note
161
+ and say `⚡ scan - worktree created for --fix` instead.
162
+
163
+ ---
164
+
165
+ ## Step 1 - Context + worktree (concurrent)
166
+
167
+ Fire both tracks in the same turn.
168
+
169
+ ### Track A - worktree setup (skip when depth=scan, unless `--fix`)
170
+
171
+ Run via Bash with `run_in_background`:
172
+
173
+ ```bash
174
+ ${CLAUDE_PLUGIN_ROOT}/scripts/setup-worktree.sh \
175
+ <REPO_SLUG> <PR_BRANCH> <scratchpad>/worktree.json [PREV_SHA]
176
+ ```
177
+
178
+ On completion, read `worktree.json`. Keys emitted:
179
+ `worktreePath`, `repoRoot`, `headSha`, `headShaShort`, `tscTail`,
180
+ `tscChangedTail`, `tscErrorCount`, `eslintTail`, `eslintScope`, `changedFiles`,
181
+ `baseRef`, `projectRules`, `deltaFile`, `notes`.
182
+
183
+ Static checks are scoped so you can tell this PR's errors from the repo's
184
+ standing debt - do not try to infer that from the raw tail:
185
+
186
+ - `eslintTail` is the result of linting only `changedFiles` (`eslintScope` says
187
+ `changed-files`). Everything in it belongs to this PR. When `eslintScope` is
188
+ `full-fallback`, base-ref detection failed and the lint is repo-wide again -
189
+ in that case treat its contents as unattributed and say so rather than
190
+ blaming the author.
191
+ - `tscTail` is the raw repo-wide tail (tsc needs the whole program, so it cannot
192
+ be scoped). `tscChangedTail` holds only the errors in files this PR touched -
193
+ that is the attributable set. `tscErrorCount` is the repo-wide total; a large
194
+ count with an empty `tscChangedTail` means pre-existing debt, not a finding.
195
+ - If your stack doesn't use tsc/eslint, adapt `setup-worktree.sh`'s static
196
+ check step to your language's compiler/linter equivalents.
197
+
198
+ A failing CI build or test = Critical finding input.
199
+
200
+ When depth=scan: set `WORKTREE_PATH=null` without launching the script - unless
201
+ `FIX_MODE=true`, in which case run the script anyway (fix mode cannot edit code
202
+ from a diff).
203
+
204
+ ### Track B - metadata and signals (all calls fired in parallel)
205
+
206
+ Run ALL of the following in the same message. Full query details are in
207
+ `references/context-gathering.md` - follow it, do not paste it wholesale into
208
+ agent contexts.
209
+
210
+ - `gh pr view <PR_NUMBER> --repo <REPO_SLUG>` with fields: `number`, `title`,
211
+ `body`, `author`, `headRefName`, `baseRefName`, `labels`, `linkedBranches`,
212
+ `mergeStateStatus`, `additions`, `deletions`, `changedFiles`, `isDraft`,
213
+ `headRefOid`. Extract `headRefOid` (full sha) and `headShaShort` (first 7).
214
+ - Title/ticket-prefix check (if `house-rules.md` defines one): scan commit log
215
+ for the ticket pattern; set `PR_TITLE_ISSUE` and `RECOMMENDED_PREFIX`.
216
+ - `gh pr diff <PR_NUMBER> --repo <REPO_SLUG> > <scratchpad>/pr.diff` - fetched
217
+ ONCE; all agents read this file via `DIFF_FILE`.
218
+ - `gh pr checks <PR_NUMBER> --repo <REPO_SLUG>`
219
+ - `gh pr reviews <PR_NUMBER> --repo <REPO_SLUG>` and review comments
220
+ - Issue-tracker lookup (Linear/Jira/GitHub Issues MCP, if configured) per
221
+ ticket ID found in title/body/branch; collect ACs as numbered list (`acList`).
222
+ - (medium/deep only, optional) Chat search (Slack/Discord MCP, if configured):
223
+ PR-title keywords and ticket ID.
224
+ - (medium/deep only, optional) Docs search (Notion/Confluence/wiki MCP, if
225
+ configured): feature name or ticket title.
226
+ - (medium/deep only, optional, only when relevant) Framework/API docs MCP for
227
+ the specific framework or third-party API the diff touches.
228
+ - (medium/deep only, optional) Monitoring search (Sentry/Rollbar/etc. MCP, if
229
+ configured) for filenames or service names from the diff.
230
+ - (medium/deep only, optional) Prior-review-memory recall, if you maintain
231
+ such a system: patterns and false positives specific to this repo.
232
+
233
+ ### Assemble CONTEXT_FILE
234
+
235
+ Write `<scratchpad>/context.json` with keys:
236
+
237
+ ```json
238
+ {
239
+ "acList": "<numbered ACs from your issue tracker, or empty>",
240
+ "projectRules": "<worktree.json projectRules + any recalled review patterns appended under '## Recalled patterns'>",
241
+ "sentrySignals": "<monitoring issue summaries, or null>",
242
+ "ciStatus": "<passing | failing: <names> | pending | N/A>",
243
+ "existingReviews": "<prior review summaries>",
244
+ "deltaFile": "<worktree.json deltaFile, or null>",
245
+ "houseRulesFile": "${CLAUDE_PLUGIN_ROOT}/references/house-rules.md"
246
+ }
247
+ ```
248
+
249
+ Agents read keys from this file. Nothing from CONTEXT_FILE is pasted into
250
+ their prompts wholesale - the workflow script delivers it by path.
251
+
252
+ ---
253
+
254
+ ## Step 2 - Workflow (review + verify + critic)
255
+
256
+ Invoke the Workflow tool:
257
+
258
+ ```
259
+ scriptPath: ${CLAUDE_PLUGIN_ROOT}/workflow.js
260
+ args: {
261
+ repoSlug,
262
+ prNumber,
263
+ prUrl,
264
+ depth,
265
+ diffFile: "<scratchpad>/pr.diff",
266
+ contextFile: "<scratchpad>/context.json",
267
+ worktreePath: <null for scan, else from worktree.json>,
268
+ promptDir: "${CLAUDE_PLUGIN_ROOT}/references/agents",
269
+ prevSha: <null unless re-review>
270
+ }
271
+ ```
272
+
273
+ The workflow runs three phases:
274
+
275
+ - **Review:** scan uses `[triage-quality, triage-logic]` on `haiku`; medium/deep
276
+ use 5 specialists (quality, implementation, simplification, conventions,
277
+ test-quality) on `sonnet`. Agents receive DIFF_FILE + CONTEXT_FILE by path.
278
+ All reviewers run to completion before verification starts.
279
+ - **Dedup:** findings are merged across dimensions on `file:line` + title
280
+ token-similarity, so one issue found by three agents is verified once, not
281
+ three times. A merge keeps the highest severity and the longest
282
+ description/badCode/fix of the set - a Critical is never demoted by an
283
+ Observation someone else filed at the same line - and records every
284
+ contributing dimension in `agreedBy`.
285
+ - **Verify:** scan verifies nothing; medium verifies Criticals; deep verifies
286
+ Criticals + Importants. Hard-rule findings (`rule` set) are always exempt.
287
+ Each verifier runs the five-challenge adversarial refutation from
288
+ `references/agents/verifier.md` against one finding, returns
289
+ `{verdict, newSeverity?, reasoning}`.
290
+ - **Critic (deep only):** completeness critic gets the full deduped finding
291
+ list + DIFF_FILE; its findings go through verifier agents before promotion.
292
+ - **Prove (medium/deep, worktree required):** each non-hard-rule Critical gets
293
+ one prover agent (`references/agents/prover.md`, sonnet, max 5) that writes a
294
+ test asserting the CORRECT behavior, runs it in the worktree, and captures it
295
+ failing because of the bug. The proof rides on the finding as
296
+ `proof: {attempted, proven, reason, testCode?, testCommand?, redOutput?}`.
297
+ A proof that comes back GREEN (code behaved correctly) is counter-evidence -
298
+ Step 3 must downgrade or explicitly justify the finding, never ignore it.
299
+ Hard-rule findings are never proved (policy violations have no failing test).
300
+
301
+ Findings have schema:
302
+ `{file, line, severity, title, description, badCode, fix, rule?, precedent?, agreedBy?, verifierReasoning?, proof?}`
303
+ `badCode` and `fix` are schema-required: an empty string is allowed only on
304
+ `observation` / `idiomatic` findings.
305
+
306
+ Model tiers: triage on `haiku`, specialists on `sonnet`, verifiers + critic +
307
+ provers on `sonnet`, housekeeping on `haiku`. Only the synthesis in Step 3 runs
308
+ on the session model.
309
+
310
+ Return value from the workflow:
311
+ `{findings, droppedCount, downgradedCount, hardRuleCount, proveAttemptCount, provenCount, agentCount, outputTokens, turnTokensTotal}`
312
+ `outputTokens` is this workflow's own output spend; `turnTokensTotal` is the
313
+ whole turn's shared pool (main loop included).
314
+
315
+ Wait for the workflow to complete before proceeding to Step 3.
316
+
317
+ ---
318
+
319
+ ## Step 3 - Synthesize and output
320
+
321
+ **Mindset:** the author's name is not evidence. Bot review scores are not
322
+ anchors. Apply your own judgment to every finding.
323
+
324
+ **Do NOT flag:**
325
+ - Style preferences or naming taste where no convention is violated
326
+ - Comment wording choices
327
+ - Scenarios requiring multiple simultaneous unrealistic failures
328
+ - Tiny DRY opportunities (2-3 duplicated lines)
329
+ - Pre-existing code not touched by this diff
330
+ - Anything you are not confident about - omit rather than hedge
331
+
332
+ **Idiomatic & Consistency exception:** the conventions agent raises non-blocking
333
+ suggestions ONLY when a concrete better pattern provably already exists in the
334
+ codebase. Never on taste alone. These land in their own section, not in
335
+ Critical/Important. A finding without a cited precedent from the codebase is
336
+ dropped.
337
+
338
+ **Format** the review per `references/output-format.md` (read it now). Key
339
+ requirements:
340
+
341
+ - Header must include `**Head:** <headShaShort>` (enables future delta mode).
342
+ - When `isDraft=true`: add `**DRAFT PR** - findings recorded for when this
343
+ is ready to merge.` after the header block.
344
+ - When `mergeStateStatus` is not CLEAN: note it (e.g. conflicts, failing
345
+ required checks).
346
+ - When `PR_TITLE_ISSUE=true`: insert the `⛔ CANNOT MERGE` block before the
347
+ Summary.
348
+ - When `sentrySignals` is non-empty: include `## 🔥 Production Signals`.
349
+ - When `PREV_SHA` is set: include `## 🔁 Since last review` comparing
350
+ `PREV_REVIEW_FILE` findings against the new head - list each as fixed or
351
+ still open, before any new findings.
352
+ - Test Quality section: populate from the test-quality agent's fields
353
+ (`coverageVerdict`, `mutationSlip`, `mockSmells`).
354
+ - Idiomatic section: populated from severity=idiomatic findings only.
355
+ - **💰 Review Cost block:** `outputTokens` from the workflow return is the
356
+ ACTUAL output spend of the review workflow's own agents. `turnTokensTotal` is
357
+ the whole turn's shared pool - report it separately, never as the workflow's
358
+ cost. Input tokens are estimated (diff tokens x agent passes + context
359
+ + prompt files). Use the pricing table in `references/output-format.md`.
360
+ Real numbers only - no `<N>` placeholders.
361
+
362
+ **Save the review:**
363
+
364
+ ```bash
365
+ mkdir -p ~/code-reviews
366
+ REVIEW_FILE=~/code-reviews/$(date +%Y-%m-%d)-pr-<PR_NUMBER>-<repo-short-name>.md
367
+ # write the review to $REVIEW_FILE
368
+ ```
369
+
370
+ After writing, re-read the file and emit a receipt:
371
+ `✓ Review saved -> <path>`
372
+
373
+ Also write the workflow's `findings` array verbatim to
374
+ `<scratchpad>/findings.json` - fix mode reads its selection from there (the
375
+ `proof` objects ride along for the Step 5b proof flip), and it is the receipt
376
+ that what was reported equals what was found.
377
+
378
+ Then print the full review as the response.
379
+
380
+ ---
381
+
382
+ ## Step 3.5 - Living review artifact (skip when ARTIFACT=false)
383
+
384
+ Immediately after printing the review, follow `references/artifact-page.md`:
385
+ launch ONE background sonnet agent that renders the review as a self-contained
386
+ HTML page and publishes it via the Artifact tool - passing `PREV_ARTIFACT_URL`
387
+ when set, so a re-review UPDATES the same page instead of minting a new URL.
388
+ The page is the living version of the review: verdict header, since-last-review
389
+ timeline, findings with proof panels, all private by default.
390
+
391
+ Never block on it: the printed review and the saved file are the deliverable;
392
+ the artifact is an enhancement. When the URL comes back, append/refresh the
393
+ `**Artifact:** <url>` header line in the saved review file (re-read to confirm)
394
+ and print one line: `🔗 Living review: <url>`.
395
+
396
+ ---
397
+
398
+ ## Step 4 - Fix mode (after the review is printed)
399
+
400
+ ### Trigger
401
+
402
+ - `FIX_MODE=true` (the user passed `--fix`) -> go straight to
403
+ `references/fix-mode.md`.
404
+ - `FIX_MODE=false` and at least one Critical or Important finding has a `fix`
405
+ field -> ask once, via AskUserQuestion:
406
+
407
+ > Apply these fixes to the PR branch?
408
+ > - **Critical + Important** (N findings) - fix agents edit the worktree,
409
+ > verified, committed; push needs your confirmation
410
+ > - **Critical only** (N findings)
411
+ > - **No, review only**
412
+
413
+ Set `FIX_MODE=true` and `FIX_SCOPE=<critical+important | critical>` from the
414
+ answer. On "No", skip to Step 5.
415
+ - No fixable findings, or the review found nothing -> do not ask. Say
416
+ `nothing to auto-fix` in one line and skip to Step 5.
417
+ - **Unattended run** (cron, `/loop`, background agent): never ask. Run fix mode
418
+ only when `--fix` was passed explicitly, and stop before pushing.
419
+
420
+ ### Procedure
421
+
422
+ Read `references/fix-mode.md` and follow it. Shape of the run:
423
+
424
+ 1. Preconditions: worktree exists + clean, `origin/<PR_BRANCH>` still at
425
+ `headSha`, PR open, head repo writable.
426
+ 2. Select eligible findings (Critical/Important with a `fix`, real file,
427
+ non-generated). Never auto-fix Observation, Idiomatic, or a title/process rule.
428
+ 3. Invoke the fix workflow:
429
+ ```
430
+ scriptPath: ${CLAUDE_PLUGIN_ROOT}/fix-workflow.js
431
+ args: { repoSlug, prNumber, worktreePath, diffFile, contextFile, promptDir,
432
+ findings: [<selected findings verbatim>] }
433
+ ```
434
+ One `sonnet` fix agent per file (never two on the same file), then a
435
+ read-only `sonnet` fix-verifier per file reading the actual `git diff`. One
436
+ retry max on a non-`good` verdict.
437
+ 4. Revert every group the verifier did not pass.
438
+ 5. Run `scripts/verify-fixes.sh <WORKTREE_PATH> <scratchpad>/fix-verify.json tests`
439
+ and diff the output against the baseline `tscTail`/`eslintTail` from
440
+ worktree.json. Newly introduced errors -> revert that group.
441
+ 5b. Proof flip: for findings with `proof.proven`, re-run the captured failing
442
+ test after the fix. Still red -> the fix did not fix the bug: revert the
443
+ group even if the fix-verifier said `good`. An executed test outranks an
444
+ agent's opinion. Green -> record `proofFlip: green` in the status table.
445
+ 6. Commit one commit per file with an explicit `git add -- <files>`.
446
+ 7. Push ONLY after the user confirms, with `git push origin HEAD:refs/heads/<PR_BRANCH>`
447
+ and a re-fetch sha guard. Never force, never rebase, never push to
448
+ main/master/staging/develop. Verify via `gh pr view --json headRefOid`.
449
+ 8. Print the per-finding status table and append `## 🔧 Fixes applied` to the
450
+ saved review file.
451
+
452
+ Fix-agent tokens are additional spend: add a `Fix agents:` line to the
453
+ `## 💰 Review Cost` block.
454
+
455
+ ---
456
+
457
+ ## Step 5 - Post-review (after the review and any fixes)
458
+
459
+ ### If POST_REVIEW=true
460
+
461
+ Follow `references/github-post.md`:
462
+ - Build a JSON payload with Critical + Important findings as inline comments
463
+ (only for lines present in the diff hunks).
464
+ - POST via `gh api repos/<REPO_SLUG>/pulls/<PR_NUMBER>/reviews` with NO
465
+ `event` field (creates PENDING, visible only to you).
466
+ - Verify post-condition: fetch review list, confirm PENDING state exists.
467
+ - Print count + link.
468
+ - Observation and Idiomatic findings go in the review body, never inline.
469
+ - Never submit the review programmatically.
470
+ - When fix mode applied and committed a finding, EXCLUDE it from the inline
471
+ comments - do not ask for a change you already made. Mention the applied
472
+ fixes in one line of the review body instead.
473
+
474
+ ### Housekeeping (skip when depth=scan, optional)
475
+
476
+ If you maintain a persistent notes/memory system across reviews, launch ONE
477
+ background Agent with `model: 'haiku'`, passing the review file path +
478
+ repo-short-name + PR author login, instructed to follow
479
+ `references/post-review.md` if you've written one for your own setup:
480
+ - Log durable patterns (recurring findings, confirmed false positives) scoped
481
+ to the repo, never to the author.
482
+ - Skip entirely if you have no such system — nothing else in this skill
483
+ depends on it.
484
+
485
+ ### Cleanup (when a worktree was created)
486
+
487
+ **Fix-mode override:** if fix mode produced commits that were NOT pushed, do
488
+ NOT clean up. Keep the worktree and the repo clone, print the worktree path and
489
+ the exact push command. Deleting it destroys the only copy of the work. Clean up
490
+ normally when the push succeeded or nothing was committed.
491
+
492
+ ```bash
493
+ git -C <repoRoot> worktree remove --force <worktreePath> \
494
+ || rm -rf <worktreePath>
495
+ git -C <repoRoot> worktree prune
496
+ ```
497
+
498
+ If `repoRoot` starts with `/tmp/lekker-clone-`, also remove that clone dir.
499
+ Remove the delta file if `deltaFile` was set in worktree.json. Verify with
500
+ `git -C <repoRoot> worktree list` that no `lekker-review` entries remain.
501
+
502
+ ---
503
+
504
+ ## Failure rules
505
+
506
+ Two identical failures = stop and diagnose, don't loop blindly.
507
+
508
+ If the Workflow tool is unavailable or the run dies: fall back to launching the
509
+ 5 agents via the Agent tool with the same prompt files, do verification inline
510
+ per `references/agents/verifier.md`, and state this fallback in the review
511
+ output under a `**Note:** Workflow tool unavailable - ran agents directly`
512
+ line in the header.
513
+
514
+ Fix-mode specific:
515
+ - Never claim a fix landed without a `git log` / `git status` receipt from the
516
+ worktree. The review's proposed `fix` text is not an applied fix.
517
+ - Never push without explicit confirmation, and never force-push or rebase a
518
+ PR branch. If the branch moved under you, stop and report - the commits stay
519
+ local.
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "olko-lekker-review",
3
+ "description": "FAANG-quality PR code review: isolated worktree checkout, context gathering from your issue tracker/chat/docs/CI/monitoring, 5 parallel specialist review agents, adversarial finding verification, proof-of-bug tests for Criticals, and an optional --fix mode that applies and commits its own findings.",
4
+ "skills": "./skills"
5
+ }