@mrciphersmith/keryx 0.4.28 → 0.4.29

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 (32) hide show
  1. package/dist/cli.js +2710 -2488
  2. package/dist/core.js +5 -5
  3. package/dist/keryx-general-worker-entry.js +335 -219
  4. package/package.json +1 -1
  5. package/src/gdskills/bundled/install-manifest.json +1 -0
  6. package/src/gdskills/bundled/rules/core/clean-architecture.mdc +25 -153
  7. package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +1 -0
  8. package/src/gdskills/bundled/rules/core/error-handling.mdc +57 -108
  9. package/src/gdskills/bundled/rules/core/skill-authoring.mdc +190 -0
  10. package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +5 -0
  11. package/src/gdskills/bundled/rules/core/solid-principles.mdc +48 -123
  12. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +2 -2
  13. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +1 -1
  14. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +1 -1
  15. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +3 -5
  16. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +100 -421
  17. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +2 -2
  18. package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +1 -1
  19. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +1 -1
  20. package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +4 -5
  21. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +1 -1
  22. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +1 -1
  23. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +2 -3
  24. package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +1 -1
  25. package/src/gdskills/bundled/skills/review/review-premise/SKILL.md +1 -1
  26. package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +1 -1
  27. package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +1 -1
  28. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +32 -36
  29. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +1 -1
  30. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/patterns.mdc +4 -3
  31. package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/coding-style.mdc +3 -3
  32. package/src/gdskills/bundled/stacks/ruby-rails/rules/coding-style.mdc +4 -4
@@ -18,7 +18,7 @@ triggers:
18
18
  - "Uncle Bob review"
19
19
  metadata:
20
20
  author: "MrCipherSmith"
21
- version: "1.2.0"
21
+ version: "2.0.0"
22
22
  category: "review"
23
23
  compatible_harnesses: "cursor,codex,zed,opencode,claude"
24
24
  license: "MIT"
@@ -26,50 +26,38 @@ license: "MIT"
26
26
 
27
27
  # Review: Clean Code + SOLID
28
28
 
29
- Specialized reviewer for **Clean Code principles** (Robert C. Martin) and **SOLID** at the
30
- function and class level. Focuses on code in the current branch diff only. Its inputs are the reviewer payload only; session memory and earlier conversation are not inputs. It runs no command unless its payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where its host gives a read-only child git (keryx shell does not: there the payload supplies the history), and the read-only layer commands the orchestrator lists (`keryx gdgraph affected|find`, `keryx test related`, `keryx wiki ask`, `keryx memory search`, `keryx ctx rg|read`); it never writes in the reviewed tree.
29
+ You know Clean Code and SOLID. This file does not teach them. It says which
30
+ project standard applies, where the project departs from the textbook, and how
31
+ to turn what you see into a finding or into silence.
31
32
 
32
- The goal is not stylistic nitpicking — every finding here points to a concrete
33
- maintainability, readability, or extensibility problem that will cause friction
34
- as the codebase grows.
33
+ Focus: maintainability of the code this change introduces, at function and class
34
+ level. Its inputs are the reviewer payload only; session memory and earlier
35
+ conversation are not inputs. It runs no command unless its payload's
36
+ `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and
37
+ `git show` where its host gives a read-only child git (keryx shell does not:
38
+ there the payload supplies the history).
35
39
 
36
- ---
37
-
38
- ## Workflow
39
-
40
- ```
41
- Clean Code Review Progress:
42
- - [ ] Step 1: Read Job Context (if provided)
43
- - [ ] Step 2: Determine git scope (merge-base)
44
- - [ ] Step 3: Collect diff and changed file list
45
- - [ ] Step 4: Meaningful Names check
46
- - [ ] Step 5: Functions check (size, abstraction, arguments)
47
- - [ ] Step 6: Comments check
48
- - [ ] Step 7: Error Handling check
49
- - [ ] Step 8: DRY check
50
- - [ ] Step 9: SOLID check (SRP, OCP, LSP, ISP, DIP)
51
- - [ ] Step 10: Emit findings in unified format
52
- ```
53
-
54
- ---
40
+ ## The standard
55
41
 
56
- ## Input Contract
42
+ Read both rules before the diff. They are what the code was written against.
57
43
 
58
- | Field | Type | Required | Description |
59
- |-------|------|----------|-------------|
60
- | `branch` | string | no | Branch to review. Defaults to current branch. |
61
- | `commit_range` | string | no | Explicit hash or range. Overrides merge-base detection. |
62
- | `context_doc` | string | no | Path to job context document. Read before reviewing. |
44
+ - `.metaproject/rules/core/solid-principles.mdc` — the **Thresholds** table and the SOLID rules.
45
+ - `.metaproject/rules/core/error-handling.mdc` — how failure is signalled, what a message carries, `cause`, silent catches.
63
46
 
64
- ---
47
+ A threshold there is your threshold. Under it, report nothing; never apply a
48
+ stricter textbook number. Where this file and a rule disagree, the rule wins.
65
49
 
66
- ## Scope Detection
50
+ ## Scope
67
51
 
68
- See shared script: `.metaproject/skills/gdskills/shared/git-merge-base.md`
52
+ Only code introduced or modified in this change.
69
53
 
70
- Review scope: **only code introduced or modified in this branch since merge-base**.
71
- Pre-existing problems in unchanged lines are out of scope unless a change directly
72
- worsens them.
54
+ **Debt the change did not create.** A threshold counts only when this change
55
+ crosses it. Check the before-state (diff context or base file) first. One more of
56
+ the same on code already over the line is not a finding: a line added to a
57
+ function already past the length threshold, another copy of a literal already
58
+ copied 3+ times, another parameter on a signature already at 4+. It is a finding
59
+ when the change crosses from under to over, or when the diff adds a
60
+ self-contained block that meets the threshold on its own — cite that block.
73
61
 
74
62
  **Supplied text first.** When the payload carries `slices`, `context_files`, `diff` or `file_contents`, review exactly that text and never rebuild the diff. A choice's history (law 4) is read with `git log`, `git blame` and `git show` only where the host gives a read-only child git; on keryx shell a read-only child has no shell and no git tool, so read the `git log -L`/`git blame` excerpts the payload supplies, or say the history was not read. Only with none supplied, collect it:
75
63
  ```bash
@@ -77,8 +65,6 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
77
65
  # explicit range: <FROM_SHA>..<TO_SHA> in place of "${BASE_SHA}"
78
66
  ```
79
67
 
80
- ---
81
-
82
68
  ## Iron Laws
83
69
 
84
70
  ### Shared laws (every reviewer)
@@ -95,319 +81,74 @@ boundary is the trigger-and-outcome test.
95
81
 
96
82
  ### Clean Code laws
97
83
 
98
- 1. **Findings without a specific `file:line` from the diff are not valid findings.** Never cite general observations about the codebase.
99
- 2. **A naming issue is `minor`.** It reaches `major` only when the name has
100
- already produced an observable wrong outcome at a call site you can name — a
101
- caller misusing the API because of what it is called. "A future reader might
102
- misread it" is the maintenance cost that makes it `minor`, not a trigger.
103
- Naming is never a `blocker`. (`review-style` carries the identical rule.)
104
- 3. **DRY violations need at least 3 repetitions before they are worth reporting,
105
- and they are `minor`.** Two occurrences can be accidental; three is a pattern.
106
- Duplication is a cost to whoever edits it next, which is `minor` by the
107
- canonical test — report it once, listing every site, per shared law 3.
108
- 4. **SOLID opinions without a named principle and a concrete violation description are `info` only.** State the principle (e.g., SRP), the two responsibilities, and the impact.
109
- 5. **Do not flag language idioms or framework conventions as Clean Code violations.** If it is the standard way to do something in TypeScript / NestJS / React, it is not a violation.
110
-
111
- ---
112
-
113
- ## Review Checklist
114
-
115
- ### Part A: Meaningful Names
116
-
117
- The central test: **a name should tell you why it exists, what it does, and how it is used** — without needing a comment to explain it.
118
-
119
- #### A1. Intention-Revealing Names
120
-
121
- - [ ] Variable / parameter names that require a comment to understand their purpose
122
- - [ ] Single-letter names outside loop counters (`i`, `j`, `k`) and conventional math variables
123
- - [ ] Generic names that carry no information: `data`, `info`, `value`, `temp`, `result`, `obj`, `item`, `thing`, `stuff`, `helper`, `util`, `manager`, `processor`
124
- - [ ] Boolean names that could be read as either true or false: prefer `isLoaded`, `hasError`, `canSubmit` over `loaded`, `error`, `submit`
125
- - [ ] Function names that start with a vague verb: `do`, `handle`, `process`, `manage` — prefer verbs that describe the action: `parseConfig`, `validateToken`, `fetchUserById`
126
-
127
- Flags:
128
- - Single-letter variable outside loop — **minor**
129
- - Generic meaningless name (`data`, `result`, `temp`) in new code — **minor**
130
- - Boolean named without `is/has/can/should` prefix making polarity ambiguous — **minor**
131
- - Function named `handleX` where X is also vague — **minor**
132
-
133
- #### A2. Searchability and Length
134
-
135
- - [ ] Names that are too short to be grepped: single letters or two-letter abbreviations for non-obvious concepts
136
- - [ ] Names that are too long (>40 characters) adding noise without precision: prefer concise + precise over exhaustive
137
- - [ ] Abbreviations that are not project-wide standards (`usr` for `user`, `cnt` for `count`, `cfg` for `config`)
138
-
139
- Flags:
140
- - Non-standard abbreviation that a new team member would need to decode — **minor**
141
-
142
- #### A3. Consistent Vocabulary
143
-
144
- - [ ] Same concept named differently in the same diff: `user` / `account` / `member` used interchangeably for the same domain entity
145
- - [ ] Verb inconsistency for similar actions: `fetch` vs `get` vs `load` vs `retrieve` for the same type of operation in the same module
146
- - [ ] Antonym inconsistency: if one side is `add`, the other should be `remove` — not `delete` / `destroy` / `clear`
147
-
148
- Flags:
149
- - Two names for the same concept in the same diff — **minor**
150
-
151
- ---
152
-
153
- ### Part B: Functions
154
-
155
- #### B1. Function Size and Single Responsibility
156
-
157
- Clean Code guideline: functions should do **one thing** at one level of abstraction.
158
-
159
- - [ ] Function body exceeds ~20 lines: a strong smell that it does more than one thing
160
- - [ ] Function mixes levels of abstraction: high-level orchestration next to low-level data manipulation in the same block
161
- - [ ] Function that both queries data AND transforms it AND persists it (three responsibilities)
162
- - [ ] Functions with a `And` or `Or` in the name, describing two operations
163
-
164
- Flags:
165
- - Function body >40 lines — **minor** (clear overload; flag specific function by name)
166
- - Function body 20–40 lines with visible mixed abstraction — **minor**
167
- - `doXAndY()` naming explicitly stating two operations — **minor**
168
-
169
- #### B2. Function Arguments
170
-
171
- - [ ] Monadic (1 arg): ideal for transformations (`parseDate(str)`) and predicates (`isEmpty(list)`)
172
- - [ ] Dyadic (2 args): acceptable when arguments form a natural ordered pair (`createPoint(x, y)`)
173
- - [ ] Triadic (3 args): consider if a config/options object would read more clearly
174
- - [ ] Polyadic (≥4 args): almost always a sign of a missing abstraction (config object, parameter object, or SRP violation)
175
- - [ ] Boolean flag arguments: `renderWidget(true, false, true)` — split into separate functions or use named option objects
176
- - [ ] Output arguments: a function that mutates its argument instead of returning a value (`populate(result)`)
177
-
178
- Flags:
179
- - Function with ≥4 parameters not using an options/config object — **minor**
180
- - Boolean flag parameter (`enabled: boolean`) passed to control function flow — **minor** (split into two functions)
181
- - Output argument (mutating parameter instead of returning) — **minor**
182
- - Three parameters where a plain named object would be clearer — **minor**
183
-
184
- #### B3. Abstraction Level Consistency
185
-
186
- Each function should stay at one level of the abstraction ladder. A function that opens a file, reads its bytes, decodes UTF-8, splits lines, and validates each record mixes at least 3 levels.
187
-
188
- - [ ] Inline low-level operations (string splitting, index arithmetic) inside a high-level orchestration function
189
- - [ ] High-level domain concepts (`createUserAccount`) containing raw SQL or HTTP fetch calls instead of delegating to a repository/service
190
-
191
- Flags:
192
- - High-level function with low-level implementation detail mixed in — **minor**
193
-
194
- ---
195
-
196
- ### Part C: Comments
197
-
198
- #### C1. Comments That Lie or Are Redundant
199
-
200
- - [ ] Comment that repeats what the code already says: `i++ // increment i`
201
- - [ ] Comment that is stale / no longer matches the current code
202
- - [ ] Commented-out code left in the diff
203
-
204
- Flags:
205
- - Redundant comment restating the code — **minor**
206
- - Stale comment contradicting the code — **minor** (misleads the next reader; it
207
- names no runtime trigger, so the canonical rubric puts it here. It was
208
- **major** in this file until that was reconciled against
209
- `review-orchestrator/SKILL.md` → **Severity (canonical)**, which reviewers may
210
- not override. If the comment's inaccuracy *causes* a defect — someone relied on
211
- it and the code does otherwise — that defect is the finding, at its own severity)
212
- - Commented-out code block — **minor** (use git history, not comments, to preserve old code)
213
-
214
- #### C1a. Documentation drift — the shapes worth searching for
215
-
216
- Stale comments are not found by reading comments; they are found by reading each
217
- comment **against the statement it sits above**. Three shapes recur, and they are
218
- the cheapest real findings in a multi-round review:
219
-
220
- - **A doc describing the rule a later round replaced.** A prop's JSDoc says the
221
- tooltip drops the split "unless both are known"; the live rule is that both must
222
- be greater than zero. The behaviour changed, the sentence did not. Check every
223
- doc comment on every symbol the diff touched, not only the ones the diff edited.
224
- - **A comment detached from its statement.** A `const` gets inserted between a
225
- comment and the expression it explained, so the comment now reads as an
226
- explanation of the insertion. The text is unchanged and is now wrong. Look for
227
- this wherever the diff adds a line inside an existing block.
228
- - **Two files documenting one field oppositely.** One says a cell is the valid
229
- percentage, another computes `100 - cell` and calls it the invalid percentage.
230
- Only one is right, and the diff just made the field load-bearing.
231
-
232
- Where an issue or PR is cited, check that it is the right one and still says what
233
- the comment claims — a closed *issue* cited in place of the *PR* that shipped the
234
- work sends the next reader to the wrong page.
235
-
236
- A comment that describes a behaviour with **no code path at all** — including one
237
- left behind by a review finding that was later withdrawn — is the same class: it
238
- should state the defensiveness it actually provides, not assert a path that does
239
- not exist.
240
-
241
- #### C2. Comments That Compensate for Bad Names
242
-
243
- A comment whose entire purpose is to explain a poorly-named identifier is a sign to improve the name, not add a comment.
244
-
245
- - [ ] `// This is the pipeline execution queue` explaining a variable named `queue2`
246
- - [ ] JSDoc `@param data The data to process` adding zero information
247
-
248
- Flags:
249
- - Comment exists only to explain a name that could be made self-documenting — **minor**
250
-
251
- #### C3. Comments That Are Justified
252
-
253
- These are the correct uses of comments — do NOT flag:
254
- - Legal comments (license headers)
255
- - Explanation of intent for a non-obvious algorithm or business rule
256
- - Clarification of a subtle domain constraint (`// ISO week starts on Monday per business requirement`)
257
- - Warning about consequences (`// Do not cache — response contains time-sensitive token`)
258
- - TODO/FIXME with an issue reference (`// TODO(#1234): remove after migration`)
259
-
260
- ---
261
-
262
- ### Part D: Error Handling
263
-
264
- #### D1. Error Types and Propagation
265
-
266
- - [ ] Returning `null` or `undefined` to signal failure instead of throwing or using a Result type — causes null propagation and eventual NPE
267
- - [ ] Swallowing exceptions: `catch (err) {}` with no logging or re-throw
268
- - [ ] Logging AND re-throwing the same error — double-logs across callers
269
- - [ ] Using error strings instead of typed errors: `throw new Error("NOT_FOUND")` — callers cannot pattern-match
270
- - [ ] `catch (err: any)` — loses type safety; use `catch (err: unknown)`
271
-
272
- Flags:
273
- - `catch` block with empty body or only a comment — **major** when a named failure is hidden from the caller (silent failure; conditions table), else **minor**
274
- - Returning `null` / `undefined` from a function to signal "not found" in a critical path — **minor**; **major** only with a named trigger where the caller then produces a wrong outcome
275
- - Log + rethrow in the same catch block — **minor**
276
- - Untyped error in catch — **minor**
277
-
278
- #### D2. Error Context
279
-
280
- - [ ] Re-throwing an error without wrapping context: `throw err` loses the call site information; prefer `throw new AppError("context", { cause: err })`
281
- - [ ] Generic `new Error("something went wrong")` — message must identify what went wrong and ideally what inputs caused it
282
-
283
- Flags:
284
- - Bare `throw err` re-throw losing context in a library/service boundary — **minor**
285
- - Generic error message with no context — **minor**
286
-
287
- ---
288
-
289
- ### Part E: DRY (Don't Repeat Yourself)
290
-
291
- #### E1. Code Duplication
292
-
293
- - [ ] Identical or near-identical code blocks in ≥3 places in the diff
294
- - [ ] Copy-pasted logic that differs only in one or two variable names
295
- - [ ] Multiple functions doing the same transformation with slightly different wrapping
296
-
297
- Flags:
298
- - 3+ identical or near-identical blocks in the diff that could be extracted — **minor** (Clean Code law 3; this lens owns duplication, `review-style` defers)
299
- - 2 occurrences — **minor** (note, do not raise unless the pattern is clearly intentional duplication)
300
-
301
- #### E2. Magic Numbers and Strings
302
-
303
- - [ ] Hardcoded numeric literal used in business logic with no named constant (`if (status === 3)`)
304
- - [ ] Repeated string literal used as a key, type discriminant, or route path without a shared constant
305
-
306
- Flags:
307
- - Magic number in business logic (not an obvious neutral like `0`, `1`, `100`) — **minor**
308
- - Repeated string constant defined inline in multiple places — **minor**
309
-
310
- ---
311
-
312
- ### Part F: SOLID (at function/class level)
313
-
314
- This overlaps with `review-architecture` at the system level, but here the focus is on
315
- **individual classes and functions**, not module structure or layer assignments.
316
-
317
- #### F1. Single Responsibility Principle (SRP)
318
-
319
- A class should have **one reason to change**: one owner (one part of the system that drives its evolution).
320
-
321
- - [ ] Class responsible for both data access AND business logic
322
- - [ ] Class responsible for both input validation AND output formatting
323
- - [ ] A constructor that does real work: making network calls, reading files, computing state — constructors should only assign
324
-
325
- Flags:
326
- - Class with two clearly distinct responsibilities that have different change drivers — **minor**
327
- - Constructor performing I/O or async operations — **minor**; **major** only with a named defect it causes (e.g. an unhandled rejection on construction)
328
- - Service method doing validation + transformation + persistence inline — **minor**
329
-
330
- #### F2. Open/Closed Principle (OCP)
331
-
332
- Classes should be open for extension, closed for modification. Violations appear as chains that must grow every time a new case is added.
333
-
334
- - [ ] `if/else if` or `switch` over a type discriminant that already has 3+ branches — consider a strategy/visitor pattern
335
- - [ ] Adding a case to an existing long `switch` in a file not in the diff context — flag if the diff shows a new `case` in a multi-case switch
336
-
337
- Flags:
338
- - New `case` added to a switch with ≥4 existing cases where a strategy pattern would be more appropriate — **minor**
339
- - `instanceof` chain (`if (x instanceof A) ... else if (x instanceof B)`) — **minor**
340
-
341
- #### F3. Liskov Substitution Principle (LSP)
342
-
343
- Subtypes must be substitutable for their base types without changing the program's behavior.
344
-
345
- - [ ] Subclass `override` method that throws `NotImplementedException` or `UnsupportedOperationException`
346
- - [ ] Subclass method that requires checking `instanceof this` to determine behavior
347
- - [ ] Override that strengthens preconditions (rejects more inputs than the parent)
348
- - [ ] Override that weakens postconditions (returns less than the parent guarantees)
349
-
350
- Flags:
351
- - Override throwing "not supported" — **minor**; **major** (or **blocker**) when a named call site reaches it through the base type (conditions table)
352
- - Override requiring `instanceof` self-check — **minor**, same condition as the line above
353
-
354
- #### F4. Interface Segregation Principle (ISP)
355
-
356
- Clients should not be forced to depend on methods they do not use.
357
-
358
- - [ ] Interface with ≥7 methods where implementing classes use only a subset — split into smaller interfaces
359
- - [ ] Abstract class method that all concrete subclasses implement as a no-op
360
-
361
- Flags:
362
- - Interface with methods that have stub/no-op implementations in subclasses — **minor**
363
-
364
- #### F5. Dependency Inversion Principle (DIP) — at class level
365
-
366
- High-level modules should not depend on low-level modules. Both should depend on abstractions.
367
-
368
- - [ ] Class instantiating its own dependencies with `new` instead of receiving them via constructor injection
369
- - [ ] Class importing a concrete implementation class from another module instead of an interface/abstract class
370
-
371
- Flags:
372
- - `new ConcreteService()` inside a class method that should receive it via DI — **minor**
373
- - Import of concrete implementation where an interface or abstract type exists — **minor**
374
-
375
- ---
84
+ 1. **Every finding cites a `file:line` in the diff.** No observations about the codebase in general.
85
+ 2. **A naming issue is `minor`.** It reaches `major` only when the name has already produced an observable wrong outcome at a call site you can name. Naming is never a `blocker`. (`review-style` carries the identical rule.)
86
+ 3. **Duplication needs 3+ copies and is `minor`**, reported once with every copy. This lens owns duplication and comments; `review-style` defers to it.
87
+ 4. **A SOLID finding names the principle, the two responsibilities or the broken contract, and the impact**, or it is `info`.
88
+ 5. **Language idioms and framework conventions are not violations.**
89
+
90
+ ## Decision table
91
+
92
+ Each row: what to look for, when it is a finding, and its default severity. Use
93
+ your own Clean Code judgment for anything not listed, but the same tests apply:
94
+ a named site, a threshold crossed by this change, a cost someone will pay.
95
+
96
+ | Signal | A finding when | Default | Not a finding |
97
+ |---|---|---|---|
98
+ | Failure paths: a hiding `catch`, failure as a value, lost `cause`, log-and-rethrow | per `error-handling.mdc` **Review severities** | as there | as there |
99
+ | Override that throws "not supported" or rejects base input | a named call site reaches it through the base type | `major`, or `blocker` on the crash/corruption outcome; else `minor` | — |
100
+ | Constructor doing I/O or async work | always | `minor`; `major` only with a named defect it causes | — |
101
+ | Function length | over 40 lines **and** two separable jobs or mixed abstraction levels | `minor` (name the jobs) | a long linear table, serializer, test or one-level sequence |
102
+ | I/O mixed with a transform | one function reads or writes (file, network, store) and transforms the data in between, at any length | `minor` (name the transform that should be a pure helper) | the transform already lives in a helper the I/O shell calls |
103
+ | Positional parameters | 4+, no options object, not a natural ordered set the codebase already uses | `minor` | — |
104
+ | Boolean flag parameter | it selects between two behaviours (`run(x, true)`) | `minor` | — |
105
+ | Output argument | a function fills a caller-supplied argument instead of returning | `minor` | — |
106
+ | Constructor dependencies | more than 5 | `minor` (name the two responsibilities) | — |
107
+ | Class or function with two change drivers | you can name both (e.g. validation + persistence) | `minor` | — |
108
+ | Branch chain over a type discriminant | 4+ branches, extended by the diff, and a map/strategy precedent exists (name it) | `minor` | no precedent in the codebase |
109
+ | Interface wider than its implementers | implementers leave methods as stubs/no-ops | `minor` | — |
110
+ | Business logic constructing its I/O, network or clock dependency | always | `minor` | a plain helper or value object built inside a module |
111
+ | Duplicated block | 3+ copies | `minor`, one finding listing every copy | 2 copies |
112
+ | Magic number / repeated string literal | business meaning, no named constant | `minor` | `0`, `1`, `100` and other neutral values |
113
+ | Name | needs a comment to be understood; generic (`data`, `result`, `temp`); two names for one concept in the diff; ambiguous boolean polarity | `minor` | loop counters; project-standard abbreviations |
114
+ | Comment | stale, contradicting the code; redundant; commented-out code; compensating for a bad name | `minor` | intent, a domain constraint, a warning, a TODO with an issue |
115
+ | Stylistic opinion; a future issue with no current violation | — | `info` | — |
116
+
117
+ ## Documentation drift — search for it
118
+
119
+ A stale comment is found by reading each doc comment **against the statement it
120
+ sits above**, for every symbol the diff touched, not only the lines it edited.
121
+ Three shapes recur and are the cheapest real findings:
122
+
123
+ - **A doc describing the rule a later change replaced.** The behaviour changed, the sentence did not.
124
+ - **A comment detached from its statement.** A line inserted between a comment and the expression it explained.
125
+ - **Two places documenting one field or behaviour oppositely**, or a comment asserting a code path that does not exist.
126
+
127
+ Where an issue or PR is cited, check it is the right one and still says what the comment claims.
376
128
 
377
129
  ## Scope Boundaries
378
130
 
379
- | Concern | This skill | Use instead |
380
- |---------|-----------|-------------|
381
- | Meaningful names, function size, DRY, comments, error handling | YES | — |
382
- | SOLID at function/class level | YES | — |
383
- | Layer violations, module coupling, dependency direction | NO | `review-architecture` |
384
- | Style: naming convention formatting (casing, prefix) | NO | `review-style` |
385
- | Logic bugs, off-by-one errors, null-safety | NO | `review-logic` |
386
- | Security vulnerabilities | NO | `review-security-code` |
387
- | Performance anti-patterns | NO | `review-performance` |
388
- | React/MobX-specific frontend patterns | NO | `review-frontend` |
389
-
390
- ---
131
+ | Concern | Use instead |
132
+ |---------|-------------|
133
+ | Layer violations, module coupling, dependency direction | `review-architecture` |
134
+ | Naming convention formatting (casing, prefix) | `review-style` |
135
+ | Logic bugs, off-by-one errors, null-safety | `review-logic` |
136
+ | Security vulnerabilities | `review-security-code` |
137
+ | Performance anti-patterns | `review-performance` |
138
+ | React/MobX-specific frontend patterns | `review-frontend` |
391
139
 
392
140
  ## Orchestrated Review Contract
393
141
 
394
142
  When dispatched by `review-orchestrator`, follow the provided `reviewer-input.schema.json` payload. Return a `REVIEW_RESULT` object compatible with `.metaproject/skills/gdskills/review/review-orchestrator/reviewer-finding.schema.json`, then a concise markdown summary. Keep findings evidence-based, include concrete `suggested_fix` for every blocker/major, and return `NEEDS_CONTEXT` instead of guessing when required context is missing.
395
143
 
396
- ---
397
-
398
144
  ## Finding Format
399
145
 
400
146
  ### Class scope — required for `blocker` and `major`
401
147
 
402
- Every `blocker` and `major` finding must carry `class_scope`: **every** site that
148
+ Every `blocker` and `major` finding carries `class_scope`: **every** site that
403
149
  holds the shape you found, and **how you enumerated them** — the grep or query
404
- you ran, or the guard that derives the set.
405
-
406
- A finding anchored to one `file:line` is a claim about one site. The recorded
407
- history of this repository is that a fix then repairs that site and leaves its
408
- siblings: one writer of five, one operator instruction of four, six readers of
409
- eight. Each was found by the *next* review round, which is why reviews here have
410
- run to seven and four rounds instead of one.
150
+ you ran, or the guard that derives the set. A fix to one site that leaves its
151
+ siblings is what the next review round finds.
411
152
 
412
153
  ```yaml
413
154
  class_scope:
@@ -415,49 +156,22 @@ class_scope:
415
156
  enumeration_method: "grep for the config-path resolvers; 7 writers, 2 unguarded"
416
157
  ```
417
158
 
418
- "I checked the others" is not an enumeration method. A single-entry `sites` list
419
- is a claim that the class has exactly one member — make it deliberately, because
420
- `review-finding.schema.json` accepts it and the next round tests it.
421
-
422
- `minor` and `info` may omit it: enumerating the class for every low-severity
423
- observation is theatre, not rigour.
159
+ "I checked the others" is not an enumeration method. `minor` and `info` may omit it.
424
160
 
425
161
  ```markdown
426
162
  ### [F-NNN] Title
427
163
 
428
164
  - **Severity**: blocker | major | minor | info
429
165
  - **File**: path/to/file.ts:line
430
- - **Principle**: Clean Code — Meaningful Names A1 | SOLID — SRP F1 | etc.
166
+ - **Principle**: Clean Code — names | function design | comments | error handling | DRY | SOLID — SRP/OCP/LSP/ISP/DIP
431
167
  - **Problem**: what is wrong and why it matters
432
168
  - **Fix**: concrete actionable suggestion
433
- - **Patch** (optional):
434
- ```diff
435
- - old line
436
- + new line
437
- ```
438
169
  ```
439
170
 
440
- Severity comes from **Severity (canonical)** in `review-orchestrator/SKILL.md`.
441
- This reviewer keeps no table of its own; what follows is where its recurring
442
- conditions land under that rubric, not a second rubric.
443
-
444
- | Condition | Severity | Why, under the canonical rubric |
445
- |---|---|---|
446
- | Swallowed exception hiding a failed operation | `major` — `blocker` only if the caller then persists or returns wrong data | Same wording as `review-logic`, deliberately. Silent failure is wrong behaviour; corruption is a different shape |
447
- | LSP violation that produces a wrong result or a crash at a named call site | `major`, or `blocker` on the crash/corruption outcome | The outcome decides, not the principle's name |
448
- | Constructor performing I/O | `minor` — `major` only with a named defect it causes (trigger and outcome) | The I/O running is not wrong behaviour; untestable is a maintenance cost |
449
- | Function > 40 lines; ≥ 4 parameters without an options object; boolean flag argument; class with two distinct responsibilities; `new ConcreteService()` bypassing DI | `minor` | The code is correct. The cost is to whoever reads or edits it next — that is exactly `minor` |
450
- | Poor naming; redundant or stale comment; duplication (3+ sites); magic number; 20–40 line function; OCP/ISP smell; log-and-rethrow | `minor` | Same. This lens owns duplication and comments; `review-style` defers to it |
451
- | Stylistic opinion; a future issue with no current violation | `info` | Neither trigger nor a named maintenance cost |
452
-
453
- **Clean Code findings are `minor` by default.** A long function with a named
454
- responsibility split is a maintenance cost, not observable wrong behaviour, and
455
- `major` is reserved for findings that name a trigger and an outcome. This
456
- reviewer previously called a 41-line function `major` and thereby forced
457
- `REQUEST_CHANGES` on it; that is the exact mis-ranking the canonical rubric
458
- exists to stop.
459
-
460
- ---
171
+ Severity comes from **Severity (canonical)** in `review-orchestrator/SKILL.md`;
172
+ the Default column above is where this lens's conditions land under it, not a
173
+ second rubric. **Clean Code findings are `minor` by default**: a maintenance
174
+ cost, not wrong behaviour. `major` needs a named trigger and outcome.
461
175
 
462
176
  ## Output Contract
463
177
 
@@ -469,70 +183,35 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
469
183
  ## Clean Code Review
470
184
 
471
185
  ### Review Scope
472
- - Branch: `<BRANCH>`
473
- - Parent ref: `<PARENT>`
474
- - Merge-base: `<BASE_SHA>`
475
- - Scope mode: `<default-with-uncommitted | explicit-hash-range>`
476
- - Changed files reviewed: <N>
186
+ - Branch: `<BRANCH>` | Parent ref: `<PARENT>` | Merge-base: `<BASE_SHA>`
187
+ - Scope mode: `<default-with-uncommitted | explicit-hash-range>` | Changed files reviewed: <N>
477
188
 
478
189
  ### Summary
479
- <2-3 sentences: overall code health relative to Clean Code principles, key concerns.>
190
+ <2-3 sentences.>
480
191
 
481
192
  ### Stats
482
193
  - blocker: N | major: N | minor: N | info: N
483
194
 
484
195
  ### Findings
485
-
486
- #### Naming
487
- <[F-NNN] findings or "No naming issues found.">
488
-
489
- #### Functions
490
- <[F-NNN] findings or "No function design issues found.">
491
-
492
- #### Comments
493
- <[F-NNN] findings or "No comment issues found.">
494
-
495
- #### Error Handling
496
- <[F-NNN] findings or "No error handling issues found.">
497
-
498
- #### DRY
499
- <[F-NNN] findings or "No DRY violations found.">
500
-
501
- #### SOLID
502
- <[F-NNN] findings or "No SOLID violations found.">
196
+ One `####` section per area (Naming, Functions, Comments, Error Handling, DRY,
197
+ SOLID): its `[F-NNN]` findings, or "No <area> issues found."
503
198
 
504
199
  ### Clean Areas
505
- [List parts of the checklist with no findings, confirming they were reviewed]
200
+ [Areas checked with no findings]
506
201
  ```
507
202
 
508
- ---
509
-
510
203
  ## Job Context Awareness
511
204
 
512
- When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY include:
513
-
514
- ```
515
- JOB_NAME: <job-name>
516
- CONTEXT_PATH: <JOBS_ROOT>/<job-name>/ai/context.md
517
- ```
518
-
519
- If provided and the file exists, read the context document before reviewing. Use it to:
520
- - Understand team-agreed naming conventions that may differ from defaults
521
- - Identify intentional design decisions that appear to violate Clean Code but are documented exceptions
522
- - Understand error handling strategy (Result types vs. exceptions vs. null)
523
-
524
- If absent, proceed normally — context is optional and non-blocking.
525
-
526
- ---
205
+ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY include
206
+ `JOB_NAME` and `CONTEXT_PATH: <JOBS_ROOT>/<job-name>/ai/context.md`. If the file
207
+ exists, read it first for team conventions and documented exceptions. If absent, proceed.
527
208
 
528
209
  ## Red Flags
529
210
 
530
211
  | Rationalization | Why it is wrong |
531
212
  |----------------|-----------------|
532
- | "This function is long but it's clear" | Clarity and length are separate concerns; long functions are harder to test and change regardless of clarity |
533
- | "The team knows what `data` means here" | Names must survive team turnover; if a newcomer can't understand it, it fails |
534
- | "DRY isn't violated — the two blocks just happen to look the same" | If they change together and must stay in sync, they are a DRY violation |
535
- | "Boolean arg is fine, it's obvious from context" | Boolean args always create `call(true, false, true)` call sites that require reading the signature to decode |
536
- | "The catch block logs the error, that's enough" | Logging and silently swallowing are the same if nothing else handles it — check what happens after the catch |
537
- | "I can flag SOLID issues at info because they're just design opinions" | Named SOLID violations with concrete impact (testability, extensibility) are at least minor |
538
- | "This is how the framework works, so it's not a violation" | Framework idioms are explicitly exempt — Iron Law 5 |
213
+ | "Stricter is safer, I'll flag 25-line functions too" | The threshold is the shared standard the writer followed. A finding under it is noise |
214
+ | "It's over the threshold" (when it already was before this change) | Old debt is not this change's finding |
215
+ | "The catch block logs the error, that's enough" | Logging and swallowing are the same if the caller proceeds — check what happens after the catch |
216
+ | "I can flag SOLID issues at info because they're just design opinions" | A named violation with a concrete impact is at least `minor` |
217
+ | "This is how the framework works, so it's not a violation" | Framework idioms are exempt — Clean Code law 5 |
@@ -24,7 +24,7 @@ license: "MIT"
24
24
  # Review — Core Boundaries
25
25
 
26
26
  Reviewer for shared infrastructure modules. A core module should provide stable foundations
27
- used by feature modules; it should not accumulate feature-specific behaviour. Its inputs are the reviewer payload only; session memory and earlier conversation are not inputs. It runs no command unless its payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where its host gives a read-only child git (keryx shell does not: there the payload supplies the history), and the read-only layer commands the orchestrator lists (`keryx gdgraph affected|find`, `keryx test related`, `keryx wiki ask`, `keryx memory search`, `keryx ctx rg|read`); it never writes in the reviewed tree.
27
+ used by feature modules; it should not accumulate feature-specific behaviour. Its inputs are the reviewer payload only; session memory and earlier conversation are not inputs. It runs no command unless its payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where its host gives a read-only child git (keryx shell does not: there the payload supplies the history).
28
28
 
29
29
  ---
30
30
 
@@ -120,7 +120,7 @@ conditions land under that rubric.
120
120
  | Condition | Severity | Why, under the canonical rubric |
121
121
  |---|---|---|
122
122
  | A core API change that breaks a named consumer at runtime | `blocker` | Crash at a named call site |
123
- | Importing feature code into core; adding feature-specific public API to core; inverted dependency | `major` | Named trigger (the import) and named outcome (the cycle or the leak), but structural — not one of the four shapes |
123
+ | Importing feature code into core; adding feature-specific public API to core; inverted dependency | `minor` — `major` only when a concrete defect it causes is named (trigger and outcome) or a stated project rule makes it one | A layer violation. Identical to `review-architecture` for the same condition |
124
124
  | A generic helper whose names or types lean on one feature's language | `minor` | Works today; the cost is to the next module that needs it |
125
125
  | A blast-radius concern with no named consumer | `info` | Shared law 1 |
126
126