@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.
Files changed (132) hide show
  1. package/dist/cli.js +4916 -3655
  2. package/dist/core.js +91 -28
  3. package/dist/keryx-general-worker-entry.js +413 -240
  4. package/package.json +1 -1
  5. package/src/gdskills/bundled/install-manifest.json +3 -0
  6. package/src/gdskills/bundled/rules/core/api-contracts.mdc +21 -136
  7. package/src/gdskills/bundled/rules/core/async-patterns.mdc +18 -171
  8. package/src/gdskills/bundled/rules/core/clean-architecture.mdc +40 -150
  9. package/src/gdskills/bundled/rules/core/cli-interface-design.mdc +63 -194
  10. package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +36 -48
  11. package/src/gdskills/bundled/rules/core/concurrency-patterns.mdc +32 -0
  12. package/src/gdskills/bundled/rules/core/database-patterns.mdc +26 -148
  13. package/src/gdskills/bundled/rules/core/error-handling.mdc +57 -109
  14. package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +14 -29
  15. package/src/gdskills/bundled/rules/core/layout-rendering.mdc +51 -0
  16. package/src/gdskills/bundled/rules/core/mobx-store-template.mdc +69 -511
  17. package/src/gdskills/bundled/rules/core/nestjs-dto.mdc +18 -36
  18. package/src/gdskills/bundled/rules/core/playwright-testing.mdc +35 -308
  19. package/src/gdskills/bundled/rules/core/security-baseline.mdc +18 -140
  20. package/src/gdskills/bundled/rules/core/skill-authoring.mdc +190 -0
  21. package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +5 -0
  22. package/src/gdskills/bundled/rules/core/solid-principles.mdc +70 -121
  23. package/src/gdskills/bundled/rules/core/storybook-guidelines.mdc +20 -22
  24. package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +37 -74
  25. package/src/gdskills/bundled/rules/core/ui-anti-slop.mdc +48 -37
  26. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +2 -2
  27. package/src/gdskills/bundled/skills/quality/deprecation-path/SKILL.md +1 -1
  28. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +1 -1
  29. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +25 -61
  30. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +15 -69
  31. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +84 -418
  32. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +2 -2
  33. package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +1 -1
  34. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +1 -1
  35. package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +17 -311
  36. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +8 -22
  37. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +84 -228
  38. package/src/gdskills/bundled/skills/review/review-layout/SKILL.md +22 -28
  39. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +9 -10
  40. package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +16 -38
  41. package/src/gdskills/bundled/skills/review/review-premise/SKILL.md +1 -1
  42. package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +1 -1
  43. package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +8 -8
  44. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +49 -88
  45. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +22 -40
  46. package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +42 -82
  47. package/src/gdskills/bundled/stacks/angular/rules/coding-style.mdc +15 -57
  48. package/src/gdskills/bundled/stacks/angular/rules/patterns.mdc +16 -60
  49. package/src/gdskills/bundled/stacks/angular/rules/security.mdc +11 -49
  50. package/src/gdskills/bundled/stacks/angular/rules/testing.mdc +13 -52
  51. package/src/gdskills/bundled/stacks/c-cpp/rules/coding-style.mdc +33 -57
  52. package/src/gdskills/bundled/stacks/c-cpp/rules/patterns.mdc +35 -62
  53. package/src/gdskills/bundled/stacks/c-cpp/rules/security.mdc +35 -62
  54. package/src/gdskills/bundled/stacks/c-cpp/rules/testing.mdc +34 -54
  55. package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/patterns.mdc +27 -56
  56. package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/security.mdc +51 -119
  57. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/coding-style.mdc +42 -74
  58. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/patterns.mdc +45 -83
  59. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/security.mdc +34 -59
  60. package/src/gdskills/bundled/stacks/csharp-dotnet/rules/testing.mdc +33 -62
  61. package/src/gdskills/bundled/stacks/django/rules/coding-style.mdc +15 -56
  62. package/src/gdskills/bundled/stacks/django/rules/patterns.mdc +16 -68
  63. package/src/gdskills/bundled/stacks/django/rules/security.mdc +13 -71
  64. package/src/gdskills/bundled/stacks/django/rules/testing.mdc +16 -62
  65. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/coding-style.mdc +30 -53
  66. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/patterns.mdc +20 -56
  67. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/security.mdc +52 -122
  68. package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/testing.mdc +23 -42
  69. package/src/gdskills/bundled/stacks/fastapi/rules/coding-style.mdc +13 -47
  70. package/src/gdskills/bundled/stacks/fastapi/rules/patterns.mdc +18 -81
  71. package/src/gdskills/bundled/stacks/fastapi/rules/security.mdc +13 -75
  72. package/src/gdskills/bundled/stacks/fastapi/rules/testing.mdc +14 -58
  73. package/src/gdskills/bundled/stacks/flutter-dart/rules/coding-style.mdc +36 -74
  74. package/src/gdskills/bundled/stacks/flutter-dart/rules/patterns.mdc +30 -66
  75. package/src/gdskills/bundled/stacks/flutter-dart/rules/security.mdc +33 -67
  76. package/src/gdskills/bundled/stacks/flutter-dart/rules/testing.mdc +41 -73
  77. package/src/gdskills/bundled/stacks/go/rules/coding-style.mdc +36 -57
  78. package/src/gdskills/bundled/stacks/go/rules/patterns.mdc +27 -42
  79. package/src/gdskills/bundled/stacks/go/rules/security.mdc +26 -43
  80. package/src/gdskills/bundled/stacks/go/rules/testing.mdc +23 -41
  81. package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/coding-style.mdc +21 -40
  82. package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/patterns.mdc +26 -43
  83. package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/security.mdc +25 -37
  84. package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/testing.mdc +34 -50
  85. package/src/gdskills/bundled/stacks/kotlin-android/rules/coding-style.mdc +28 -65
  86. package/src/gdskills/bundled/stacks/kotlin-android/rules/patterns.mdc +34 -78
  87. package/src/gdskills/bundled/stacks/kotlin-android/rules/security.mdc +35 -68
  88. package/src/gdskills/bundled/stacks/kotlin-android/rules/testing.mdc +34 -68
  89. package/src/gdskills/bundled/stacks/mobx/rules/coding-style.mdc +18 -64
  90. package/src/gdskills/bundled/stacks/mobx/rules/patterns.mdc +13 -66
  91. package/src/gdskills/bundled/stacks/mobx/rules/security.mdc +8 -35
  92. package/src/gdskills/bundled/stacks/mobx/rules/testing.mdc +10 -39
  93. package/src/gdskills/bundled/stacks/nestjs/rules/coding-style.mdc +32 -45
  94. package/src/gdskills/bundled/stacks/nestjs/rules/patterns.mdc +40 -60
  95. package/src/gdskills/bundled/stacks/nestjs/rules/security.mdc +30 -50
  96. package/src/gdskills/bundled/stacks/nestjs/rules/testing.mdc +27 -47
  97. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/coding-style.mdc +14 -48
  98. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/patterns.mdc +15 -67
  99. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/security.mdc +12 -50
  100. package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/testing.mdc +11 -43
  101. package/src/gdskills/bundled/stacks/php-laravel/rules/coding-style.mdc +17 -58
  102. package/src/gdskills/bundled/stacks/php-laravel/rules/patterns.mdc +15 -56
  103. package/src/gdskills/bundled/stacks/php-laravel/rules/security.mdc +13 -50
  104. package/src/gdskills/bundled/stacks/php-laravel/rules/testing.mdc +14 -55
  105. package/src/gdskills/bundled/stacks/python/rules/coding-style.mdc +13 -41
  106. package/src/gdskills/bundled/stacks/python/rules/patterns.mdc +20 -61
  107. package/src/gdskills/bundled/stacks/python/rules/security.mdc +15 -57
  108. package/src/gdskills/bundled/stacks/python/rules/testing.mdc +16 -50
  109. package/src/gdskills/bundled/stacks/react/rules/coding-style.mdc +14 -40
  110. package/src/gdskills/bundled/stacks/react/rules/patterns.mdc +15 -55
  111. package/src/gdskills/bundled/stacks/react/rules/security.mdc +13 -49
  112. package/src/gdskills/bundled/stacks/react/rules/testing.mdc +10 -37
  113. package/src/gdskills/bundled/stacks/ruby-rails/rules/coding-style.mdc +15 -48
  114. package/src/gdskills/bundled/stacks/ruby-rails/rules/patterns.mdc +18 -67
  115. package/src/gdskills/bundled/stacks/ruby-rails/rules/security.mdc +11 -60
  116. package/src/gdskills/bundled/stacks/ruby-rails/rules/testing.mdc +14 -65
  117. package/src/gdskills/bundled/stacks/rust/rules/coding-style.mdc +39 -65
  118. package/src/gdskills/bundled/stacks/rust/rules/patterns.mdc +33 -60
  119. package/src/gdskills/bundled/stacks/rust/rules/security.mdc +35 -57
  120. package/src/gdskills/bundled/stacks/rust/rules/testing.mdc +29 -52
  121. package/src/gdskills/bundled/stacks/sql-db/rules/coding-style.mdc +12 -48
  122. package/src/gdskills/bundled/stacks/sql-db/rules/patterns.mdc +22 -113
  123. package/src/gdskills/bundled/stacks/sql-db/rules/security.mdc +11 -56
  124. package/src/gdskills/bundled/stacks/sql-db/rules/testing.mdc +14 -59
  125. package/src/gdskills/bundled/stacks/swift-ios/rules/coding-style.mdc +29 -65
  126. package/src/gdskills/bundled/stacks/swift-ios/rules/patterns.mdc +41 -88
  127. package/src/gdskills/bundled/stacks/swift-ios/rules/security.mdc +28 -53
  128. package/src/gdskills/bundled/stacks/swift-ios/rules/testing.mdc +32 -65
  129. package/src/gdskills/bundled/stacks/vue/rules/coding-style.mdc +17 -52
  130. package/src/gdskills/bundled/stacks/vue/rules/patterns.mdc +17 -63
  131. package/src/gdskills/bundled/stacks/vue/rules/security.mdc +11 -41
  132. package/src/gdskills/bundled/stacks/vue/rules/testing.mdc +16 -48
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Shared catalog of AI-slop tells in UI (visual, copy, behavioral) with severity tiers, numeric craft thresholds, and the positive-direction principle. Read by ui-direction, ui-craft, and review-ui-ux."
2
+ description: "Shared catalog of AI-slop tells in UI (visual, copy, behavioral) with visibility tiers, the project's craft thresholds, the positive-direction principle, and the severities reviewers use. Read by ui-direction, ui-craft, and review-ui-ux."
3
3
  alwaysApply: false
4
4
  globs:
5
5
  - "**/*.tsx"
@@ -16,12 +16,21 @@ globs:
16
16
 
17
17
  One vocabulary for the three UI skills: `ui-direction` (concept before code), `ui-craft`
18
18
  (implementation), `review-ui-ux` (review). The creator and the reviewer judge by the same list.
19
+ Rendered geometry (sizing, overflow, reflow, RTL) is `layout-rendering.mdc`.
20
+
21
+ Canon applies: WCAG 2.2 AA, the NN/g usability heuristics and response-time limits, Practical
22
+ Typography, and Jakob's Law. This rule holds only this project's decisions on top of them.
23
+
24
+ **Applies to.** Marketing and content surfaces (landing, pricing, docs home, blog) use every row.
25
+ App screens (dashboards, admin, settings, data views) use Behavioral slop, Components & surfaces,
26
+ Motion, and the craft thresholds; there, body text of 14–16px is allowed when the component
27
+ library sets it and `DESIGN.md` says so.
19
28
 
20
29
  ## Why slop happens
21
30
 
22
31
  - **Distributional convergence.** With no direction a model emits the most probable design:
23
32
  Inter, indigo-on-white, centered hero, three cards, fade-up on scroll. Every "safe" default
24
- is a vote for the average. (Anthropic, *Improving frontend design through skills*)
33
+ is a vote for the average.
25
34
  - **A ban list alone fails.** Ban purple and the output moves to the *next* most probable look
26
35
  ("second-wave slop": cream + serif + terracotta; near-black + one neon accent; broadsheet).
27
36
  The cure is a **positive direction derived from the subject**, with this list as a guard rail.
@@ -36,18 +45,18 @@ One vocabulary for the three UI skills: `ui-direction` (concept before code), `u
36
45
  the client's own numbers and names. Not from "modern, clean, minimal".
37
46
  2. **Spend boldness in one place.** Exactly one signature element; everything else quiet.
38
47
  Before finishing, remove one element.
39
- 3. **Distinctive look, conventional behavior** (Jakob's Law). Navigation placement, link
40
- affordance, form patterns, and keyboard behavior stay standard.
41
- 4. **Structure must encode information.** Borders, numbering, eyebrows, dividers, badges exist
42
- only when they carry meaning.
48
+ 3. **Distinctive look, conventional behavior.** Navigation, links, forms and keyboard stay standard.
49
+ 4. **Decoration carries meaning or goes.** Borders, numbering, eyebrows, dividers, badges.
43
50
  5. **Never invent proof.** No made-up stats, logos, testimonials, customers, or "Live" chips.
44
- 6. **If the brief names a look, follow it** — even if that look is on the list below.
51
+ 6. **If `DESIGN.md`, the brief or the job context names a look, follow it** — even if that look
52
+ is on the list below.
45
53
  7. **Don't claim checks that weren't run.** No browser → say so.
46
54
 
47
55
  ## Tell catalog
48
56
 
49
- Tiers: **T1** — recognizable as AI within ~3 seconds by a layperson (must fix).
50
- **T2** — obvious to anyone who builds UI (should fix). **T3** — weak alone, damning in a stack.
57
+ Tiers say how visible a tell is, not how severe a finding is; severity comes from
58
+ **Review severities** below. **T1** — recognizable as AI within ~3 seconds by a layperson.
59
+ **T2** — obvious to anyone who builds UI. **T3** — weak alone, damning in a stack.
51
60
 
52
61
  ### Color
53
62
  | Tier | Tell | Fix |
@@ -69,7 +78,7 @@ Tiers: **T1** — recognizable as AI within ~3 seconds by a layperson (must fix)
69
78
  | T2 | Accent on one headline word ("Build *faster*" — italic/colored/serif swap) | Let the sentence carry itself |
70
79
  | T2 | Tracked ALL-CAPS eyebrow above every heading; mono for decorative meta labels | Only where it encodes information |
71
80
  | T2 | Meta strings "A · B · C"; labels "WORD — fragment" | Plain sentence-case labels |
72
- | T3 | Framework size ramp verbatim (12/14/16/18/24/30/36/48/60/72) | Modular ratio (1.2 / 1.25 / 1.333), ≤5 sizes |
81
+ | T3 | Framework size ramp verbatim (12/14/16/18/24/30/36/48/60/72) | Modular ratio (1.2 / 1.25 / 1.333); a defined scale has ≤5 sizes |
73
82
  | T3 | Close weights (400 vs 600); body at 600 | Extreme contrast (200–300 vs 700–900); body 400 |
74
83
  | T3 | Headlines ≥48px with default tracking | −0.02 to −0.05em, leading 0.85–1.05 |
75
84
 
@@ -120,29 +129,23 @@ Tiers: **T1** — recognizable as AI within ~3 seconds by a layperson (must fix)
120
129
  | T2 | Critical actions only visible on hover; color-only status | Always reachable; text/icon + color |
121
130
  | T2 | No `prefers-reduced-motion` variant | Keep content, drop travel |
122
131
 
123
- ## Craft thresholds (checkable)
132
+ ## Craft thresholds (project picks on top of the canon)
124
133
 
125
- **Type.** 1–2 families. Body 16–20px (≥16px on mobile inputs), line-height 1.45–1.6, measure
126
- 45–75ch (hero 30–45ch). Display ≥3× body on marketing pages; ≤3 visible sizes on dense app
127
- screens. Real punctuation (curly quotes, “…”, en/em dashes). `tabular-nums` for compared numbers.
134
+ **Type.** 1–2 families. Body 16–20px (≥16px on mobile inputs; 14–16px on app screens per
135
+ **Applies to**). Display ≥3× body on marketing pages. A defined type scale has ≤5 sizes; one
136
+ dense app screen shows ≤3 of them.
128
137
 
129
- **Color.** Contrast text ≥4.5:1, large text (≥24px or ≥18.66px bold) and UI boundaries/icons
130
- ≥3:1 (WCAG 1.4.3 / 1.4.11). Color never the sole carrier of meaning (1.4.1). ≤3 contrast
131
- treatments per view.
138
+ **Color.** ≤3 contrast treatments per view.
132
139
 
133
140
  **Space & shape.** One spacing scale (4/8/12/16/24/32/48/64/96/128). Groups separated more than
134
141
  items within them. Radius: one scale by role, nested radius concentric.
135
142
 
136
- **Targets.** ≥24×24 CSS px (WCAG 2.5.8); ≥44px on touch (Apple 44pt, Material 48dp).
143
+ **Targets.** ≥44px on touch, above the WCAG 24px floor.
137
144
 
138
- **Motion.** 100–400ms; ~100ms for toggles, 200–300ms for dialogs, nothing ≥500ms; entrances
139
- slightly longer than exits; stagger 60–90ms; travel 16–32px.
145
+ **Motion.** ~100ms for toggles, 200–300ms for dialogs, nothing ≥500ms; stagger 60–90ms;
146
+ travel 16–32px.
140
147
 
141
- **Feedback timing.** 0.1s feels instant; >1s needs an indicator; 2–10s spinner; ≥10s percent-done
142
- + cancel. Loaders appear after ~150–300ms and stay ≥300ms. Skeletons match final dimensions.
143
-
144
- **Accessibility floor.** WCAG 2.2 AA, including 2.4.11 Focus Not Obscured (sticky headers →
145
- `scroll-padding`), 2.5.7 drag alternative, 1.4.10 reflow at 320px, never disable zoom.
148
+ **Feedback.** Loaders appear after ~150–300ms and stay ≥300ms. Skeletons match final dimensions.
146
149
 
147
150
  ## Slop score
148
151
 
@@ -151,17 +154,25 @@ Count tells by tier on the reviewed surface: `T1×3 + T2×2 + T3×1`.
151
154
  - 4–8 — template-leaning; fix T1/T2 first
152
155
  - ≥9 — reads as AI-generated; redo direction, don't patch
153
156
 
154
- A tell is exempt when `DESIGN.md` or the brief explicitly chooses it — record the exemption.
157
+ A tell is exempt when `DESIGN.md`, the brief or the job context explicitly chooses it — record
158
+ the exemption and where it was read.
155
159
 
156
- ## Sources
160
+ ---
157
161
 
158
- - Anthropic frontend-design skill — https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
159
- - Anthropic, Improving frontend design through skills — https://claude.com/blog/improving-frontend-design-through-skills
160
- - Anthropic cookbook, Prompting for frontend aesthetics — https://github.com/anthropics/claude-cookbooks/blob/main/coding/prompting_for_frontend_aesthetics.ipynb
161
- - How to fix AI slop in web design — https://capitalandcompute.net/blog/fix-ai-slop-design/
162
- - ux-skill: detecting AI slop — https://github.com/Laith0003/ux-skill/wiki/How-to-detect-AI-slop-in-your-design
163
- - Impeccable — https://github.com/pbakaus/impeccable · Taste Skill — https://github.com/Leonxlnx/taste-skill
164
- - Vercel Web Interface Guidelines — https://vercel.com/design/guidelines
165
- - Practical Typography — https://practicaltypography.com/summary-of-key-rules.html
166
- - NN/g: heuristics, severity, hierarchy, response times, progress, errors, empty states, animation duration — https://www.nngroup.com/articles/
167
- - Laws of UX — https://lawsofux.com/ · WCAG 2.2 — https://www.w3.org/WAI/WCAG22/quickref/
162
+ ## Review severities (shared with reviewers)
163
+
164
+ `review-ui-ux` rates these by this table. Change a row here, never in a reviewer. A row counts
165
+ only when the change touches the surface, and only on the surfaces **Applies to** names. A tier
166
+ is visibility; the severity is this table's. Overflow and reflow at a width are rated by
167
+ `layout-rendering.mdc`.
168
+
169
+ | Signal | A finding when | Default | Not a finding |
170
+ |---|---|---|---|
171
+ | Invented proof shipped as fact: stats, logos, testimonials, customers (Copy T1, principle 5) | it renders in shipped copy | `major` | content marked as sample; Storybook fixtures |
172
+ | Primary task unreachable by keyboard, or focus invisible on the primary flow (`outline: none` with no `:focus-visible`, `div onClick`) | Tab through the flow cannot finish the task or cannot see where focus is | `major`; `minor` on a non-primary control | a `:focus-visible` replacement exists |
173
+ | Text contrast below 4.5:1 (3:1 large) on primary content | the pair is on shipped primary text, measured or computed from the token pair | `major` | decorative text; a pair not measured (`info`) |
174
+ | Missing loading, empty or error state on a primary view; destructive action with no confirm or Undo | the view or action is primary | `major`; `minor` on a secondary view | a state the component library renders by default |
175
+ | Other WCAG floor misses: target under 24px, color-only status, no reduced-motion branch, placeholder-as-label, paste blocked, zoom disabled, missing accessible name | always | `minor`; `major` when it blocks the primary flow | an N/A the author recorded |
176
+ | T1 tell, or slop score ≥9 | counted per tier on the changed surface | `minor` | a tell `DESIGN.md`, the brief or the job context chose; invented proof, focus and missing states, which the rows above rate (they still count in the score) |
177
+ | T2 tell, hierarchy competition, inconsistent tokens, drift from `DESIGN.md` | always | `minor` | the same exemptions |
178
+ | T3 tell (generic CTA labels included), polish, or a visual claim with no measurement | always | `info` | — |
@@ -204,8 +204,8 @@ Rules `resolve-context` listed are already read (2.0c); load the rest by what yo
204
204
 
205
205
  **Always load (all task types):**
206
206
  - `tdd-workflow.mdc` — red-green-refactor, STATUS: DONE requires passing tests
207
- - `error-handling.mdc` — Result pattern, no silent failures
208
- - `solid-principles.mdc` — SRP, OCP, DIP (load for any task that creates new classes/services)
207
+ - `error-handling.mdc` — failure signalled explicitly (throw by default, a discriminated result where callers branch), context and `cause` kept, no silent failures
208
+ - `solid-principles.mdc` — SRP, OCP, DIP and the function-design thresholds the code-quality reviewer applies (load for any task that creates or grows classes, services or functions)
209
209
 
210
210
  **Load by task type:**
211
211
 
@@ -42,7 +42,7 @@ dropped, the config key is skipped, the field comes back `undefined`. The
42
42
  command exits 0. The caller reads success, the operator reads success, and the
43
43
  work the flag asked for silently stopped happening. `rejectUnknownFlags` says
44
44
  it in one line — *"a flag that is silently dropped writes nothing and reports
45
- success"* (`src/commands/review.ts:307-318`).
45
+ success"* (`rejectUnknownFlags` in `src/commands/review.ts`).
46
46
 
47
47
  `rules/core/cli-interface-design.mdc` sets the standard a surface must meet.
48
48
  This skill is the work of getting an existing spelling from where it is to
@@ -90,7 +90,7 @@ not a hardcoded `cat`/`ls`/`find` invocation).
90
90
  - Fixture/factory patterns (how test data is created)
91
91
  - Before/after hook usage
92
92
 
93
- **1.2b Load test-convention rules, project first.** Read the testing rules the task touches (`testing-conventions`, `tdd-workflow`, and any rule the task names) in this order: `.metaproject/rules/project/<rule>.mdc` first, then `.metaproject/rules/core/<rule>.mdc`. A project rule with the same name replaces the bundled one; a project rule with a different name adds to it. Take the list from `workspace.resolved_context_file` when the task carries one, otherwise run `keryx skills resolve-context --for test --files <target_files, comma-joined> --task-text '<task description, each ' written as '\''>' --out <project-relative path>` (`--task-text` lets a declared keyword promote a document); read its `must_read` entries in full and record each in `project_context_applied` with the resolver's `sha256`. An entry with reason `condition:glob:<g>` or `condition:keyword:<k>` was promoted by a declared condition: read its anchored section, and its item needs the `path`, the `sha256` of the whole file as pinned, the `anchor` exactly as declared, a `summary` (at least 40 characters, in your own words, naming at least three distinct words of five or more letters from that section) and `how` `read` or `followed`, never `n/a`. Where a project test convention and a bundled one conflict, the project wins. A project skill only supplements these steps; it never replaces this skill.
93
+ **1.2b Load test-convention rules, project first.** Read the testing rules the task touches (`tdd-workflow`, the installed stack pack's `testing.mdc`, and any rule the task names) in this order: `.metaproject/rules/project/<rule>.mdc` first, then `.metaproject/rules/core/<rule>.mdc`. A project rule with the same name replaces the bundled one; a project rule with a different name adds to it. Take the list from `workspace.resolved_context_file` when the task carries one, otherwise run `keryx skills resolve-context --for test --files <target_files, comma-joined> --task-text '<task description, each ' written as '\''>' --out <project-relative path>` (`--task-text` lets a declared keyword promote a document); read its `must_read` entries in full and record each in `project_context_applied` with the resolver's `sha256`. An entry with reason `condition:glob:<g>` or `condition:keyword:<k>` was promoted by a declared condition: read its anchored section, and its item needs the `path`, the `sha256` of the whole file as pinned, the `anchor` exactly as declared, a `summary` (at least 40 characters, in your own words, naming at least three distinct words of five or more letters from that section) and `how` `read` or `followed`, never `n/a`. Where a project test convention and a bundled one conflict, the project wins. A project skill only supplements these steps; it never replaces this skill.
94
94
 
95
95
  **1.3 Identify test file naming:**
96
96
  - Pattern (`<component>.test.ts`, `<service>.spec.ts`, `test_<module>.py`) and location (co-located, or `__tests__`/`tests/`)
@@ -3,7 +3,7 @@ name: review-architecture
3
3
  model_tier: deep
4
4
  description: |
5
5
  Use when: reviewing code for architectural violations — layer violations, dependency direction
6
- mistakes, module boundary coupling, SOLID principle breaches, NestJS module/provider structure,
6
+ mistakes, module boundary coupling, dependency inversion, circular imports, NestJS module/provider structure,
7
7
  React MVVM boundary violations, or MobX store layer misplacement.
8
8
  Dispatched by review-orchestrator with --architecture or --backend.
9
9
  NOT for: style/naming preferences, logic correctness bugs, or security vulnerabilities.
@@ -26,7 +26,7 @@ license: "MIT"
26
26
 
27
27
  Specialized reviewer for **architectural patterns and structural decisions**.
28
28
  Reviews only changes introduced in the current branch (merge-base to HEAD).
29
- Focuses exclusively on verifiable structural violations — not style opinions or hypothetical concerns. Its inputs are the reviewer payload only; session memory and earlier conversation are not inputs. It runs no command unless its payload's `allowed_tools` says `run-tests`, except the read-only `git log`, `git blame` and `git show` where its host gives a read-only child git (keryx shell does not: there the payload supplies the history), and the read-only layer commands the orchestrator lists (`keryx gdgraph affected|find`, `keryx test related`, `keryx wiki ask`, `keryx memory search`, `keryx ctx rg|read`); it never writes in the reviewed tree.
29
+ Focuses exclusively on verifiable structural violations — not style opinions or hypothetical concerns. 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
30
 
31
31
  ---
32
32
 
@@ -41,7 +41,7 @@ Architecture Review Progress:
41
41
  - [ ] Step 5: Check layer assignments and dependency direction
42
42
  - [ ] Step 6: Check module/provider boundaries
43
43
  - [ ] Step 7: Check design pattern correctness (Repository, DI, MVVM)
44
- - [ ] Step 8: Check SOLID violations
44
+ - [ ] Step 8: Check dependency inversion
45
45
  - [ ] Step 9: Check framework-specific concerns (NestJS / React / MobX)
46
46
  - [ ] Step 10: Emit findings in unified format
47
47
  ```
@@ -92,43 +92,30 @@ When `stack_hint` is not provided, infer from changed file paths:
92
92
 
93
93
  ### Layer Violations
94
94
 
95
- A **layer violation** occurs when code belonging to one architectural layer is placed in another.
96
- Common layers (adapt to the project's actual layering):
97
-
98
- ```
99
- UI (View) → ViewModel / Store → Service → Domain → Infrastructure (DB, HTTP)
100
- ```
101
-
102
- - [ ] API call or HTTP client import inside a React component (should be in store/service)
103
- - [ ] Business logic inside a controller (should be in service/use-case)
104
- - [ ] Database query directly inside a service bypassing the repository layer
105
- - [ ] Domain entity mutating itself with HTTP response data (infrastructure leaking into domain)
106
- - [ ] UI component computing derived state that belongs in a ViewModel or computed property
95
+ A **layer violation** occurs when code belonging to one architectural layer is placed in another. The layers and what each may import are `.metaproject/rules/core/clean-architecture.mdc` (backend: controller, use case, repository, domain, infrastructure, each boundary mapping its own types) and `.metaproject/rules/core/code-style-patterns.mdc` Rule 2 (frontend: component renders, store holds logic, service does I/O only; derived state is `@computed` per `.metaproject/rules/core/mobx-store-template.mdc` Rule 1). Adapt to the project's actual layering and report a placement those rules forbid.
107
96
 
108
97
  ### Dependency Direction
109
98
 
110
99
  Dependencies must flow **inward** (from infrastructure toward domain), never outward.
111
100
 
112
- - [ ] Domain module importing from infrastructure (e.g., domain entity importing ORM types)
101
+ - [ ] Domain module importing from infrastructure (`.metaproject/rules/core/clean-architecture.mdc`)
113
102
  - [ ] Core/shared module importing from feature module (inverted dependency)
114
- - [ ] Circular import between modules (A imports B, B imports A)
103
+ - [ ] Circular import between modules (A imports B, B imports A); rated by `.metaproject/rules/core/clean-architecture.mdc` Review severities
115
104
  - [ ] Barrel file (`index.ts`) that creates hidden circular references
116
105
 
117
106
  ### Module Boundary Violations
118
107
 
119
- - [ ] Feature A directly accessing feature B's internal service instead of a public API/facade
108
+ - [ ] Feature A reaching into feature B's internal files instead of its public exports (`.metaproject/rules/core/clean-architecture.mdc`)
120
109
  - [ ] Shared `utils/` or `common/` module containing domain-specific business logic
121
110
  - [ ] Cross-module data transformation happening in the wrong module
122
111
 
123
112
  ### Design Pattern Misuse
124
113
 
125
- **Repository pattern:**
126
- - [ ] Repository method containing business logic (filtering/transformation beyond simple queries)
127
- - [ ] Service bypassing repository and using ORM/DB client directly
114
+ **Repository pattern** (`.metaproject/rules/core/clean-architecture.mdc`: the repository is the I/O boundary, business rules live in the domain):
128
115
  - [ ] Multiple repositories doing the same data transformation independently
129
116
 
130
117
  **Dependency Injection:**
131
- - [ ] `new SomeService()` inside a class that should receive it via DI
118
+ - [ ] `new X()` for an I/O, network or clock dependency inside a class that should receive it (`.metaproject/rules/core/solid-principles.mdc` section D)
132
119
  - [ ] Service locator pattern used instead of constructor injection
133
120
  - [ ] Singleton service holding request-scoped state
134
121
 
@@ -136,27 +123,11 @@ Dependencies must flow **inward** (from infrastructure toward domain), never out
136
123
  - [ ] Command handler performing a query and returning domain data (mixed responsibility)
137
124
  - [ ] Use-case importing another use-case (chain via domain events instead)
138
125
 
139
- ### SOLID Violations
140
-
141
- Focus on **SRP** and **DIP** — the two most commonly violated in practice.
142
-
143
- **SRP (Single Responsibility):**
144
- - [ ] Class/module doing two unrelated things (e.g., handles auth AND sends emails)
145
- - [ ] Service with >5 injected dependencies (smell: likely SRP violation)
146
- - [ ] Component rendering UI AND fetching data AND computing derived state
126
+ ### Dependency Inversion
147
127
 
148
- **OCP (Open/Closed):**
149
- - [ ] `switch`/`if-else` chain over a type discriminant that will grow (should be polymorphism or strategy)
128
+ This lens owns DIP, layer and dependency direction, module boundaries and circular imports; their severities are `.metaproject/rules/core/clean-architecture.mdc` Review severities. SRP, OCP, LSP and ISP are `review-clean-code`'s, rated by `.metaproject/rules/core/solid-principles.mdc` Review severities. A component that renders, fetches and derives is `.metaproject/rules/core/code-style-patterns.mdc` Rule 2.
150
129
 
151
- **LSP (Liskov Substitution):**
152
- - [ ] Subclass overriding a method with stronger preconditions or weaker postconditions
153
-
154
- **ISP (Interface Segregation):**
155
- - [ ] Implementing interface that forces implementing methods never used by this class
156
-
157
- **DIP (Dependency Inversion):**
158
- - [ ] High-level module importing a concrete low-level class (should import an abstraction)
159
- - [ ] Infrastructure class passed directly through multiple layers instead of behind an interface
130
+ - DIP asks for an interface only at an I/O or substitution boundary; a single internal implementation gets none. An infrastructure class passed through several layers instead of behind an interface at that boundary is a finding.
160
131
 
161
132
  ### NestJS-Specific
162
133
 
@@ -164,24 +135,21 @@ Focus on **SRP** and **DIP** — the two most commonly violated in practice.
164
135
  - [ ] `@Global()` overused — global providers for non-truly-global concerns
165
136
  - [ ] Circular dependency between NestJS modules without `forwardRef`
166
137
  - [ ] Provider scope mismatch: `REQUEST`-scoped service injected into `DEFAULT`-scoped service
167
- - [ ] Controller fat with business logic that belongs in the service layer
138
+ - [ ] Controller holding business logic or a query that belongs in the domain/use-case layer (`clean-architecture.mdc`)
168
139
  - [ ] `@Module` imports array including modules it does not need (unnecessary coupling)
169
140
 
170
141
  ### React + MVVM (with MobX)
171
142
 
172
- - [ ] Business logic directly in a component (should be in store action or computed)
173
- - [ ] `useEffect` performing state orchestration that belongs in a MobX reaction or action
174
- - [ ] Store method calling another store's `private` action directly (should go through public API)
143
+ Logic in a component, effects that orchestrate state, and cleanup are `.metaproject/rules/core/code-style-patterns.mdc` Rules 2 and 5 with `.metaproject/rules/core/mobx-store-template.mdc` Rule 8. This lens adds:
144
+
175
145
  - [ ] Component subscribing to raw observable fields instead of using computed/derived values
176
146
  - [ ] View rendering based on multiple raw observable fields instead of a single computed boolean
177
147
 
178
148
  ### MobX Store Layer
179
149
 
180
- - [ ] `@action` performing async work without wrapping in `runInAction` on resolution
150
+ Mutation outside an action, async resolution without `runInAction`, and inter-store callbacks left public are `.metaproject/rules/core/mobx-store-template.mdc` Rules 2 and 3 and their rows; a store importing another store's internal file is `.metaproject/rules/core/clean-architecture.mdc` (public exports only). This lens adds:
151
+
181
152
  - [ ] `@computed` with side effects (computed must be pure)
182
- - [ ] Observable state mutated outside of an `@action` (MobX strict mode violation)
183
- - [ ] Store importing from another store's internal file instead of its public export
184
- - [ ] Inter-store callback (`onChangeX`, `handleX`, `syncX`) declared `public` when only used internally (should be `private`)
185
153
 
186
154
  ---
187
155
 
@@ -190,12 +158,13 @@ Focus on **SRP** and **DIP** — the two most commonly violated in practice.
190
158
  | Concern | This skill | Use instead |
191
159
  |---------|------------|-------------|
192
160
  | Layer violations, dependency direction, module coupling | YES | — |
193
- | SOLID violations (SRP, DIP, OCP, LSP, ISP) | YES | — |
161
+ | Dependency inversion (DIP) | YES | — |
162
+ | SRP, OCP, LSP, ISP, duplication, magic literals, comments | NO | `review-clean-code` |
194
163
  | NestJS module/provider/scope issues | YES | — |
195
164
  | React MVVM boundary, MobX store layer | YES | — |
196
165
  | Logic bugs, off-by-one, null safety | NO | `review-logic` |
197
166
  | Security vulnerabilities (injection, auth bypass) | NO | `review-security-code` |
198
- | Style, naming, import order | NO | `review-style` |
167
+ | Style, naming, readability | NO | `review-style` |
199
168
  | Performance (bundle size, render cost, query plan) | NO | `review-performance` |
200
169
  | MobX store internals deep-dive | surface violations only | `review-frontend` for full store audit |
201
170
 
@@ -255,16 +224,12 @@ conditions land under that rubric, not a second rubric.
255
224
 
256
225
  | Condition | Severity | Why, under the canonical rubric |
257
226
  |---|---|---|
258
- | Circular dependency that fails at runtime (an import resolves to `undefined` on a path the change reaches) | `blocker` | Crash |
259
227
  | Module scope mismatch that produces wrong data across requests | `blocker` | Data corruption |
260
- | Layer violation — API/IO call in a component, business logic in a controller, domain importing infrastructure | `minor` — `major` only when a concrete defect it causes is named (trigger and outcome) or a stated project rule makes it one | Structural cost lands on the next editor. Identical to `review-frontend` and `review-backend` for the same condition |
261
- | Broken DIP; cross-module coupling | `minor` — `major` under the same condition | Same |
262
- | SRP smell with a clear separation path; ISP violation; a component reading several raw observables instead of a computed | `minor` | The code is correct; the cost is to whoever restructures it next |
228
+ | Layer violation in the backend — business logic in a controller, domain importing infrastructure (a frontend component's layer violation is the `code-style-patterns.mdc` Rule 2 row) | `minor` — `major` only when a concrete defect it causes is named (trigger and outcome) | Structural cost lands on the next editor. Identical to `review-backend` for the same condition |
229
+ | Cross-module coupling; circular import (`blocker` only when it fails at runtime) | `minor` — `major` under the same condition | `clean-architecture.mdc` Review severities |
230
+ | A component reading several raw observables instead of a computed | `minor` | The code is correct; the cost is to whoever restructures it next |
263
231
  | Architectural opinion with no named violation | `info` | Shared laws 1 and 2 |
264
232
 
265
- This lens owns circular imports: one that resolves cleanly is `minor`, not a
266
- `blocker`; `review-style` and `review-clean-code` defer to this rating.
267
-
268
233
  ## Iron Laws
269
234
 
270
235
  ### Shared laws (every reviewer)
@@ -283,7 +248,7 @@ boundary is the trigger-and-outcome test.
283
248
 
284
249
  - Only flag actual violations found **in the diff**, not pre-existing issues untouched by the change.
285
250
  - Every finding MUST cite a specific `file:line` from the diff.
286
- - Architecture opinions without a clear, named violation (layer, SOLID principle, pattern misuse) are `info` only — never `blocker` or `major`.
251
+ - Architecture opinions without a clear, named violation (layer, dependency, pattern misuse) are `info` only — never `blocker` or `major`.
287
252
  - Do not flag correct framework usage as a violation just because an alternative exists.
288
253
 
289
254
  ---
@@ -329,7 +294,7 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
329
294
  ### Design Pattern Misuse
330
295
  <[F-NNN] findings or "None detected.">
331
296
 
332
- ### SOLID Violations
297
+ ### Dependency Inversion
333
298
  <[F-NNN] findings or "None detected.">
334
299
 
335
300
  ### Framework-Specific (NestJS / React+MobX)
@@ -351,7 +316,6 @@ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY c
351
316
 
352
317
  | Rationalization | Why it is wrong |
353
318
  |----------------|-----------------|
354
- | "This class is large, so it must violate SRP" | Size alone is not a violation; cite what two unrelated responsibilities it holds |
355
319
  | "I see a potential layer violation in a file not in the diff" | Scope is diff-only; pre-existing issues are out of scope unless the diff touches them |
356
320
  | "This architecture opinion makes things cleaner, so it's a major" | Opinions without a named violation are `info` only |
357
321
  | "I'll flag every cross-import as a boundary violation" | Not all cross-imports violate boundaries; check whether the dependency direction is correct |
@@ -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), and the read-only layer commands the orchestrator lists (`keryx gdgraph affected|find`, `keryx test related`, `keryx wiki ask`, `keryx memory search`, `keryx ctx rg|read`); it never writes in the reviewed tree.
29
+ 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).
30
30
 
31
31
  ---
32
32
 
@@ -38,10 +38,9 @@ review-backend Progress:
38
38
  - [ ] Step 2: Determine git scope (merge-base) — see .metaproject/skills/gdskills/shared/git-merge-base.md
39
39
  - [ ] Step 3: Collect diff and changed file list
40
40
  - [ ] Step 4: NestJS patterns check
41
- - [ ] Step 5: API design check
42
- - [ ] Step 6: Database patterns check
43
- - [ ] Step 7: TypeScript correctness check
44
- - [ ] Step 8: Emit findings in unified format, sorted by severity
41
+ - [ ] Step 5: API, DTO and database rules check (section 2)
42
+ - [ ] Step 6: TypeScript correctness check
43
+ - [ ] Step 7: Emit findings in unified format, sorted by severity
45
44
  ```
46
45
 
47
46
  ---
@@ -87,13 +86,6 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
87
86
  - `REQUEST`-scoped provider injected into a `Singleton` provider is a **blocker** (creates hidden state sharing)
88
87
  - `TRANSIENT` scope used unnecessarily when singleton would suffice — flag as `minor`
89
88
 
90
- **DTO validation**
91
- - All controller methods accepting user input (body, query, param) have a DTO class decorated with `class-validator` decorators
92
- - Required fields: `@IsString()`, `@IsNumber()`, `@IsEmail()`, etc. present and accurate
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)` — missing on an endpoint accepting user input is rated by the DTO row of the conditions table
95
- - `@Transform()` used where input coercion is needed (e.g., string → number from query params)
96
-
97
89
  **Guards and roles**
98
90
  - Protected endpoints have `@UseGuards(...)` with appropriate guard(s)
99
91
  - 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
@@ -111,62 +103,24 @@ git diff --name-status "${BASE_SHA}" && git diff "${BASE_SHA}" && git ls-files -
111
103
 
112
104
  ---
113
105
 
114
- ### 2. API Design
115
-
116
- **HTTP method conventions**
117
- - `GET` requests carry no body (flag as `major` if present)
118
- - `POST` used for resource creation
119
- - `PUT` for full replacement, `PATCH` for partial update — mixed usage without clear reason flagged as `minor`
120
- - `DELETE` on correct resource path
121
-
122
- **Response shape consistency**
123
- - All endpoints in a controller return the same envelope shape (e.g., `{ data, meta }`) — inconsistency (sometimes object, sometimes raw array) flagged as `major`
124
- - HTTP status codes match semantics: `201` for create, `200` for read/update, `204` for no-content delete, `404` for not found, `422` for validation failure
125
-
126
- **Pagination**
127
- - List endpoints that could return unbounded datasets must have pagination (`limit`/`offset` or `cursor`)
128
- - Missing pagination on a list endpoint flagged as `major` when no obvious bound exists
129
-
130
- **Error handling**
131
- - Async controller methods must have error handling: either `try/catch` or a global exception filter
132
- - Unhandled promise rejections (async method without try/catch, no global filter) — **blocker**
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
134
- - NestJS built-in exceptions (`NotFoundException`, `BadRequestException`, etc.) preferred over generic `Error`
135
-
136
- ---
137
-
138
- ### 3. Database Patterns (ORM)
139
-
140
- **N+1 queries**
141
- - Relation loaded inside a loop without eager loading (`relations`, `leftJoinAndSelect`) or a DataLoader — rated by the N+1 row of the conditions table
142
- - Example: `for (const user of users) { user.orders = await orderRepo.find(...) }` — flag with concrete suggestion to use `relations: ['orders']` or batch query
143
-
144
- **Transactions**
145
- - Multi-step operations that must be atomic (e.g., create + update + delete across tables) must use a transaction
146
- - Missing transaction on a multi-step mutation is a **major** finding
147
- - NestJS TypeORM: use `dataSource.transaction(async (manager) => { ... })` or `@Transaction()` decorator pattern
106
+ ### 2. API, DTOs and database: the standard
148
107
 
149
- **Raw query safety**
150
- - String interpolation in raw queries: SQL injection risk, rated by the raw-SQL row of the conditions table
151
- - Use parameterized queries: `query('SELECT * FROM users WHERE id = $1', [id])`
152
- - Flag `createQueryBuilder().where('id = ' + id)` under that row
108
+ These project rules hold what to check and how to rate it. Read each one that applies to the change and rate by its **Review severities** table; this lens does not restate them.
153
109
 
154
- **Soft deletes**
155
- - If the project schema uses `deletedAt` / `@DeleteDateColumn()`, deletions must use `.softRemove()` / `.softDelete()`, not `.remove()` / `.delete()`
156
- - Hard delete on a soft-delete entity flagged as `major`
110
+ - `.metaproject/rules/core/api-contracts.mdc`: spec first, versioning, error envelope (validation failure is `400`), idempotency keys, list envelopes and pagination.
111
+ - `.metaproject/rules/core/nestjs-dto.mdc`: DTO classes, validators, nested and query transforms, Swagger decorators.
112
+ - `.metaproject/rules/core/database-patterns.mdc`: queries in loops, indexes, migration safety, transactions, `SELECT *`, soft deletes.
113
+ - `.metaproject/rules/core/security-baseline.mdc`: parameterized queries (string interpolation in raw SQL).
157
114
 
158
- **Migration safety**
159
- - Column removed in migration — check that no application code still references it
160
- - Dropping a column without a deprecation period in a live system flagged as `major`
161
- - `NOT NULL` column added without a default value to a populated table — `major`; `blocker` only on shown truncation
115
+ Beyond them: a `GET` with a body is `major`; `PUT` for full replacement and `PATCH` for partial; NestJS built-in exceptions over a generic `Error`; unhandled rejections are rated by `.metaproject/rules/core/error-handling.mdc` (a rejection Nest's exception layer answers with an error response is not a crash: rate that response).
162
116
 
163
117
  ---
164
118
 
165
- ### 4. TypeScript Correctness
119
+ ### 3. TypeScript Correctness
166
120
 
167
121
  - No `any` in new code — suggest `unknown` with type guards, or correct typed return
168
122
  - Public service methods must have explicit return types (`Promise<UserDto>`, not inferred)
169
- - Service contracts expressed as interfaces (`IUserService`), not just class implementations
123
+ - Interfaces only at an I/O or substitution boundary, named without an `I` prefix (`solid-principles.mdc`, D)
170
124
  - No `as any` or unsafe casts (`as unknown as T`) without a comment explaining why
171
125
  - `@ts-ignore` / `@ts-expect-error` without explanation comment — flag as `minor`
172
126
 
@@ -204,17 +158,11 @@ is, and a condition that cannot name one is not a `blocker`.
204
158
 
205
159
  | Condition | Severity | Shape |
206
160
  |---|---|---|
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
161
  | 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
162
  | 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
163
  | `REQUEST`-scoped provider injected into a `Singleton` | `blocker` | Data corruption — one request's state is served to another |
212
- | Unhandled promise rejection in a controller method | `blocker` | Crash |
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
- | 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 | `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
- | Missing pagination on an unbounded list endpoint | `major` — `blocker` where an attacker-reachable request exhausts memory | Degradation vs. crash/DoS |
164
+ | DTO, API contract, query, migration and transaction conditions | per the rule's **Review severities** table (section 2) | The rule's row names the shape |
165
+ | Business logic in a controller | `minor` — `major` only with a concrete defect it causes (trigger and outcome) | Layer violation. Same rating as `review-architecture` |
218
166
 
219
167
  ---
220
168
 
@@ -342,10 +290,8 @@ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY c
342
290
  | Rationalization | Why it is wrong |
343
291
  |----------------|-----------------|
344
292
  | "ValidationPipe is probably configured somewhere" | Always verify it is applied; assumption lets injection reach service layer |
345
- | "The N+1 only runs on small datasets now" | Data grows; flag it now with a clear fix, not after the incident |
346
293
  | "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
294
  | "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
- | "I'll skip the migration check — it's just a column rename" | Column renames without fallback break zero-downtime deploys |
349
295
 
350
296
  <!-- keryx:layers-block:start -->
351
297
  ## Project layers: graph, tests, wiki, memory