@mrciphersmith/keryx 0.4.28 → 0.4.30
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/dist/cli.js +4916 -3655
- package/dist/core.js +91 -28
- package/dist/keryx-general-worker-entry.js +413 -240
- package/package.json +1 -1
- package/src/gdskills/bundled/install-manifest.json +3 -0
- package/src/gdskills/bundled/rules/core/api-contracts.mdc +21 -136
- package/src/gdskills/bundled/rules/core/async-patterns.mdc +18 -171
- package/src/gdskills/bundled/rules/core/clean-architecture.mdc +40 -150
- package/src/gdskills/bundled/rules/core/cli-interface-design.mdc +63 -194
- package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +36 -48
- package/src/gdskills/bundled/rules/core/concurrency-patterns.mdc +32 -0
- package/src/gdskills/bundled/rules/core/database-patterns.mdc +26 -148
- package/src/gdskills/bundled/rules/core/error-handling.mdc +57 -109
- package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +14 -29
- package/src/gdskills/bundled/rules/core/layout-rendering.mdc +51 -0
- package/src/gdskills/bundled/rules/core/mobx-store-template.mdc +69 -511
- package/src/gdskills/bundled/rules/core/nestjs-dto.mdc +18 -36
- package/src/gdskills/bundled/rules/core/playwright-testing.mdc +35 -308
- package/src/gdskills/bundled/rules/core/security-baseline.mdc +18 -140
- package/src/gdskills/bundled/rules/core/skill-authoring.mdc +190 -0
- package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +5 -0
- package/src/gdskills/bundled/rules/core/solid-principles.mdc +70 -121
- package/src/gdskills/bundled/rules/core/storybook-guidelines.mdc +20 -22
- package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +37 -74
- package/src/gdskills/bundled/rules/core/ui-anti-slop.mdc +48 -37
- package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/quality/deprecation-path/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +25 -61
- package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +15 -69
- package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +84 -418
- package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +17 -311
- package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +8 -22
- package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +84 -228
- package/src/gdskills/bundled/skills/review/review-layout/SKILL.md +22 -28
- package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +9 -10
- package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +16 -38
- package/src/gdskills/bundled/skills/review/review-premise/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +8 -8
- package/src/gdskills/bundled/skills/review/review-style/SKILL.md +49 -88
- package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +22 -40
- package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +42 -82
- package/src/gdskills/bundled/stacks/angular/rules/coding-style.mdc +15 -57
- package/src/gdskills/bundled/stacks/angular/rules/patterns.mdc +16 -60
- package/src/gdskills/bundled/stacks/angular/rules/security.mdc +11 -49
- package/src/gdskills/bundled/stacks/angular/rules/testing.mdc +13 -52
- package/src/gdskills/bundled/stacks/c-cpp/rules/coding-style.mdc +33 -57
- package/src/gdskills/bundled/stacks/c-cpp/rules/patterns.mdc +35 -62
- package/src/gdskills/bundled/stacks/c-cpp/rules/security.mdc +35 -62
- package/src/gdskills/bundled/stacks/c-cpp/rules/testing.mdc +34 -54
- package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/patterns.mdc +27 -56
- package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/security.mdc +51 -119
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/coding-style.mdc +42 -74
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/patterns.mdc +45 -83
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/security.mdc +34 -59
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/testing.mdc +33 -62
- package/src/gdskills/bundled/stacks/django/rules/coding-style.mdc +15 -56
- package/src/gdskills/bundled/stacks/django/rules/patterns.mdc +16 -68
- package/src/gdskills/bundled/stacks/django/rules/security.mdc +13 -71
- package/src/gdskills/bundled/stacks/django/rules/testing.mdc +16 -62
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/coding-style.mdc +30 -53
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/patterns.mdc +20 -56
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/security.mdc +52 -122
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/testing.mdc +23 -42
- package/src/gdskills/bundled/stacks/fastapi/rules/coding-style.mdc +13 -47
- package/src/gdskills/bundled/stacks/fastapi/rules/patterns.mdc +18 -81
- package/src/gdskills/bundled/stacks/fastapi/rules/security.mdc +13 -75
- package/src/gdskills/bundled/stacks/fastapi/rules/testing.mdc +14 -58
- package/src/gdskills/bundled/stacks/flutter-dart/rules/coding-style.mdc +36 -74
- package/src/gdskills/bundled/stacks/flutter-dart/rules/patterns.mdc +30 -66
- package/src/gdskills/bundled/stacks/flutter-dart/rules/security.mdc +33 -67
- package/src/gdskills/bundled/stacks/flutter-dart/rules/testing.mdc +41 -73
- package/src/gdskills/bundled/stacks/go/rules/coding-style.mdc +36 -57
- package/src/gdskills/bundled/stacks/go/rules/patterns.mdc +27 -42
- package/src/gdskills/bundled/stacks/go/rules/security.mdc +26 -43
- package/src/gdskills/bundled/stacks/go/rules/testing.mdc +23 -41
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/coding-style.mdc +21 -40
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/patterns.mdc +26 -43
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/security.mdc +25 -37
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/testing.mdc +34 -50
- package/src/gdskills/bundled/stacks/kotlin-android/rules/coding-style.mdc +28 -65
- package/src/gdskills/bundled/stacks/kotlin-android/rules/patterns.mdc +34 -78
- package/src/gdskills/bundled/stacks/kotlin-android/rules/security.mdc +35 -68
- package/src/gdskills/bundled/stacks/kotlin-android/rules/testing.mdc +34 -68
- package/src/gdskills/bundled/stacks/mobx/rules/coding-style.mdc +18 -64
- package/src/gdskills/bundled/stacks/mobx/rules/patterns.mdc +13 -66
- package/src/gdskills/bundled/stacks/mobx/rules/security.mdc +8 -35
- package/src/gdskills/bundled/stacks/mobx/rules/testing.mdc +10 -39
- package/src/gdskills/bundled/stacks/nestjs/rules/coding-style.mdc +32 -45
- package/src/gdskills/bundled/stacks/nestjs/rules/patterns.mdc +40 -60
- package/src/gdskills/bundled/stacks/nestjs/rules/security.mdc +30 -50
- package/src/gdskills/bundled/stacks/nestjs/rules/testing.mdc +27 -47
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/coding-style.mdc +14 -48
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/patterns.mdc +15 -67
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/security.mdc +12 -50
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/testing.mdc +11 -43
- package/src/gdskills/bundled/stacks/php-laravel/rules/coding-style.mdc +17 -58
- package/src/gdskills/bundled/stacks/php-laravel/rules/patterns.mdc +15 -56
- package/src/gdskills/bundled/stacks/php-laravel/rules/security.mdc +13 -50
- package/src/gdskills/bundled/stacks/php-laravel/rules/testing.mdc +14 -55
- package/src/gdskills/bundled/stacks/python/rules/coding-style.mdc +13 -41
- package/src/gdskills/bundled/stacks/python/rules/patterns.mdc +20 -61
- package/src/gdskills/bundled/stacks/python/rules/security.mdc +15 -57
- package/src/gdskills/bundled/stacks/python/rules/testing.mdc +16 -50
- package/src/gdskills/bundled/stacks/react/rules/coding-style.mdc +14 -40
- package/src/gdskills/bundled/stacks/react/rules/patterns.mdc +15 -55
- package/src/gdskills/bundled/stacks/react/rules/security.mdc +13 -49
- package/src/gdskills/bundled/stacks/react/rules/testing.mdc +10 -37
- package/src/gdskills/bundled/stacks/ruby-rails/rules/coding-style.mdc +15 -48
- package/src/gdskills/bundled/stacks/ruby-rails/rules/patterns.mdc +18 -67
- package/src/gdskills/bundled/stacks/ruby-rails/rules/security.mdc +11 -60
- package/src/gdskills/bundled/stacks/ruby-rails/rules/testing.mdc +14 -65
- package/src/gdskills/bundled/stacks/rust/rules/coding-style.mdc +39 -65
- package/src/gdskills/bundled/stacks/rust/rules/patterns.mdc +33 -60
- package/src/gdskills/bundled/stacks/rust/rules/security.mdc +35 -57
- package/src/gdskills/bundled/stacks/rust/rules/testing.mdc +29 -52
- package/src/gdskills/bundled/stacks/sql-db/rules/coding-style.mdc +12 -48
- package/src/gdskills/bundled/stacks/sql-db/rules/patterns.mdc +22 -113
- package/src/gdskills/bundled/stacks/sql-db/rules/security.mdc +11 -56
- package/src/gdskills/bundled/stacks/sql-db/rules/testing.mdc +14 -59
- package/src/gdskills/bundled/stacks/swift-ios/rules/coding-style.mdc +29 -65
- package/src/gdskills/bundled/stacks/swift-ios/rules/patterns.mdc +41 -88
- package/src/gdskills/bundled/stacks/swift-ios/rules/security.mdc +28 -53
- package/src/gdskills/bundled/stacks/swift-ios/rules/testing.mdc +32 -65
- package/src/gdskills/bundled/stacks/vue/rules/coding-style.mdc +17 -52
- package/src/gdskills/bundled/stacks/vue/rules/patterns.mdc +17 -63
- package/src/gdskills/bundled/stacks/vue/rules/security.mdc +11 -41
- package/src/gdskills/bundled/stacks/vue/rules/testing.mdc +16 -48
|
@@ -27,13 +27,19 @@ license: "MIT"
|
|
|
27
27
|
|
|
28
28
|
Specialized reviewer for **logic correctness and algorithmic soundness**.
|
|
29
29
|
Inherits from the correctness phases of two earlier profiles (the strict AI review one, since removed, and `code-learned-review`)
|
|
30
|
-
and unifies them into a single focused pass. 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)
|
|
30
|
+
and unifies them into a single focused pass. 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).
|
|
31
31
|
|
|
32
32
|
This reviewer does not care about formatting, naming, or architecture opinions.
|
|
33
33
|
Every finding must describe an observable, reproducible defect or a spec gap.
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
+
## The standard
|
|
38
|
+
|
|
39
|
+
Read both rules before the diff; where this file and a rule disagree, the rule wins.
|
|
40
|
+
- `.metaproject/rules/core/async-patterns.mdc` — parallel awaits, timeouts, bounded fan-out, event-loop blocking, **Review severities**.
|
|
41
|
+
- `.metaproject/rules/core/error-handling.mdc` — failure signalling, silent catches, unhandled rejections, **Review severities**.
|
|
42
|
+
|
|
37
43
|
## Workflow
|
|
38
44
|
|
|
39
45
|
```
|
|
@@ -137,17 +143,12 @@ earlier review round, because there the finding is recorded as closed and is not
|
|
|
137
143
|
### Async / Concurrency
|
|
138
144
|
|
|
139
145
|
- [ ] Missing `await` on async call — result is a `Promise`, not the value
|
|
140
|
-
- [ ] `await` inside a non-async function (syntax error or no-op)
|
|
141
146
|
- [ ] Parallel async calls that should be sequential (shared mutable state)
|
|
142
|
-
- [ ] Sequential `await` calls that could be `Promise.all` (performance is a secondary concern here; flag when correctness is affected by ordering assumption)
|
|
143
147
|
- [ ] Race conditions: state updated in one branch before a concurrent operation resolves
|
|
144
|
-
- [ ] Unhandled promise rejection (no `.catch`, no `try/catch`, no `Promise.allSettled`)
|
|
145
148
|
- [ ] `setTimeout`/`setInterval` with shared state and no cleanup
|
|
146
149
|
|
|
147
150
|
### Error Handling
|
|
148
151
|
|
|
149
|
-
- [ ] Swallowed `catch` blocks (catches error, does nothing)
|
|
150
|
-
- [ ] Error rethrown as generic string, losing stack trace
|
|
151
152
|
- [ ] Missing error boundary in UI component tree
|
|
152
153
|
- [ ] HTTP errors not checked (`response.ok` ignored)
|
|
153
154
|
- [ ] Partial success treated as full success (only first item processed, error on rest silently dropped)
|
|
@@ -245,15 +246,14 @@ conditions land under that rubric, not a second rubric.
|
|
|
245
246
|
|
|
246
247
|
| Condition | Severity | Why, under the canonical rubric |
|
|
247
248
|
|---|---|---|
|
|
248
|
-
| Unhandled
|
|
249
|
+
| Unhandled rejection; swallowed error; sequential independent awaits, no timeout, unbounded fan-out, event-loop blocking | per `error-handling.mdc` / `async-patterns.mdc` **Review severities** | One table for writers and every reviewer |
|
|
249
250
|
| Corrupted or lost persisted/returned data | `blocker` | Data loss or corruption |
|
|
250
251
|
| Unimplemented acceptance criterion | `blocker` | Named shape 4 |
|
|
251
252
|
| Race condition on shared mutable state | `blocker` **if** the interleaving can corrupt or lose data; otherwise `major` | The outcome decides, not the word "race" |
|
|
252
253
|
| Silent wrong result on a named input | `major` | Trigger and outcome are both named |
|
|
253
|
-
| Swallowed error that hides a failed operation | `major` — `blocker` only if the caller then persists or returns wrong data | Silent failure is wrong behaviour; corruption is a different shape |
|
|
254
254
|
| Type contract broken (declared type is not what is returned) | `major` | Callers observe the wrong value |
|
|
255
255
|
| Edge case not handled, no input that reaches it named | `minor` | No trigger; the cost is to the next editor |
|
|
256
|
-
| Non-null assertion
|
|
256
|
+
| Non-null assertion (`!`) | the `!` row of `code-style-patterns.mdc` Review severities | That table owns the rating; do not restate it here |
|
|
257
257
|
| "Could be more defensive", no observable defect | `info` | Neither trigger nor maintenance cost named |
|
|
258
258
|
|
|
259
259
|
## Iron Laws
|
|
@@ -348,7 +348,6 @@ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY c
|
|
|
348
348
|
| "I see a potential security issue" | Security belongs in `review-security-code`; note it as info and defer |
|
|
349
349
|
| "The spec is unclear so I'll skip the gate" | Unclear spec → `NEEDS_CONTEXT` status + ask for clarification |
|
|
350
350
|
| "I'll mark everything blocker to be safe" | Overstated severity makes reports unactionable; calibrate per the severity guide |
|
|
351
|
-
| "Async performance is slow, so that's a logic bug" | Performance lives in `review-performance` unless incorrect ordering changes the result |
|
|
352
351
|
| "I didn't reproduce the bug so I won't report it" | Every blocker needs a scenario, not a repro — describe the failing code path |
|
|
353
352
|
|
|
354
353
|
<!-- keryx:layers-block:start -->
|
|
@@ -21,7 +21,7 @@ license: "MIT"
|
|
|
21
21
|
|
|
22
22
|
## Purpose
|
|
23
23
|
|
|
24
|
-
Finds real, code-level performance problems introduced in the changed code of the current branch. Covers CLI and TUI hot paths, N+1 database queries, unnecessary React re-renders, missing memoization in hot paths, memory leaks, large bundle imports, synchronous blocking in async contexts, missing pagination, and redundant API calls. 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)
|
|
24
|
+
Finds real, code-level performance problems introduced in the changed code of the current branch. Covers CLI and TUI hot paths, N+1 database queries, unnecessary React re-renders, missing memoization in hot paths, memory leaks, large bundle imports, synchronous blocking in async contexts, missing pagination, and redundant API calls. 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).
|
|
25
25
|
|
|
26
26
|
This skill focuses on **measurable or high-likelihood bottlenecks** only. Premature optimization, hypothetical slowness, and style preferences are out of scope.
|
|
27
27
|
|
|
@@ -85,7 +85,7 @@ render frame, a file in a tree walk or a command start, not a request handler.
|
|
|
85
85
|
- [ ] Work done per keystroke or per render frame (re-reading a file, re-parsing, re-sorting, rebuilding a list) that could be done once per change of its inputs
|
|
86
86
|
- [ ] Per-file work in a command that walks the tree or every flow: a read, parse, `existsSync` or child spawn per entry where one pass or one batch would do
|
|
87
87
|
- [ ] Command startup cost: heavy top-level imports or eager reads in a module every command loads, when only some commands use them
|
|
88
|
-
- [ ] Synchronous I/O (`readFileSync`, `execSync`, `spawnSync`) on an interactive path: input handling, render, a prompt waiting on the user
|
|
88
|
+
- [ ] Synchronous I/O (`readFileSync`, `execSync`, `spawnSync`) on an interactive path: input handling, render, a prompt waiting on the user (rated by `.metaproject/rules/core/async-patterns.mdc` Rule 4, as in section 7)
|
|
89
89
|
- [ ] JSON parse, regex compilation or config load repeated inside a loop instead of hoisted
|
|
90
90
|
- [ ] O(n²) over files, flows, findings or lines: a nested scan, `.includes`/`.find` inside a loop over the same set, sort inside a loop
|
|
91
91
|
- [ ] Polling (`setTimeout`/`setInterval`, `while` wait loop) where an event or a single await would do
|
|
@@ -96,51 +96,36 @@ render frame, a file in a tree walk or a command start, not a request handler.
|
|
|
96
96
|
|
|
97
97
|
### 1. N+1 Database Queries
|
|
98
98
|
|
|
99
|
-
**
|
|
100
|
-
- [ ] Loop or `.map()` containing a DB query, repository call, or Prisma/TypeORM find
|
|
101
|
-
- [ ] `for (const item of items) { await repo.findOne(...) }` — classic N+1
|
|
102
|
-
- [ ] ORM relation accessed without eager loading inside iteration: `order.items` where `items` is a lazy relation loaded inside a loop
|
|
103
|
-
- [ ] GraphQL resolver loading a child relation per parent without a DataLoader
|
|
104
|
-
|
|
105
|
-
**Correct patterns to confirm:** Prisma `include`/`select` on the parent query; TypeORM `leftJoinAndSelect()` or `relations`; MikroORM `populate`; raw SQL `JOIN` rather than a query per row.
|
|
106
|
-
|
|
107
|
-
**Hot path requirement:** State whether this runs per HTTP request, per list item render, per job iteration, etc.
|
|
99
|
+
The standard and its severities are `.metaproject/rules/core/database-patterns.mdc` (Rule 1 and its **Review severities** row). Also: a GraphQL resolver loading a child per parent without a DataLoader is the same shape. State whether the loop runs per HTTP request, per list item render or per job iteration, with its size.
|
|
108
100
|
|
|
109
101
|
### 2. Unnecessary React Re-renders
|
|
110
102
|
|
|
111
103
|
**Detection patterns:**
|
|
112
104
|
- [ ] Object or array literal created inline in JSX: `<Component options={{ key: val }} />` — new reference every render
|
|
113
|
-
- [ ] Arrow function created inline as prop
|
|
114
|
-
- [ ] Large expensive computation performed directly in render body
|
|
105
|
+
- [ ] Arrow function created inline as a prop of a non-store value; an arrow that only forwards to a store action is allowed and needs no `useCallback`
|
|
106
|
+
- [ ] Large expensive computation performed directly in render body
|
|
115
107
|
- [ ] Context value object created inline without useMemo: `<MyContext.Provider value={{ a, b }}>` — every parent render triggers all consumers
|
|
116
108
|
- [ ] Component receiving a new object/array reference from props despite same data (parent not memoizing)
|
|
117
109
|
|
|
118
110
|
**When memo IS justified (flag absence):**
|
|
119
111
|
- [ ] Pure child component receiving stable props but not wrapped in `React.memo` — only flag if the parent re-renders frequently (e.g., on keypress, scroll, animation frame)
|
|
120
|
-
- [ ] `useCallback` absent for a callback passed to a `React.memo` child — only flag if the child is expensive
|
|
112
|
+
- [ ] `useCallback` absent for a non-store callback passed to a `React.memo` child — only flag if the child is expensive; a store method or store value is never wrapped in `useCallback`/`useMemo`
|
|
121
113
|
|
|
122
|
-
**MobX note:**
|
|
114
|
+
**MobX note:** `observer` and where memoization does and does not belong are `.metaproject/rules/core/code-style-patterns.mdc` Rules 1 and 3. Without a concrete re-render cost there is no finding.
|
|
123
115
|
|
|
124
116
|
### 3. Expensive Computations in Hot Paths
|
|
125
117
|
|
|
126
|
-
- [ ] Sorting, filtering, or reducing a large array inside a render function without `useMemo`
|
|
118
|
+
- [ ] Sorting, filtering, or reducing a large array inside a render function without `useMemo`; when the array is store state the fix is `@computed` (`.metaproject/rules/core/mobx-store-template.mdc` Rule 1), not `useMemo`
|
|
127
119
|
- [ ] Deep clone (`JSON.parse(JSON.stringify(...))`) inside a loop or on every render
|
|
128
120
|
- [ ] Regex compilation inside a loop — should be compiled once outside: `const RE = /pattern/`
|
|
129
121
|
- [ ] `Object.keys().reduce()` or similar aggregation recalculated on every render instead of being derived in store or memoized
|
|
130
122
|
- [ ] Recursive computation without memoization called in a loop
|
|
131
123
|
|
|
132
|
-
**Hot path requirement:** An expensive computation is
|
|
124
|
+
**Hot path requirement:** An expensive computation is `major` only with a named cost and frequency (a render, a tight loop, every CLI command start: a hot path, Part 0); without both it is `minor`. Once per process (server start, a build) is `info` at most.
|
|
133
125
|
|
|
134
126
|
### 4. Missing Database Indexes
|
|
135
127
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- [ ] New query filtering on a column that is not a primary key and not obviously indexed: `WHERE email = ?` without a unique constraint visible in the schema or migration
|
|
139
|
-
- [ ] `ORDER BY created_at DESC` on a table with potentially large row counts — `created_at` index not evident
|
|
140
|
-
- [ ] `LIKE '%term%'` — prefix wildcard prevents index use; flag as info with suggestion to use full-text search
|
|
141
|
-
- [ ] Foreign key column used in JOIN without an index (common ORM footgun)
|
|
142
|
-
|
|
143
|
-
**Evidence requirement:** Cannot confirm an index is missing without seeing the migration or schema. If the schema is not in the payload, it is `info`: say that reading the schema would settle it. Schema shown with no index and the table shown large (its size named): `major`. Schema shown, size not: `minor`.
|
|
128
|
+
The standard and its severities are `.metaproject/rules/core/database-patterns.mdc` (Rule 2 and its **Review severities** row, which also rates an index with no schema in the payload). Also: `LIKE '%term%'` cannot use a b-tree index; flag it as `info` with full-text search as the fix.
|
|
144
129
|
|
|
145
130
|
### 5. Memory Leaks
|
|
146
131
|
|
|
@@ -148,11 +133,9 @@ Detectable from query patterns in changed code (not from DB schema directly):
|
|
|
148
133
|
- [ ] `addEventListener` without matching `removeEventListener` in cleanup
|
|
149
134
|
- [ ] `setInterval` / `setTimeout` (recurring) without `clearInterval` / `clearTimeout` in cleanup
|
|
150
135
|
- [ ] RxJS `subscribe()` without `unsubscribe()` stored in a disposable or returned from useEffect cleanup
|
|
151
|
-
- [ ] MobX `autorun` / `reaction` / `when` without disposer called in `dispose()` (see `review-frontend` for full checklist)
|
|
152
136
|
- [ ] WebSocket or SSE connection opened without close in cleanup
|
|
153
137
|
|
|
154
|
-
|
|
155
|
-
- [ ] `useEffect` that creates a subscription, timer, or async operation but returns no cleanup function
|
|
138
|
+
MobX disposers are `.metaproject/rules/core/mobx-store-template.mdc` Rule 5; a `useEffect` subscription, timer or async operation with no cleanup is `.metaproject/rules/core/code-style-patterns.mdc` Rule 5. Each takes its severity from that rule's table.
|
|
156
139
|
|
|
157
140
|
**Unbounded collections:**
|
|
158
141
|
- [ ] Map, Set, or array that grows on every event/request with no eviction, max size, or TTL
|
|
@@ -175,19 +158,16 @@ Detectable from query patterns in changed code (not from DB schema directly):
|
|
|
175
158
|
|
|
176
159
|
### 7. Synchronous Blocking in Async Contexts
|
|
177
160
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- [ ] CPU-intensive synchronous computation (sorting large arrays, JSON.parse of large payloads) in an Express/NestJS handler without offloading to a worker
|
|
161
|
+
Sync file I/O, `execSync` and CPU-heavy work on a request path are `.metaproject/rules/core/async-patterns.mdc` Rule 4 and its **Review severities** row. Also:
|
|
162
|
+
|
|
181
163
|
- [ ] `new Promise(resolve => setTimeout(resolve, N))` — artificial sleep in a server handler
|
|
182
164
|
- [ ] Synchronous DB client used in an async context (e.g., `better-sqlite3` in an Express handler serving concurrent requests)
|
|
183
165
|
|
|
184
166
|
### 8. Missing Pagination
|
|
185
167
|
|
|
186
|
-
-
|
|
187
|
-
- [ ] `findAll()` / `find({})` with no limit on a table mentioned as potentially large in context
|
|
188
|
-
- [ ] API endpoint returning an array without `page`/`cursor`/`limit` parameters when the underlying data is unbounded
|
|
168
|
+
The standard and its severities are `.metaproject/rules/core/api-contracts.mdc` (Rule 6 and its **Review severities** row): a list bounded small by construction is not a finding, and attacker-reachable memory exhaustion is `blocker`. The repository-level counterpart:
|
|
189
169
|
|
|
190
|
-
|
|
170
|
+
- [ ] Repository query with no `take`/`limit` on a collection that could grow (user-generated content, logs, history), or `findAll()` / `find({})` with no limit on a table named as large
|
|
191
171
|
|
|
192
172
|
### 9. Redundant API Calls
|
|
193
173
|
|
|
@@ -198,9 +178,7 @@ Detectable from query patterns in changed code (not from DB schema directly):
|
|
|
198
178
|
|
|
199
179
|
### 10. MobX: Derived State Computed in Renders
|
|
200
180
|
|
|
201
|
-
-
|
|
202
|
-
- [ ] Filtered list recalculated in render: `store.items.filter(x => x.active)` — should be a `@computed`
|
|
203
|
-
- [ ] Conditional format derived from observable in render instead of a computed getter
|
|
181
|
+
Derived values belong in `@computed` (`.metaproject/rules/core/mobx-store-template.mdc` Rule 1 and its row) and logic does not live in a component (`.metaproject/rules/core/code-style-patterns.mdc` Rule 2). This lens adds only the cost angle: a reduce, filter or format recomputed on a high-frequency render, with its frequency named.
|
|
204
182
|
|
|
205
183
|
---
|
|
206
184
|
|
|
@@ -109,7 +109,7 @@ signal and no practice source against it is upheld.
|
|
|
109
109
|
| **Claim first, argument second.** | The case passed two reviews that read the fix's argument and never the premise. |
|
|
110
110
|
| **`challenged` cites.** Each intent signal names its `ref` (`file:line` or a SHA) and what it says; each practice source names the guideline and section precisely enough to look up. | An uncited challenge is rejected and the finding stays as reported. Never invent a quote. |
|
|
111
111
|
| **Never re-grade by the rubric.** Severity is the reviewer's and the verifier's call; a test gap or a surviving mutant stays as reported unless intent or practice shrinks it, and a minor is upheld or challenged, never downgraded. | An uncited downgrade is rejected (`downgrade-without-evidence`). Minors matter: a finding you weaken is one nobody fixes. |
|
|
112
|
-
| **Read-only.** Read files; run nothing but `git log`, `git blame` and `git show` (only where your host gives a read-only child git)
|
|
112
|
+
| **Read-only.** Read files; run nothing but `git log`, `git blame` and `git show` (only where your host gives a read-only child git). On keryx shell you have no shell and no git tool: read the history excerpts in `context_files`, or say the history was not read. | Executing is the verifier's job; this judgement is about meaning. |
|
|
113
113
|
| **An external finding, and a `review-security-code` finding, is held or upheld, never dismissed or downgraded.** | A human asked; the operator answers them. Severity of a security finding measures exposure, which intent does not lower. The merge rejects the downgrade (`external-downgrade`, `security-downgrade`). |
|
|
114
114
|
|
|
115
115
|
## Output Contract
|
|
@@ -22,7 +22,7 @@ license: "MIT"
|
|
|
22
22
|
# Review: Regression
|
|
23
23
|
|
|
24
24
|
You are reviewing **scope B** of a deep round. The files you are given are not
|
|
25
|
-
under review. They are under **regression check**. 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)
|
|
25
|
+
under review. They are under **regression check**. 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).
|
|
26
26
|
|
|
27
27
|
## The one question
|
|
28
28
|
|
|
@@ -23,7 +23,7 @@ license: "MIT"
|
|
|
23
23
|
|
|
24
24
|
## Purpose
|
|
25
25
|
|
|
26
|
-
Finds exploitable security vulnerabilities introduced in the changed code of the current branch. Covers injection, auth/authz gaps, IDOR, secrets, insecure crypto, CSRF, path traversal, and framework-specific patterns (NestJS, React). Produces findings with explicit attack vectors and concrete fixes. 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)
|
|
26
|
+
Finds exploitable security vulnerabilities introduced in the changed code of the current branch. Covers injection, auth/authz gaps, IDOR, secrets, insecure crypto, CSRF, path traversal, and framework-specific patterns (NestJS, React). Produces findings with explicit attack vectors and concrete fixes. 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).
|
|
27
27
|
|
|
28
28
|
This skill covers **code-level security only**. It does NOT audit npm/bun dependency trees, Docker configurations, or deployment surfaces — use `security-audit` for those.
|
|
29
29
|
|
|
@@ -75,14 +75,17 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
78
|
+
## The standard
|
|
79
|
+
|
|
80
|
+
Read `.metaproject/rules/core/security-baseline.mdc` before the diff (secrets, queries, boundary validation, logging, dependencies, **Review severities**). Where this file and the rule disagree, the rule wins.
|
|
81
|
+
|
|
78
82
|
## Review Checklist
|
|
79
83
|
|
|
80
84
|
Work through every category below for each changed file. Tie every finding to a concrete line in the diff.
|
|
81
85
|
|
|
82
86
|
### 1. Injection Vulnerabilities
|
|
83
87
|
|
|
84
|
-
**SQL Injection**
|
|
85
|
-
- [ ] Raw SQL built by string concatenation or template literals with user input
|
|
88
|
+
**SQL Injection** (`security-baseline.mdc`)
|
|
86
89
|
- [ ] ORM `query()` / `rawQuery()` calls with unparameterized values
|
|
87
90
|
- [ ] TypeORM `createQueryBuilder` using `.where(\`field = '${value}'\`)` instead of parameterized bindings
|
|
88
91
|
|
|
@@ -143,14 +146,11 @@ Attack vector template: _"Attacker replaces `id=123` with `id=456` in request, a
|
|
|
143
146
|
- [ ] Express: no `express-validator` or equivalent on body/query params
|
|
144
147
|
- [ ] Accepting unbounded `limit`/`offset` from user without max cap (DoS vector)
|
|
145
148
|
- [ ] File upload: MIME type and extension validated only client-side, not server-side
|
|
146
|
-
- [ ] Email/URL fields accepted without format validation
|
|
147
149
|
|
|
148
150
|
### 5. Secrets and Credentials
|
|
149
151
|
|
|
150
|
-
- [ ] Hardcoded API keys, passwords, tokens, or private keys in source
|
|
151
152
|
- [ ] Secrets passed via URL query params (end up in logs and proxies)
|
|
152
|
-
- [ ]
|
|
153
|
-
- [ ] `.env` files committed to version control
|
|
153
|
+
- [ ] PII logged via error serialization
|
|
154
154
|
- [ ] JWT secret is a short literal string (`"secret"`, `"myapp"`)
|
|
155
155
|
|
|
156
156
|
### 6. Insecure Cryptography
|
|
@@ -305,6 +305,7 @@ conditions land under that rubric, not a second rubric.
|
|
|
305
305
|
|
|
306
306
|
| Condition | Severity | Why, under the canonical rubric |
|
|
307
307
|
|---|---|---|
|
|
308
|
+
| Secrets, interpolated queries, unvalidated boundary input, logged secrets, dependency ranges | per `.metaproject/rules/core/security-baseline.mdc` **Review severities** | One table for writers and this reviewer |
|
|
308
309
|
| Exploitable vulnerability in the current code path, with the attack vector stated | `blocker` | Named shape 3 |
|
|
309
310
|
| A weakness a named trigger reaches in the current code, producing a wrong outcome short of a named attacker impact | `major` | Trigger and outcome are named; not shape 3 |
|
|
310
311
|
| Hardening or defence-in-depth on code that is not currently exploitable | `minor` | The code behaves correctly; the cost is to whoever hardens it later |
|
|
@@ -327,7 +328,6 @@ Stop and re-read these rules if you are thinking:
|
|
|
327
328
|
| "The team would never send that payload" | Attackers are not on the team |
|
|
328
329
|
| "MD5 is used for caching keys, not passwords — it's fine" | State it as INFO, but do not silently skip it; it often drifts |
|
|
329
330
|
| "I'll downgrade to minor to avoid friction" | Severity reflects real risk, not social dynamics |
|
|
330
|
-
| "The code uses an ORM so SQL injection is not possible" | ORMs have raw-query escape hatches; verify parameterization |
|
|
331
331
|
| "No attack vector found — I'll call it major anyway" | Without a vector the attacker claim is dropped, not the finding: it is `major` only with a named trigger and wrong outcome, else `info` (security-specific law) |
|
|
332
332
|
| "It's a security finding, so it's a blocker" | `blocker` is the four shapes in **Severity (canonical)**. An unreachable weakness is `info` (shared law 1) however alarming its name; a reachable one with a named trigger and wrong outcome, short of shape 3, is `major`; reachable but behaving correctly is hardening (`minor`) |
|
|
333
333
|
| "It's outside the diff but the pattern is clearly wrong" | Only flag changed code; flag legacy via INFO with note to track separately |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: review-style
|
|
3
3
|
model_tier: light
|
|
4
4
|
description: |
|
|
5
|
-
Use when: reviewing code for
|
|
5
|
+
Use when: reviewing code for names, naming conventions and readability —
|
|
6
6
|
without touching logic, architecture, security, or performance. Dispatched by
|
|
7
7
|
review-orchestrator with the --style flag.
|
|
8
8
|
NOT for: logic bugs, architectural violations, security vulnerabilities, performance
|
|
@@ -15,7 +15,7 @@ triggers:
|
|
|
15
15
|
- "check readability"
|
|
16
16
|
metadata:
|
|
17
17
|
author: "MrCipherSmith"
|
|
18
|
-
version: "1.
|
|
18
|
+
version: "1.3.0"
|
|
19
19
|
category: "review"
|
|
20
20
|
compatible_harnesses: "cursor,codex,zed,opencode,claude"
|
|
21
21
|
license: "MIT"
|
|
@@ -23,9 +23,23 @@ license: "MIT"
|
|
|
23
23
|
|
|
24
24
|
# Review — Style, Naming & Readability
|
|
25
25
|
|
|
26
|
-
Focused style reviewer. Covers naming conventions,
|
|
27
|
-
|
|
28
|
-
Never touches logic correctness, architecture, security, or performance. 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)
|
|
26
|
+
Focused style reviewer. Covers names, naming conventions, readability, file length,
|
|
27
|
+
cyclomatic complexity, barrel and re-export hygiene, and console noise.
|
|
28
|
+
Never touches logic correctness, architecture, security, or performance. 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).
|
|
29
|
+
|
|
30
|
+
## The standard
|
|
31
|
+
|
|
32
|
+
Read `.metaproject/rules/core/solid-principles.mdc` before the diff: it is the
|
|
33
|
+
file the code was written against. Its **Readability thresholds** table is this
|
|
34
|
+
lens's thresholds and default severities; under a threshold, report nothing.
|
|
35
|
+
|
|
36
|
+
Names are rated by the `solid-principles.mdc` **Review severities** Name row. Not
|
|
37
|
+
this lens's: duplication, magic literals, comments and lookup-map or branch-chain
|
|
38
|
+
findings (`review-clean-code`); circular imports (`review-architecture`); unused
|
|
39
|
+
imports and variables and import order (the linter).
|
|
40
|
+
|
|
41
|
+
A threshold counts only when this change crosses it: one more line in a file
|
|
42
|
+
already past a length limit is not a finding.
|
|
29
43
|
|
|
30
44
|
---
|
|
31
45
|
|
|
@@ -37,13 +51,11 @@ review-style Progress:
|
|
|
37
51
|
- [ ] Step 2: Determine git scope (merge-base) — see .metaproject/skills/gdskills/shared/git-merge-base.md
|
|
38
52
|
- [ ] Step 3: Collect diff and changed file list
|
|
39
53
|
- [ ] Step 4: Naming conventions check
|
|
40
|
-
- [ ] Step 5: Dead
|
|
54
|
+
- [ ] Step 5: Dead exports and module hygiene check
|
|
41
55
|
- [ ] Step 6: Readability and complexity check
|
|
42
|
-
- [ ] Step 7:
|
|
43
|
-
- [ ] Step 8:
|
|
44
|
-
- [ ] Step 9:
|
|
45
|
-
- [ ] Step 10: Console usage check
|
|
46
|
-
- [ ] Step 11: Emit findings in unified format, sorted by severity
|
|
56
|
+
- [ ] Step 7: File length and structure check
|
|
57
|
+
- [ ] Step 8: Console usage check
|
|
58
|
+
- [ ] Step 9: Emit findings in unified format, sorted by severity
|
|
47
59
|
```
|
|
48
60
|
|
|
49
61
|
---
|
|
@@ -78,23 +90,14 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
78
90
|
|
|
79
91
|
### 1. Naming Conventions
|
|
80
92
|
|
|
93
|
+
Casing, boolean prefixes and verb names follow the language's published defaults; report a departure only where the surrounding code follows the default.
|
|
94
|
+
|
|
81
95
|
**Variables and functions**
|
|
82
|
-
- `
|
|
83
|
-
- `PascalCase` for classes, interfaces, enums, and React components
|
|
84
|
-
- `UPPER_SNAKE_CASE` for module-level constants (truly constant values, not `let` reassigned as constants)
|
|
85
|
-
- Boolean variables/functions prefixed with `is`, `has`, `can`, `should` (e.g., `isLoading`, `hasAccess`)
|
|
86
|
-
- Avoid single-letter names except in short array callbacks (`arr.map(x => x.id)` acceptable; `let x = fetchUser()` is not)
|
|
87
|
-
- Avoid abbreviations that are not universally understood (`usr`, `mgr`, `repo` vs `repository`)
|
|
88
|
-
|
|
89
|
-
**Functions**
|
|
90
|
-
- Function names are verbs or verb phrases: `getUser`, `handleSubmit`, `parseConfig`
|
|
91
|
-
- Event handlers prefixed with `on` or `handle`: `onSubmit`, `handleClick`
|
|
92
|
-
- Predicate functions return boolean and are named accordingly: `isValid()`, not `checkValid()`
|
|
96
|
+
- Single-letter names only for loop counters and short array callbacks (`arr.map(x => x.id)`); `let x = fetchUser()` is a finding (the Name row)
|
|
93
97
|
|
|
94
98
|
**Classes and interfaces**
|
|
95
|
-
-
|
|
99
|
+
- Interfaces are named without an `I` prefix (`UserService`, not `IUserService`); an `I` prefix the change introduces is a finding
|
|
96
100
|
- Enum members: `UPPER_SNAKE_CASE` or `PascalCase` — whichever the project uses consistently; flag inconsistency
|
|
97
|
-
- Type alias names: `PascalCase`
|
|
98
101
|
|
|
99
102
|
**Files and directories**
|
|
100
103
|
- File names match the primary export: `UserService` → `user.service.ts`
|
|
@@ -104,86 +107,46 @@ Naming severity is set by the Style laws below and by the canonical rubric in `r
|
|
|
104
107
|
|
|
105
108
|
---
|
|
106
109
|
|
|
107
|
-
### 2. Dead
|
|
110
|
+
### 2. Dead Exports
|
|
108
111
|
|
|
109
|
-
- Unused variables (`const x = ...` never referenced) — flag as `minor`
|
|
110
|
-
- Unused function parameters in non-interface-implementing functions — flag as `minor`
|
|
111
|
-
- Unused imports — flag as `minor`; provide the removal patch
|
|
112
|
-
- Commented-out code blocks (more than one line) — flag as `minor`; ask: "Is this intentional? If not, remove."
|
|
113
112
|
- Exported functions/classes that are never imported anywhere in the diff scope — flag as `info`
|
|
114
|
-
(may be used externally; do not assume dead without evidence)
|
|
113
|
+
(may be used externally; do not assume dead without evidence). Unused variables, parameters and imports are the linter's.
|
|
115
114
|
|
|
116
115
|
---
|
|
117
116
|
|
|
118
117
|
### 3. Readability and Complexity
|
|
119
118
|
|
|
120
|
-
**Conditions**
|
|
121
|
-
-
|
|
119
|
+
**Conditions and nesting** (clause, depth and complexity thresholds are the Readability thresholds table)
|
|
120
|
+
- A boolean condition over the clause threshold — suggest extracting a named predicate
|
|
121
|
+
- Callback or `if/else` nesting over the depth threshold — suggest extraction, `async/await` or guard clauses
|
|
122
|
+
- A function over the decision-branch threshold — suggest splitting into named functions
|
|
122
123
|
- Double negatives (`!isNotEmpty`) — flag as `minor`; rewrite to positive form
|
|
123
124
|
- Ternary chains (ternary inside ternary) — flag as `minor`; suggest `if/else` or early return
|
|
124
125
|
|
|
125
|
-
**Nesting**
|
|
126
|
-
- Functions with callback nesting deeper than 3 levels — flag as `minor`; suggest extraction or `async/await`
|
|
127
|
-
- `if/else` trees deeper than 3 levels — flag as `minor`; suggest guard clauses (early returns)
|
|
128
|
-
|
|
129
|
-
**Magic numbers**
|
|
130
|
-
- Numeric or string literals used in logic without a named constant — flag as `minor`
|
|
131
|
-
- Exception: index `0`, `1`, `-1`, empty string `""`, and HTTP status codes when the context is obvious
|
|
132
|
-
- Suggest: `const MAX_RETRY_COUNT = 3;`
|
|
133
|
-
|
|
134
|
-
**Cyclomatic complexity**
|
|
135
|
-
- Functions with more than 10 decision branches (if/else/switch cases/ternary/loop) — flag as `minor`; suggest splitting into smaller, named functions
|
|
136
|
-
|
|
137
126
|
---
|
|
138
127
|
|
|
139
|
-
### 4.
|
|
128
|
+
### 4. Module Hygiene
|
|
140
129
|
|
|
141
|
-
- Clearly duplicated logic blocks (same or near-identical code in two places within the diff) — flag as `minor`, however large; `review-clean-code` owns the duplication rating (its law 3)
|
|
142
|
-
- Duplicated string literals used in multiple places — flag as `info`; suggest a shared constant
|
|
143
|
-
- Similar switch/if-else trees that could be a lookup map — flag as `minor`
|
|
144
|
-
|
|
145
|
-
Do not flag DRY violations for code outside the diff even if legacy duplication exists.
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
### 5. Import Organization
|
|
150
|
-
|
|
151
|
-
- Imports must be grouped (framework/library imports first, then project imports, then relative imports); blank line between groups
|
|
152
|
-
- Imports within a group should be alphabetically sorted (or consistently ordered — match project convention)
|
|
153
130
|
- Barrel imports (`import * as X from '...'`) without reason — flag as `info`
|
|
154
|
-
- Circular imports (visible from import paths) — flag as `minor`; `review-architecture` owns the rating, and one that fails at runtime is its finding
|
|
155
131
|
- Re-exporting something that is immediately re-used in the same file — flag as `minor` (unnecessary indirection)
|
|
156
132
|
|
|
157
133
|
---
|
|
158
134
|
|
|
159
|
-
###
|
|
160
|
-
|
|
161
|
-
**Misleading or outdated comments**
|
|
162
|
-
- Comment describes what the code does but the code has changed — flag as `minor`
|
|
163
|
-
- Comment says "TODO: remove before deploy" and was merged — flag as `minor`
|
|
164
|
-
- Comment is actively wrong (incorrect description of behavior) — flag as `minor` (`review-clean-code` owns comment ratings; a defect the comment caused is that defect's finding)
|
|
165
|
-
|
|
166
|
-
**Missing JSDoc on public APIs**
|
|
167
|
-
- Public functions/classes exported from a module should have a JSDoc comment describing purpose, params, and return value
|
|
168
|
-
- Missing JSDoc on public APIs: flag as `info` (unless the project has a documented standard requiring it, in which case `minor`)
|
|
135
|
+
### 5. Public API Docs
|
|
169
136
|
|
|
170
|
-
|
|
171
|
-
- `// increment i` above `i++` — flag as `info`; suggest removing
|
|
172
|
-
- Section divider comments (`// =========`) that add no semantic value — flag as `info`
|
|
137
|
+
- Missing JSDoc on a public export: flag as `info` (`minor` where the project has a documented standard). Comment quality is `review-clean-code`'s.
|
|
173
138
|
|
|
174
139
|
---
|
|
175
140
|
|
|
176
|
-
###
|
|
141
|
+
### 6. File Length and Structure
|
|
177
142
|
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
- Single file exporting more than 5 unrelated things — flag as `minor`; suggest splitting into focused modules
|
|
143
|
+
- A file over a length threshold — suggest splitting by responsibility
|
|
144
|
+
- A file over the unrelated-exports threshold — suggest splitting into focused modules
|
|
181
145
|
- A React component file whose parts are out of order (imports, interfaces, component, helpers) — flag as `minor`
|
|
182
|
-
- Test files: no limit enforced; complexity handled by test count and grouping
|
|
183
146
|
|
|
184
147
|
---
|
|
185
148
|
|
|
186
|
-
###
|
|
149
|
+
### 7. Console Usage
|
|
187
150
|
|
|
188
151
|
- `console.log` / `console.error` / `console.warn` in non-test production code — flag as `minor`
|
|
189
152
|
- Suggest replacing with project logger (`AppLogger`, `Logger`, etc.) or remove entirely
|
|
@@ -210,10 +173,9 @@ boundary is the trigger-and-outcome test.
|
|
|
210
173
|
| Rule | Rationale |
|
|
211
174
|
|------|-----------|
|
|
212
175
|
| Style findings are **never** `blocker` | None of the four merge-blocking shapes is reachable from a style observation. This reviewer's finding format omits `blocker` for that reason |
|
|
213
|
-
| 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 |
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
| Do not expand scope to architectural or logic concerns | Stay in style lane; hand off to the right reviewer. A circular import that fails at runtime is `review-architecture`'s finding, not a style one |
|
|
176
|
+
| 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 | The `solid-principles.mdc` Name row; this lens is its only rater |
|
|
177
|
+
| Never flag issues handled by the project's autoformatter or linter (indentation, trailing spaces, bracket style, import grouping and order, unused imports and variables) | Linter/formatter owns that; double-flagging creates noise. This does not cover the `from "src/..."` import-path row of `code-style-patterns.mdc` Rule 8, which is path style, not grouping or order |
|
|
178
|
+
| Do not expand scope to architectural or logic concerns | Stay in style lane; hand off to the right reviewer. Circular imports are `review-architecture`'s |
|
|
217
179
|
|
|
218
180
|
---
|
|
219
181
|
|
|
@@ -256,7 +218,7 @@ observation is theatre, not rigour.
|
|
|
256
218
|
- **Severity**: major | minor | info
|
|
257
219
|
- **File**: path/to/file.ts:line
|
|
258
220
|
- **Problem**: what is wrong
|
|
259
|
-
- **Why it matters**: readability / maintainability /
|
|
221
|
+
- **Why it matters**: readability / maintainability / convention consistency
|
|
260
222
|
- **Fix**: concrete suggestion
|
|
261
223
|
- **Patch** (optional):
|
|
262
224
|
```diff
|
|
@@ -305,7 +267,7 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
305
267
|
<[F-NNN] findings>
|
|
306
268
|
|
|
307
269
|
## Positive Notes
|
|
308
|
-
<Optional. Consistent naming,
|
|
270
|
+
<Optional. Consistent naming, readable structure.>
|
|
309
271
|
```
|
|
310
272
|
|
|
311
273
|
---
|
|
@@ -314,8 +276,9 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
314
276
|
|
|
315
277
|
| Concern | This skill | Use instead |
|
|
316
278
|
|---------|------------|-------------|
|
|
317
|
-
|
|
|
318
|
-
| Duplication, comments,
|
|
279
|
+
| Names, readability, barrels and re-exports, file length | YES | — |
|
|
280
|
+
| Duplication, magic literals, comments, lookup maps | NO | `review-clean-code` |
|
|
281
|
+
| Circular imports | NO | `review-architecture` |
|
|
319
282
|
| Logic bugs, incorrect return values | NO | `review-logic` |
|
|
320
283
|
| Architectural layer violations | NO | `review-architecture` |
|
|
321
284
|
| Security vulnerabilities | NO | `review-security-code` |
|
|
@@ -348,7 +311,5 @@ If absent, infer conventions from surrounding unchanged code in the same files;
|
|
|
348
311
|
| Rationalization | Why it is wrong |
|
|
349
312
|
|----------------|-----------------|
|
|
350
313
|
| "The naming is a bit odd but I understand it" | Reviewers understand their own code; the next dev won't |
|
|
351
|
-
| "Commented-out code might be needed later" | Git history exists for that; dead comments add noise |
|
|
352
|
-
| "It's only one magic number" | One `42` today becomes twelve untraceable `42`s tomorrow |
|
|
353
|
-
| "DRY violation is minor so I'll skip it" | It is `minor` and still reported, once, with every site listed |
|
|
354
314
|
| "The file is 600 lines but it's organized" | Organization doesn't prevent merge conflicts and scroll fatigue |
|
|
315
|
+
| "An unused import is an easy minor to add" | The linter owns unused imports and variables; a finding here double-reports it |
|