@mrciphersmith/keryx 0.4.26 → 0.4.28
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/README.md +2 -2
- package/dist/cli.js +106917 -105655
- package/dist/core.js +28 -198
- package/dist/keryx-general-worker-entry.js +526 -421
- package/package.json +3 -3
- package/src/gdskills/bundled/agents/work-planner.md +1 -1
- package/src/gdskills/bundled/install-manifest.json +3 -26
- package/src/gdskills/bundled/rules/core/code-review-learned-profile.mdc +1 -2
- package/src/gdskills/bundled/rules/core/definition-of-done.mdc +0 -1
- package/src/gdskills/bundled/rules/core/implementation-doc-mandate.mdc +4 -5
- package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +8 -8
- package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +7 -10
- package/src/gdskills/bundled/skills/core/reviewer-skill-creator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +12 -21
- package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +3 -3
- package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +1 -1
- package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/planning/interview/SKILL.md +3 -4
- package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/quality/git-publish/SKILL.md +60 -0
- package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.md +3 -3
- package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +7 -7
- package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +22 -22
- package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +15 -15
- package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +7 -7
- package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +34 -30
- package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +64 -135
- package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +4 -4
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +18 -20
- package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +12 -18
- package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +2 -2
- package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +2 -10
- package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +35 -35
- package/src/gdskills/bundled/skills/review/review-pr-contract/SKILL.md +4 -5
- package/src/gdskills/bundled/skills/review/review-premise/SKILL.md +2 -2
- package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +3 -5
- package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +14 -15
- package/src/gdskills/bundled/skills/review/review-style/SKILL.md +14 -13
- package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +11 -11
- package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +10 -11
- package/src/gdskills/bundled/skills/review/review-verifier/SKILL.md +5 -5
- package/src/gdskills/bundled/skills/shared/git-merge-base.md +1 -1
- package/src/gdskills/bundled/stacks/mobx/agent-refs.json +1 -1
- package/src/gdskills/bundled/stacks/mobx/governance/scout.json +2 -2
- package/src/gdskills/bundled/stacks/mobx/skills/mobx-store-implementation/SKILL.md +2 -2
- package/src/gdskills/bundled/stacks/vue/governance/scout.json +1 -1
- package/src/gdskills/contracts/review-finding.schema.json +2 -2
- package/src/gdskills/bundled/rules/core/code-review-ai-assistant.mdc +0 -49
- package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +0 -198
- package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +0 -177
- package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.md +0 -414
- package/src/gdskills/bundled/skills/orchestration/job-documenter/input-contract.schema.json +0 -55
- package/src/gdskills/bundled/skills/orchestration/job-documenter/output-contract.schema.json +0 -58
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +0 -209
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +0 -209
- package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +0 -208
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +0 -255
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +0 -255
- package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +0 -254
- package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +0 -209
- package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +0 -209
- package/src/gdskills/bundled/skills/planning/planner/SKILL.md +0 -208
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +0 -171
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +0 -171
- package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +0 -170
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +0 -184
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +0 -184
- package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +0 -183
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +0 -249
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +0 -249
- package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +0 -248
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +0 -199
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +0 -199
- package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +0 -198
- package/src/gdskills/bundled/skills/quality/commit/SKILL.md +0 -87
- package/src/gdskills/bundled/skills/quality/pr/SKILL.md +0 -95
- package/src/gdskills/bundled/skills/quality/push/SKILL.md +0 -73
- package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.md +0 -238
- package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.md +0 -301
- package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +0 -208
|
@@ -15,7 +15,7 @@ triggers:
|
|
|
15
15
|
- "review NestJS"
|
|
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
|
stack_requires: "nestjs,prisma"
|
|
@@ -26,7 +26,7 @@ license: "MIT"
|
|
|
26
26
|
|
|
27
27
|
Focused backend reviewer covering NestJS patterns, REST API design, database access patterns,
|
|
28
28
|
and TypeScript correctness for service-layer code. This skill does NOT duplicate security or
|
|
29
|
-
performance checks — those belong to `review-security-code` and `review-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
|
+
performance checks — those belong to `review-security-code` and `review-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), 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.
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
@@ -79,7 +79,7 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
79
79
|
|
|
80
80
|
**Module structure**
|
|
81
81
|
- `@Module()` declaration present; providers, imports, exports are correctly listed
|
|
82
|
-
- Circular dependency risk: two modules importing each other —
|
|
82
|
+
- Circular dependency risk: two modules importing each other — defer the cycle to `review-architecture`; suggest `forwardRef()`
|
|
83
83
|
- Feature modules do not import `AppModule`
|
|
84
84
|
|
|
85
85
|
**Provider scope**
|
|
@@ -91,18 +91,17 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
91
91
|
- All controller methods accepting user input (body, query, param) have a DTO class decorated with `class-validator` decorators
|
|
92
92
|
- Required fields: `@IsString()`, `@IsNumber()`, `@IsEmail()`, etc. present and accurate
|
|
93
93
|
- `@IsOptional()` used only on truly optional fields; non-optional fields must not have `@IsOptional()`
|
|
94
|
-
- `ValidationPipe` applied globally (in `main.ts`) or explicitly via `@UsePipes(ValidationPipe)` —
|
|
94
|
+
- `ValidationPipe` applied globally (in `main.ts`) or explicitly via `@UsePipes(ValidationPipe)` — missing on an endpoint accepting user input is rated by the DTO row of the conditions table
|
|
95
95
|
- `@Transform()` used where input coercion is needed (e.g., string → number from query params)
|
|
96
96
|
|
|
97
97
|
**Guards and roles**
|
|
98
98
|
- Protected endpoints have `@UseGuards(...)` with appropriate guard(s)
|
|
99
|
-
- Role-based access uses `@Roles(...)` decorator with a roles guard — missing guard on an endpoint that should be protected is
|
|
99
|
+
- Role-based access uses `@Roles(...)` decorator with a roles guard — a missing guard on an endpoint that should be protected is rated by the auth-guard row of the conditions table
|
|
100
100
|
- Public endpoints explicitly marked with `@Public()` or equivalent decorator, not just left unguarded
|
|
101
101
|
|
|
102
102
|
**Controller responsibilities**
|
|
103
|
-
- Controllers are thin: no business logic, no direct ORM calls, no computation
|
|
104
|
-
-
|
|
105
|
-
- If business logic is in a controller method, flag as `major` ("move to service layer")
|
|
103
|
+
- Controllers are thin: no business logic, no direct ORM calls, no computation; a method does parse input → delegate to service → return response
|
|
104
|
+
- If business logic is in a controller method, flag it per the controller row of the conditions table (`minor`: "move to service layer")
|
|
106
105
|
|
|
107
106
|
**Service layer**
|
|
108
107
|
- Business logic lives in services
|
|
@@ -131,7 +130,7 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
131
130
|
**Error handling**
|
|
132
131
|
- Async controller methods must have error handling: either `try/catch` or a global exception filter
|
|
133
132
|
- Unhandled promise rejections (async method without try/catch, no global filter) — **blocker**
|
|
134
|
-
- Exception messages must not leak internal details (stack traces, ORM error strings) to the HTTP response — leaking is
|
|
133
|
+
- Exception messages must not leak internal details (stack traces, ORM error strings) to the HTTP response — leaking is rated by the stack-trace row of the conditions table
|
|
135
134
|
- NestJS built-in exceptions (`NotFoundException`, `BadRequestException`, etc.) preferred over generic `Error`
|
|
136
135
|
|
|
137
136
|
---
|
|
@@ -139,7 +138,7 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
139
138
|
### 3. Database Patterns (ORM)
|
|
140
139
|
|
|
141
140
|
**N+1 queries**
|
|
142
|
-
- Relation loaded inside a loop without eager loading (`relations`, `leftJoinAndSelect`) or a DataLoader —
|
|
141
|
+
- Relation loaded inside a loop without eager loading (`relations`, `leftJoinAndSelect`) or a DataLoader — rated by the N+1 row of the conditions table
|
|
143
142
|
- Example: `for (const user of users) { user.orders = await orderRepo.find(...) }` — flag with concrete suggestion to use `relations: ['orders']` or batch query
|
|
144
143
|
|
|
145
144
|
**Transactions**
|
|
@@ -148,9 +147,9 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
148
147
|
- NestJS TypeORM: use `dataSource.transaction(async (manager) => { ... })` or `@Transaction()` decorator pattern
|
|
149
148
|
|
|
150
149
|
**Raw query safety**
|
|
151
|
-
- String interpolation in raw queries
|
|
150
|
+
- String interpolation in raw queries: SQL injection risk, rated by the raw-SQL row of the conditions table
|
|
152
151
|
- Use parameterized queries: `query('SELECT * FROM users WHERE id = $1', [id])`
|
|
153
|
-
- Flag `createQueryBuilder().where('id = ' + id)`
|
|
152
|
+
- Flag `createQueryBuilder().where('id = ' + id)` under that row
|
|
154
153
|
|
|
155
154
|
**Soft deletes**
|
|
156
155
|
- If the project schema uses `deletedAt` / `@DeleteDateColumn()`, deletions must use `.softRemove()` / `.softDelete()`, not `.remove()` / `.delete()`
|
|
@@ -159,7 +158,7 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
|
|
|
159
158
|
**Migration safety**
|
|
160
159
|
- Column removed in migration — check that no application code still references it
|
|
161
160
|
- Dropping a column without a deprecation period in a live system flagged as `major`
|
|
162
|
-
- `NOT NULL` column added without a default value to a populated table —
|
|
161
|
+
- `NOT NULL` column added without a default value to a populated table — `major`; `blocker` only on shown truncation
|
|
163
162
|
|
|
164
163
|
---
|
|
165
164
|
|
|
@@ -205,15 +204,16 @@ is, and a condition that cannot name one is not a `blocker`.
|
|
|
205
204
|
|
|
206
205
|
| Condition | Severity | Shape |
|
|
207
206
|
|---|---|---|
|
|
208
|
-
| Missing DTO validation on an endpoint accepting user input | `blocker` | Exploitable vulnerability |
|
|
209
|
-
| String interpolation in raw SQL query | `blocker` | Exploitable vulnerability |
|
|
210
|
-
| Leaking stack trace / raw ORM error to API response | `blocker` | Exploitable vulnerability
|
|
207
|
+
| Missing DTO validation on an endpoint accepting user input | `blocker` with an attack vector stated (input, entry point, impact — `review-security-code` law); `major` with a named malformed input and wrong outcome; else `info` | Exploitable vulnerability only when the vector is shown |
|
|
208
|
+
| String interpolation in raw SQL query | `blocker` with an attack vector stated (input, entry point, impact); `major` with a named input and wrong outcome; else `info` | Exploitable vulnerability only when the vector is shown |
|
|
209
|
+
| Leaking stack trace / raw ORM error to API response | `blocker` with an attack vector stated (what is disclosed, to whom, through which entry point); `major` when the leak is shown reaching a response; else `info` | Exploitable vulnerability only when the vector is shown; a shown leak is a wrong outcome |
|
|
210
|
+
| Missing auth guard on an endpoint that should be protected | `blocker` with an attack vector stated (caller, entry point, impact); `major` with a named caller and the wrong outcome it gets; else `info` | Exploitable vulnerability only when the vector is shown |
|
|
211
211
|
| `REQUEST`-scoped provider injected into a `Singleton` | `blocker` | Data corruption — one request's state is served to another |
|
|
212
212
|
| Unhandled promise rejection in a controller method | `blocker` | Crash |
|
|
213
|
-
| `NOT NULL` column added without a default to a populated table | `blocker` | Data loss
|
|
214
|
-
| N+1 query (relation loaded in a loop) | `major`
|
|
213
|
+
| `NOT NULL` column added without a default to a populated table | `major` — the migration fails on deploy against existing rows; `blocker` only where the tool shown truncates or backfills wrong values | Data loss only when rows are shown destroyed or wrong. Same rating as `review-highload` |
|
|
214
|
+
| N+1 query (relation loaded in a loop) | `major` with the reachable loop size or call frequency named; else `info` | Cost stated with its frequency; degradation, not an outage |
|
|
215
215
|
| Missing transaction on a multi-step atomic mutation | `major` — `blocker` where a partial write corrupts persisted state | The outcome decides |
|
|
216
|
-
| Business logic in a controller | `major` | Layer violation. Same rating as `review-architecture` |
|
|
216
|
+
| Business logic in a controller | `minor` — `major` only with a concrete defect it causes (trigger and outcome) or a stated project rule it breaks | Layer violation. Same rating as `review-architecture` |
|
|
217
217
|
| Missing pagination on an unbounded list endpoint | `major` — `blocker` where an attacker-reachable request exhausts memory | Degradation vs. crash/DoS |
|
|
218
218
|
|
|
219
219
|
---
|
|
@@ -282,7 +282,7 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
282
282
|
```markdown
|
|
283
283
|
# Backend Review Report
|
|
284
284
|
|
|
285
|
-
|
|
285
|
+
<!-- No merge verdict: the orchestrator owns it. A standalone run summarizes findings only. -->
|
|
286
286
|
|
|
287
287
|
## Summary
|
|
288
288
|
<2-4 sentences covering what changed, overall backend health, key concerns.>
|
|
@@ -343,8 +343,8 @@ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY c
|
|
|
343
343
|
|----------------|-----------------|
|
|
344
344
|
| "ValidationPipe is probably configured somewhere" | Always verify it is applied; assumption lets injection reach service layer |
|
|
345
345
|
| "The N+1 only runs on small datasets now" | Data grows; flag it now with a clear fix, not after the incident |
|
|
346
|
-
| "The controller has some logic but it's minor" |
|
|
347
|
-
| "Stack trace in response only shows in dev" | Config can be wrong in prod;
|
|
346
|
+
| "The controller has some logic but it's minor" | Logic in a controller is `minor` unless a defect is named; say which, do not rate by feeling |
|
|
347
|
+
| "Stack trace in response only shows in dev" | Config can be wrong in prod; report it per the stack-trace row; blocker needs a shown vector |
|
|
348
348
|
| "I'll skip the migration check — it's just a column rename" | Column renames without fallback break zero-downtime deploys |
|
|
349
349
|
|
|
350
350
|
<!-- keryx:layers-block:start -->
|
|
@@ -18,7 +18,7 @@ triggers:
|
|
|
18
18
|
- "Uncle Bob review"
|
|
19
19
|
metadata:
|
|
20
20
|
author: "MrCipherSmith"
|
|
21
|
-
version: "1.
|
|
21
|
+
version: "1.2.0"
|
|
22
22
|
category: "review"
|
|
23
23
|
compatible_harnesses: "cursor,codex,zed,opencode,claude"
|
|
24
24
|
license: "MIT"
|
|
@@ -27,7 +27,7 @@ license: "MIT"
|
|
|
27
27
|
# Review: Clean Code + SOLID
|
|
28
28
|
|
|
29
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).
|
|
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.
|
|
31
31
|
|
|
32
32
|
The goal is not stylistic nitpicking — every finding here points to a concrete
|
|
33
33
|
maintainability, readability, or extensibility problem that will cause friction
|
|
@@ -162,7 +162,7 @@ Clean Code guideline: functions should do **one thing** at one level of abstract
|
|
|
162
162
|
- [ ] Functions with a `And` or `Or` in the name, describing two operations
|
|
163
163
|
|
|
164
164
|
Flags:
|
|
165
|
-
- Function body >40 lines — **
|
|
165
|
+
- Function body >40 lines — **minor** (clear overload; flag specific function by name)
|
|
166
166
|
- Function body 20–40 lines with visible mixed abstraction — **minor**
|
|
167
167
|
- `doXAndY()` naming explicitly stating two operations — **minor**
|
|
168
168
|
|
|
@@ -176,8 +176,8 @@ Flags:
|
|
|
176
176
|
- [ ] Output arguments: a function that mutates its argument instead of returning a value (`populate(result)`)
|
|
177
177
|
|
|
178
178
|
Flags:
|
|
179
|
-
- Function with ≥4 parameters not using an options/config object — **
|
|
180
|
-
- Boolean flag parameter (`enabled: boolean`) passed to control function flow — **
|
|
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
181
|
- Output argument (mutating parameter instead of returning) — **minor**
|
|
182
182
|
- Three parameters where a plain named object would be clearer — **minor**
|
|
183
183
|
|
|
@@ -270,8 +270,8 @@ These are the correct uses of comments — do NOT flag:
|
|
|
270
270
|
- [ ] `catch (err: any)` — loses type safety; use `catch (err: unknown)`
|
|
271
271
|
|
|
272
272
|
Flags:
|
|
273
|
-
- `catch` block with empty body or only a comment — **major** (silent failure)
|
|
274
|
-
- Returning `null` / `undefined` from a function to signal "not found" in a critical path — **major**
|
|
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
275
|
- Log + rethrow in the same catch block — **minor**
|
|
276
276
|
- Untyped error in catch — **minor**
|
|
277
277
|
|
|
@@ -295,7 +295,7 @@ Flags:
|
|
|
295
295
|
- [ ] Multiple functions doing the same transformation with slightly different wrapping
|
|
296
296
|
|
|
297
297
|
Flags:
|
|
298
|
-
- 3+ identical or near-identical blocks in the diff that could be extracted — **
|
|
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
299
|
- 2 occurrences — **minor** (note, do not raise unless the pattern is clearly intentional duplication)
|
|
300
300
|
|
|
301
301
|
#### E2. Magic Numbers and Strings
|
|
@@ -323,8 +323,8 @@ A class should have **one reason to change**: one owner (one part of the system
|
|
|
323
323
|
- [ ] A constructor that does real work: making network calls, reading files, computing state — constructors should only assign
|
|
324
324
|
|
|
325
325
|
Flags:
|
|
326
|
-
- Class with two clearly distinct responsibilities that have different change drivers — **
|
|
327
|
-
- Constructor performing I/O or async operations — **major**
|
|
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
328
|
- Service method doing validation + transformation + persistence inline — **minor**
|
|
329
329
|
|
|
330
330
|
#### F2. Open/Closed Principle (OCP)
|
|
@@ -348,8 +348,8 @@ Subtypes must be substitutable for their base types without changing the program
|
|
|
348
348
|
- [ ] Override that weakens postconditions (returns less than the parent guarantees)
|
|
349
349
|
|
|
350
350
|
Flags:
|
|
351
|
-
- Override throwing "not supported" — **major**
|
|
352
|
-
- Override requiring `instanceof` self-check — **
|
|
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
353
|
|
|
354
354
|
#### F4. Interface Segregation Principle (ISP)
|
|
355
355
|
|
|
@@ -369,7 +369,7 @@ High-level modules should not depend on low-level modules. Both should depend on
|
|
|
369
369
|
- [ ] Class importing a concrete implementation class from another module instead of an interface/abstract class
|
|
370
370
|
|
|
371
371
|
Flags:
|
|
372
|
-
- `new ConcreteService()` inside a class method that should receive it via DI — **
|
|
372
|
+
- `new ConcreteService()` inside a class method that should receive it via DI — **minor**
|
|
373
373
|
- Import of concrete implementation where an interface or abstract type exists — **minor**
|
|
374
374
|
|
|
375
375
|
---
|
|
@@ -445,9 +445,9 @@ conditions land under that rubric, not a second rubric.
|
|
|
445
445
|
|---|---|---|
|
|
446
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
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 | `major`
|
|
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
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 comment; magic number; 20–40 line function; OCP/ISP smell; log-and-rethrow | `minor` | Same |
|
|
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
451
|
| Stylistic opinion; a future issue with no current violation | `info` | Neither trigger nor a named maintenance cost |
|
|
452
452
|
|
|
453
453
|
**Clean Code findings are `minor` by default.** A long function with a named
|
|
@@ -16,7 +16,7 @@ triggers:
|
|
|
16
16
|
- "review core boundaries"
|
|
17
17
|
metadata:
|
|
18
18
|
author: "MrCipherSmith"
|
|
19
|
-
version: "1.
|
|
19
|
+
version: "1.1.0"
|
|
20
20
|
category: "review"
|
|
21
21
|
license: "MIT"
|
|
22
22
|
---
|
|
@@ -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).
|
|
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.
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -14,7 +14,7 @@ triggers:
|
|
|
14
14
|
- "degradation against the base branch"
|
|
15
15
|
metadata:
|
|
16
16
|
author: "MrCipherSmith"
|
|
17
|
-
version: "1.
|
|
17
|
+
version: "1.3.0"
|
|
18
18
|
category: "review"
|
|
19
19
|
compatible_harnesses: "cursor,codex,zed,opencode,claude"
|
|
20
20
|
origin: "authored"
|
|
@@ -33,7 +33,7 @@ How this differs from `review-regression`, before anything else:
|
|
|
33
33
|
|
|
34
34
|
`review-regression` is untouched by this reviewer and keeps its own screen. Do not re-file its findings; do not widen yours into its question.
|
|
35
35
|
|
|
36
|
-
Your inputs are the reviewer payload only; session memory and earlier conversation are not inputs. You run no command unless your payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where your host gives a read-only child git (keryx shell does not: there the payload supplies the history).
|
|
36
|
+
Your inputs are the reviewer payload only; session memory and earlier conversation are not inputs. You run no command unless your payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where your 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`); you never write in the reviewed tree.
|
|
37
37
|
|
|
38
38
|
## The one question
|
|
39
39
|
|
|
@@ -65,12 +65,12 @@ minor, major or blocker carries one `evidence_kind`, and `evidence` says what yo
|
|
|
65
65
|
|---|---|
|
|
66
66
|
| `probe` | you ran the code, or a script against it, on head and on base, and the outputs differ |
|
|
67
67
|
| `consumer-trace` | you followed a consumer of the changed symbol to its effect, file by file |
|
|
68
|
-
| `merge-trace` |
|
|
69
|
-
| `red-test` |
|
|
68
|
+
| `merge-trace` | two heads were merged (run: scratch copy, orchestrator, verify-run) or the merge was traced by reading both diffs, to show what the second drops |
|
|
69
|
+
| `red-test` | a test fails on the head and passes on the base: an existing named test, run on head and base by the orchestrator (`keryx review verify-run`), or one written and run in a scratch copy (`keryx review mutate`) |
|
|
70
70
|
| `base-diff` | you read the same path on base and on head and quote both |
|
|
71
71
|
|
|
72
|
-
`probe
|
|
73
|
-
`run-tests
|
|
72
|
+
`probe` runs code, so it needs `allowed_tools` to include `run-tests`. A run `red-test` or `merge-trace` also write, and never in the reviewed tree (other reviewers read it at once): they count only when the orchestrator produced them (`keryx review verify-run`) or they ran in a scratch copy (`keryx review mutate`). A merge you traced by reading both diffs is `merge-trace` too and a read-only reviewer may file it, saying in `evidence` that it was read, not run; any other unrun trace is stated in prose, labelled unrun.
|
|
73
|
+
Without `run-tests`, `consumer-trace` and `base-diff` are still evidence: a trigger and outcome you
|
|
74
74
|
read in the code is a finding, `major` when a user who reaches it gets a wrong, lost or blocked result.
|
|
75
75
|
A question is for what the code cannot answer (a backend reply, data, timing), not for what you did not run.
|
|
76
76
|
|
|
@@ -84,7 +84,7 @@ and lists it in `scope.md` under `## Degradation evidence screen` with the rule
|
|
|
84
84
|
- the diff, and the PR description when there is one;
|
|
85
85
|
- the importers of the module that holds each changed shared export (and of a barrel that re-exports it), from the code graph, under one cap shared by all exports, with what it dropped. Trace those first. If the cap dropped consumers, say so in your summary; do not imply a complete sweep.
|
|
86
86
|
Where the graph lists no importers for a changed export (a barrel, a re-export, a file it has no node for), search for the users of the symbol, mark them `search-derived` in `enumeration_method`, and name in the summary the exports the graph could not answer;
|
|
87
|
-
- the flow's frozen acceptance criteria, and the previous round's findings.
|
|
87
|
+
- the flow's frozen acceptance criteria (none supplied: use the PR body or issue the payload carries, else say in the summary that no criteria were supplied), and the previous round's findings.
|
|
88
88
|
|
|
89
89
|
## How to look
|
|
90
90
|
|
|
@@ -16,7 +16,7 @@ triggers:
|
|
|
16
16
|
- "reactflow review"
|
|
17
17
|
metadata:
|
|
18
18
|
author: "MrCipherSmith"
|
|
19
|
-
version: "1.
|
|
19
|
+
version: "1.1.0"
|
|
20
20
|
category: "review"
|
|
21
21
|
license: "MIT"
|
|
22
22
|
---
|
|
@@ -24,7 +24,7 @@ license: "MIT"
|
|
|
24
24
|
# Review — Flow Graph Abstractions
|
|
25
25
|
|
|
26
26
|
Reviewer for reusable ReactFlow/graph integration layers. Use it when a repository has a shared
|
|
27
|
-
graph surface consumed by domain modules. 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
|
+
graph surface consumed by domain modules. 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.
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
@@ -5,7 +5,7 @@ description: "Use when a frontend review is requested, checking React component
|
|
|
5
5
|
triggers: ["frontend review", "component review", "ui review", "review React", "review components"]
|
|
6
6
|
metadata:
|
|
7
7
|
author: "MrCipherSmith"
|
|
8
|
-
version: "1.
|
|
8
|
+
version: "1.5.0"
|
|
9
9
|
category: "review"
|
|
10
10
|
compatible_harnesses: "cursor,codex,zed,opencode,claude"
|
|
11
11
|
stack_requires: "react,mobx"
|
|
@@ -17,9 +17,9 @@ license: "MIT"
|
|
|
17
17
|
|
|
18
18
|
## Purpose
|
|
19
19
|
|
|
20
|
-
Validates frontend-specific patterns in the changed code of the current branch. Covers React component correctness (observer wrapping, MVVM boundary, useEffect misuse, accessibility basics, key props), full MobX store patterns (structure, member ordering, accessibility modifiers, observable collections, reactions, async actions, bidirectional sync, lifecycle, API placement), and TypeScript safety. 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).
|
|
20
|
+
Validates frontend-specific patterns in the changed code of the current branch. Covers React component correctness (observer wrapping, MVVM boundary, useEffect misuse, accessibility basics, key props), full MobX store patterns (structure, member ordering, accessibility modifiers, observable collections, reactions, async actions, bidirectional sync, lifecycle, API placement), and TypeScript safety. 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.
|
|
21
21
|
|
|
22
|
-
This skill consolidates what
|
|
22
|
+
This skill consolidates what two earlier profiles (a style one and a MobX store one, both removed) used to split between them, so it is the one reviewer for frontend style, MobX and store changes.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -47,7 +47,7 @@ This skill consolidates what was previously split between `code-style-review` (f
|
|
|
47
47
|
| Cross-layer architecture (service layer design, module boundaries) | NO | `review-architecture` |
|
|
48
48
|
| Security vulnerabilities (XSS, injection, auth gaps) | NO | `review-security-code` |
|
|
49
49
|
| Performance bottlenecks (N+1, bundle size, re-render frequency) | NO | `review-performance` |
|
|
50
|
-
| Code style, naming outside frontend conventions | NO | `
|
|
50
|
+
| Code style, naming outside frontend conventions | NO | `review-style` |
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
@@ -67,9 +67,8 @@ boundary is the trigger-and-outcome test.
|
|
|
67
67
|
|
|
68
68
|
### Frontend / MobX laws
|
|
69
69
|
|
|
70
|
-
These say what is **always reported**.
|
|
71
|
-
|
|
72
|
-
not a second opinion.
|
|
70
|
+
These say what is **always reported**. Its severity is the conditions table under
|
|
71
|
+
Finding Format — the canonical rubric applied, not a second opinion.
|
|
73
72
|
|
|
74
73
|
1. **Every observable mutation outside an action or `runInAction` is reported.**
|
|
75
74
|
No exception for "small stores" or "simple assignments".
|
|
@@ -140,7 +139,7 @@ If no CLAUDE.md is found, proceed normally. CLAUDE.md is optional and non-blocki
|
|
|
140
139
|
|
|
141
140
|
Flags:
|
|
142
141
|
- Component reads `store.*` or `useLocalObservable` result but is not wrapped in `observer` — **major** (stale UI; not one of the four merge-blocking shapes)
|
|
143
|
-
- `observer` applied inside another HOC wrapper instead of outside — **major**
|
|
142
|
+
- `observer` applied inside another HOC wrapper instead of outside — **minor** (layer-violation rule; **major** only with a named defect it causes)
|
|
144
143
|
|
|
145
144
|
#### A2. MVVM Boundary (Business Logic in Store, Not Component)
|
|
146
145
|
|
|
@@ -150,8 +149,8 @@ Flags:
|
|
|
150
149
|
- [ ] Computed/derived values MUST be `@computed` getters in the store, not inline derivations in the component body
|
|
151
150
|
|
|
152
151
|
Flags:
|
|
153
|
-
- `fetch()` / `axios` / `httpClient` call directly in component (hook or handler) — **
|
|
154
|
-
- Business logic (conditionals, transformations, validation) inside a component event handler instead of a store method — **
|
|
152
|
+
- `fetch()` / `axios` / `httpClient` call directly in component (hook or handler) — **minor** (layer violation; **major** only with a named defect it causes or a stated project rule; same as `review-architecture`)
|
|
153
|
+
- Business logic (conditionals, transformations, validation) inside a component event handler instead of a store method — **minor** (layer violation, same condition)
|
|
155
154
|
- Derived value computed inline in component that could be a `@computed` getter — **minor**
|
|
156
155
|
|
|
157
156
|
#### A3. useEffect Misuse
|
|
@@ -163,9 +162,9 @@ Flags:
|
|
|
163
162
|
- [ ] Every `useEffect` that creates a subscription, timer, or listener MUST return a cleanup function
|
|
164
163
|
|
|
165
164
|
Flags:
|
|
166
|
-
- `useEffect` calls `store.loadX()`, or a child store's `init()` that the parent store owns — **major**
|
|
167
|
-
- `useEffect` contains `fetch()` or IO — **
|
|
168
|
-
- `useEffect` contains business logic / state derivation — **
|
|
165
|
+
- `useEffect` calls `store.loadX()`, or a child store's `init()` that the parent store owns — **minor** (layer-violation rule, as a direct fetch in a component; **major** only with a named defect; the `onMount()` / `onUnmount()` bridge form is not this)
|
|
166
|
+
- `useEffect` contains `fetch()` or IO — **minor** (API in component; layer-violation rule)
|
|
167
|
+
- `useEffect` contains business logic / state derivation — **minor** (layer-violation rule)
|
|
169
168
|
- `useEffect` creates a subscription/timer/listener with no cleanup return — **major** (memory leak)
|
|
170
169
|
|
|
171
170
|
#### A4. Key Props on Lists
|
|
@@ -237,19 +236,21 @@ Decision rule for inter-store callbacks: ask "Is this called from JSX or a React
|
|
|
237
236
|
|
|
238
237
|
Flags:
|
|
239
238
|
- `public` keyword on any member — **minor** (ESLint `no-public` already fails CI; a reviewer restating a lint rule is not a merge gate)
|
|
240
|
-
- `onChangeX`, `onFireX`, `handleX`, `syncX` without `private` — **
|
|
241
|
-
- Missing `private` on internal state or helper methods — **
|
|
242
|
-
- Missing `private readonly` on injected dependencies — **minor**
|
|
239
|
+
- `onChangeX`, `onFireX`, `handleX`, `syncX` without `private` — **minor**
|
|
240
|
+
- Missing `private` on internal state or helper methods — **minor**
|
|
241
|
+
- Missing `private readonly` on a private field that is never reassigned (injected dependencies, immutable configuration) — **minor**
|
|
243
242
|
|
|
244
243
|
#### B4. Observable Collections
|
|
245
244
|
|
|
246
245
|
- [ ] `IObservableArray` MUST be mutated in place using MobX methods (`.replace()`, `.push()`, `.splice()`, etc.) inside `runInAction` — never reassigned
|
|
247
246
|
- [ ] `ObservableMap` MUST be mutated using `.set()`, `.delete()`, `.merge()`, `.replace()` — never reassigned
|
|
248
247
|
- [ ] Deep `@observable` on a large external object/instance should use `@observable.ref` instead
|
|
248
|
+
- [ ] A list of plain items that is replaced whole and never mutated per element uses `@observable.shallow` (or `.ref`), not deep `@observable`
|
|
249
249
|
|
|
250
250
|
Flags:
|
|
251
251
|
- `IObservableArray` field reassigned instead of using `.replace()` — **major**
|
|
252
252
|
- `ObservableMap` field reassigned instead of `.replace()` or `.merge()` — **major**
|
|
253
|
+
- Deep `@observable` on a list of plain items that is only ever replaced whole — **minor**
|
|
253
254
|
- Observable mutation outside `runInAction` in async context — **major**, or **blocker** where the interleaving can corrupt persisted state (frontend law 1)
|
|
254
255
|
|
|
255
256
|
#### B5. Reactions and Disposers
|
|
@@ -282,7 +283,7 @@ Flags:
|
|
|
282
283
|
Flags:
|
|
283
284
|
- Public UI method missing `@action.bound` — **major**
|
|
284
285
|
- Public helper method marked `@action.bound` but does not mutate state — **minor**
|
|
285
|
-
- Public async action doing API/IO directly instead of delegating to private — **major**
|
|
286
|
+
- Public async action doing API/IO directly instead of delegating to private — **minor** (layer-violation rule; **major** only with a named defect)
|
|
286
287
|
- State mutation after `await` outside `runInAction` — **major**, or **blocker** where the interleaving can corrupt persisted state (frontend law 1)
|
|
287
288
|
- Missing `try/catch/finally` on private async method owning loading flags — **major**
|
|
288
289
|
- `catch (err: any)` instead of `catch (err: unknown)` — **minor**
|
|
@@ -301,8 +302,8 @@ Patterns that MUST be `private` unless called from JSX:
|
|
|
301
302
|
The test: "Is this method called from JSX or passed as a React event handler prop?" If NO — it is `private`, full stop.
|
|
302
303
|
|
|
303
304
|
Flags:
|
|
304
|
-
- Public method matching `onChangeX`, `onFireX`, `handleX`, `syncX` naming not called from components — **
|
|
305
|
-
- Inter-store callback without `private` — **
|
|
305
|
+
- Public method matching `onChangeX`, `onFireX`, `handleX`, `syncX` naming not called from components — **minor**
|
|
306
|
+
- Inter-store callback without `private` — **minor**
|
|
306
307
|
- `@action.bound` on a `private` method that is not passed as a callback reference — **minor**
|
|
307
308
|
|
|
308
309
|
#### B8. Bidirectional Sync Bounce Protection
|
|
@@ -310,8 +311,8 @@ Flags:
|
|
|
310
311
|
When two stores synchronize state in both directions, at least one direction MUST have an equality guard (`if (newValue !== currentValue)`) before writing to the other store. Without this, changes bounce indefinitely.
|
|
311
312
|
|
|
312
313
|
Flags:
|
|
313
|
-
- Bidirectional store sync without equality guard — **blocker**
|
|
314
|
-
- Store A writes to Store B in a callback from Store B without `!==` check —
|
|
314
|
+
- Bidirectional store sync without equality guard — **blocker** only when a named trigger reaches the loop and it kills the render (crash); **major** for a reachable hang; **info** with no path shown
|
|
315
|
+
- Store A writes to Store B in a callback from Store B without `!==` check — same condition as the line above
|
|
315
316
|
- Truthy guard (`if (value)`) on optional/nullable field instead of equality check in sync logic — **major**
|
|
316
317
|
|
|
317
318
|
#### B9. API Calls Placement
|
|
@@ -321,8 +322,8 @@ Flags:
|
|
|
321
322
|
- [ ] Components MUST NOT call APIs directly (fetch, axios, httpClient, service.callX) — even inside `useEffect`
|
|
322
323
|
|
|
323
324
|
Flags:
|
|
324
|
-
- API call inside a public `@action.bound` method body — **major**
|
|
325
|
-
- API call in a component (hook, handler, useEffect) — **
|
|
325
|
+
- API call inside a public `@action.bound` method body — **minor** (layer-violation rule; **major** only with a named defect)
|
|
326
|
+
- API call in a component (hook, handler, useEffect) — **minor** (frontend law 3; layer-violation rule)
|
|
326
327
|
|
|
327
328
|
#### B10. Lifecycle Initialization and Disposal
|
|
328
329
|
|
|
@@ -332,7 +333,7 @@ Flags:
|
|
|
332
333
|
- [ ] Store `dispose()` MUST set `this.disposed = true` before canceling async work
|
|
333
334
|
|
|
334
335
|
Flags:
|
|
335
|
-
- Component `useEffect` calls `store.loadX()`, or a child store's `init()` / `onMount()` that the parent store owns — **
|
|
336
|
+
- Component `useEffect` calls `store.loadX()`, or a child store's `init()` / `onMount()` that the parent store owns — **minor** (as above). Do not flag the bridge `useEffect(() => { store.onMount(); return () => store.onUnmount(); }, [store])`
|
|
336
337
|
- Parent store does not call `child.dispose()` in `onUnmount()` / `dispose()` — **major**
|
|
337
338
|
- Missing `disposed` flag in store with async operations — **major**
|
|
338
339
|
|
|
@@ -345,12 +346,14 @@ Flags:
|
|
|
345
346
|
- [ ] No `!` non-null assertion without a comment proving the value cannot be null/undefined at that point
|
|
346
347
|
- [ ] Props interface MUST use `I` prefix: `interface IMyComponentProps { ... }`
|
|
347
348
|
- [ ] Prefer optional chaining (`?.`) and nullish coalescing (`??`) over `!` assertions
|
|
349
|
+
- [ ] A store's state and its public API are typed with explicit interfaces/types, not inferred object literals or `any`
|
|
348
350
|
- [ ] `catch (err: unknown)` — typed error handling, not `catch (err)` or `catch (err: any)`
|
|
349
351
|
|
|
350
352
|
Flags:
|
|
351
|
-
- `any` type in new code — **major**
|
|
353
|
+
- `any` type in new code — **minor** (**major** only with a named input and the wrong value it lets through)
|
|
352
354
|
- `!` non-null assertion without justification comment — **minor**
|
|
353
355
|
- Props interface without `I` prefix — **minor**
|
|
356
|
+
- Store state or public API left to an inferred object-literal type — **minor**
|
|
354
357
|
- `catch (err: any)` — **minor**
|
|
355
358
|
|
|
356
359
|
---
|
|
@@ -457,7 +460,7 @@ This is the correct lifecycle bridge — do not flag it under A3 or B10. Those r
|
|
|
457
460
|
|
|
458
461
|
Distinction:
|
|
459
462
|
- `useEffect(() => { store.onMount(); return () => store.onUnmount(); }, [store])` — correct lifecycle bridge — **do not flag**
|
|
460
|
-
- `useEffect(() => { store.loadData(); }, [])` or `useEffect(() => { store.childStore.init(); }, [])` — data trigger, or a child store's lifecycle the parent store owns, run from the component — **
|
|
463
|
+
- `useEffect(() => { store.loadData(); }, [])` or `useEffect(() => { store.childStore.init(); }, [])` — data trigger, or a child store's lifecycle the parent store owns, run from the component — **minor** (A3 / B10, regardless of project conventions); **major** only with a named defect (trigger and wrong outcome)
|
|
461
464
|
|
|
462
465
|
#### D7. JSX and Naming Conventions
|
|
463
466
|
|
|
@@ -559,7 +562,8 @@ conditions land under that rubric, not a second rubric.
|
|
|
559
562
|
| A render path that throws on an input the change admits | `blocker` | Crash |
|
|
560
563
|
| Missing `observer()` on a component that reads observables | `major` | Named trigger (the observable changes) and named outcome (the UI does not update). Stale UI is not a crash, data loss, vulnerability, or missing acceptance criterion |
|
|
561
564
|
| Observable mutation outside an action or `runInAction` | `major` — `blocker` only where the interleaving can corrupt persisted state | Same wording as `review-logic` and `review-highload` for a race: the outcome decides |
|
|
562
|
-
| API/IO call in a component | `major` | Layer violation. Identical to `review-architecture`'s rule for the same condition
|
|
565
|
+
| API/IO call in a component; business logic in a component | `minor` — `major` only with a named defect it causes (trigger and outcome) or a stated project rule | Layer violation: structural. Identical to `review-architecture`'s rule for the same condition |
|
|
566
|
+
| Bidirectional sync without an equality guard | `blocker` when a named trigger reaches the loop and the render dies; `major` for a reachable hang; `info` with no path | The outcome and its reachability decide, not the pattern |
|
|
563
567
|
| `useState` for store-managed state; `useMemo` for a derived store value; a store constructed in the component body | `major` | Named trigger (a re-render) and named outcome (state lost or recreated) |
|
|
564
568
|
| `public` on a class member; `useCallback` around a store method; a store created with `useMemo` instead of `useLocalObservable`; an unprivate inter-store callback | `minor` | The code behaves correctly. A lint rule that fails CI is caught by the machine, not by a reviewer, and the cost is to the next editor |
|
|
565
569
|
| Observation with no concrete bug | `info` | Shared laws 1 and 2 |
|
|
@@ -573,13 +577,13 @@ Stop and re-read these rules if you are thinking:
|
|
|
573
577
|
| Rationalization | Why it's wrong |
|
|
574
578
|
|---|---|
|
|
575
579
|
| "The store is small, no need for full observer wrapping" | Missing `observer()` is reported regardless of store size — frontend law 2. It is `major`, not `blocker`: stale UI is not one of the four shapes |
|
|
576
|
-
| "The mutation happens in a non-async method, so runInAction isn't needed" | Mutations outside action/runInAction are always
|
|
577
|
-
| "I'll
|
|
580
|
+
| "The mutation happens in a non-async method, so runInAction isn't needed" | Mutations outside action/runInAction are always reported — frontend law 1; the conditions table sets the level |
|
|
581
|
+
| "I'll skip the API call in component to avoid friction" | API in a component is always reported — frontend law 3; `minor` unless a named defect or a stated project rule makes it `major`, as in `review-architecture` |
|
|
578
582
|
| "The `public` keyword is just a style issue, I'll call it minor" | It is `minor` — but still reported. The linter fails CI on it, which is why a reviewer does not need to block merge on it too |
|
|
579
583
|
| "This inter-store callback works fine as public" | Frontend law 5: if it is not called from JSX, it must be `private` |
|
|
580
584
|
| "No spec compliance check needed for this skill" | Correct — this skill covers Stage 2 (code quality) only; spec compliance is handled by the orchestrator or review-logic |
|
|
581
585
|
| "I can suggest adding useCallback everywhere for safety" | With MobX+observer, useCallback is rarely needed and adds noise; only flag when concretely justified |
|
|
582
|
-
| "The bidirectional sync looks fine, no equality guard needed" | Bidirectional sync without equality guard is
|
|
586
|
+
| "The bidirectional sync looks fine, no equality guard needed" | Bidirectional sync without an equality guard is always reported; its level follows the conditions table (reachability decides) |
|
|
583
587
|
|
|
584
588
|
---
|
|
585
589
|
|
|
@@ -14,7 +14,7 @@ description: |
|
|
|
14
14
|
triggers: ["frontend conventions", "local frontend rules", "CLAUDE frontend", "review frontend conventions"]
|
|
15
15
|
metadata:
|
|
16
16
|
author: "MrCipherSmith"
|
|
17
|
-
version: "1.
|
|
17
|
+
version: "1.1.0"
|
|
18
18
|
category: "review"
|
|
19
19
|
stack_requires: "react,mobx"
|
|
20
20
|
overlap_group: "frontend"
|
|
@@ -26,7 +26,7 @@ license: "MIT"
|
|
|
26
26
|
|
|
27
27
|
Reviewer for frontend repository conventions that are more specific than generic React/MobX
|
|
28
28
|
correctness. Use it alongside `review-frontend`, `review-style`, `review-performance`, and
|
|
29
|
-
`review-logic`. 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
|
+
`review-logic`. 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.
|
|
30
30
|
|
|
31
31
|
Before reviewing, read the nearest project guide files if they exist: root `CLAUDE.md`,
|
|
32
32
|
`AGENTS.md`, `.junie/guidelines.md`, `ARCHITECTURE.md`, and module-level `CLAUDE.md` files.
|