@mrciphersmith/keryx 0.2.9

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 (297) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +351 -0
  3. package/dist/cli.js +48427 -0
  4. package/dist/proxy-worker.js +381 -0
  5. package/package.json +63 -0
  6. package/src/gdgraph/affected.test.ts +100 -0
  7. package/src/gdgraph/affected.ts +135 -0
  8. package/src/gdgraph/build-integrity.test.ts +193 -0
  9. package/src/gdgraph/build-lang.test.ts +399 -0
  10. package/src/gdgraph/build.test.ts +120 -0
  11. package/src/gdgraph/build.ts +804 -0
  12. package/src/gdgraph/config.test.ts +47 -0
  13. package/src/gdgraph/config.ts +113 -0
  14. package/src/gdgraph/core-sources.test.ts +99 -0
  15. package/src/gdgraph/core-sources.ts +20 -0
  16. package/src/gdgraph/enrich.ts +79 -0
  17. package/src/gdgraph/fallback.test.ts +153 -0
  18. package/src/gdgraph/find.test.ts +78 -0
  19. package/src/gdgraph/find.ts +107 -0
  20. package/src/gdgraph/pagerank.ts +129 -0
  21. package/src/gdgraph/path.test.ts +56 -0
  22. package/src/gdgraph/path.ts +112 -0
  23. package/src/gdgraph/query.ts +133 -0
  24. package/src/gdgraph/repomap.test.ts +110 -0
  25. package/src/gdgraph/repomap.ts +193 -0
  26. package/src/gdgraph/service.test.ts +59 -0
  27. package/src/gdgraph/service.ts +51 -0
  28. package/src/gdgraph/staleness.ts +20 -0
  29. package/src/gdgraph/symbol.test.ts +89 -0
  30. package/src/gdgraph/symbol.ts +123 -0
  31. package/src/gdgraph/symbols-capability.test.ts +41 -0
  32. package/src/gdgraph/symbols-capability.ts +49 -0
  33. package/src/gdgraph/target.ts +56 -0
  34. package/src/gdgraph/treesitter/adapter.test.ts +249 -0
  35. package/src/gdgraph/treesitter/adapter.ts +213 -0
  36. package/src/gdgraph/treesitter/extract.test.ts +278 -0
  37. package/src/gdgraph/treesitter/extract.ts +389 -0
  38. package/src/gdgraph/treesitter/grammars.ts +110 -0
  39. package/src/gdgraph/treesitter/no-treesitter-import.test.ts +51 -0
  40. package/src/gdgraph/treesitter/resolve-calls.test.ts +38 -0
  41. package/src/gdgraph/types.ts +63 -0
  42. package/src/gdskills/bundled/rules/core/api-contracts.mdc +148 -0
  43. package/src/gdskills/bundled/rules/core/async-patterns.mdc +185 -0
  44. package/src/gdskills/bundled/rules/core/clean-architecture.mdc +163 -0
  45. package/src/gdskills/bundled/rules/core/code-review-ai-assistant.mdc +49 -0
  46. package/src/gdskills/bundled/rules/core/code-review-b091-profile.mdc +48 -0
  47. package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +54 -0
  48. package/src/gdskills/bundled/rules/core/commit-message-formatting.mdc +25 -0
  49. package/src/gdskills/bundled/rules/core/database-patterns.mdc +162 -0
  50. package/src/gdskills/bundled/rules/core/documentation-management.mdc +106 -0
  51. package/src/gdskills/bundled/rules/core/error-handling.mdc +163 -0
  52. package/src/gdskills/bundled/rules/core/execution-metrics.md +99 -0
  53. package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +40 -0
  54. package/src/gdskills/bundled/rules/core/git-rules.mdc +37 -0
  55. package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +198 -0
  56. package/src/gdskills/bundled/rules/core/implementation-doc-mandate.mdc +149 -0
  57. package/src/gdskills/bundled/rules/core/implementation-plans.mdc +58 -0
  58. package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +221 -0
  59. package/src/gdskills/bundled/rules/core/mobx-store-template.mdc +561 -0
  60. package/src/gdskills/bundled/rules/core/model-selection.mdc +53 -0
  61. package/src/gdskills/bundled/rules/core/nestjs-dto.mdc +50 -0
  62. package/src/gdskills/bundled/rules/core/playwright-testing.mdc +321 -0
  63. package/src/gdskills/bundled/rules/core/requirements-management.mdc +35 -0
  64. package/src/gdskills/bundled/rules/core/requirements-package-standard.mdc +103 -0
  65. package/src/gdskills/bundled/rules/core/review-agent-profile.mdc +49 -0
  66. package/src/gdskills/bundled/rules/core/review-strict-profile.mdc +44 -0
  67. package/src/gdskills/bundled/rules/core/rule-management-workflow.mdc +62 -0
  68. package/src/gdskills/bundled/rules/core/security-baseline.mdc +155 -0
  69. package/src/gdskills/bundled/rules/core/shared-definitions.mdc +79 -0
  70. package/src/gdskills/bundled/rules/core/skill-lifecycle.mdc +55 -0
  71. package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +88 -0
  72. package/src/gdskills/bundled/rules/core/solid-principles.mdc +149 -0
  73. package/src/gdskills/bundled/rules/core/storybook-guidelines.mdc +36 -0
  74. package/src/gdskills/bundled/rules/core/subagent-context-construction.md +107 -0
  75. package/src/gdskills/bundled/rules/core/subagent-status-protocol.md +169 -0
  76. package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +96 -0
  77. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.codex.md +47 -0
  78. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.cursor.md +55 -0
  79. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.md +352 -0
  80. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.opencode.md +39 -0
  81. package/src/gdskills/bundled/skills/orchestration/code-verifier/SKILL.zed.md +29 -0
  82. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.codex.md +567 -0
  83. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.cursor.md +567 -0
  84. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +655 -0
  85. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.opencode.md +567 -0
  86. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.zed.md +567 -0
  87. package/src/gdskills/bundled/skills/orchestration/context-collector/input-contract.schema.json +134 -0
  88. package/src/gdskills/bundled/skills/orchestration/context-collector/orchestrator-prompt.md +183 -0
  89. package/src/gdskills/bundled/skills/orchestration/context-collector/output-contract.schema.json +208 -0
  90. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +1412 -0
  91. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +1412 -0
  92. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.detail.md +735 -0
  93. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +468 -0
  94. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +1412 -0
  95. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +1412 -0
  96. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/analysis-request.md +62 -0
  97. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/analysis-request.template.md +79 -0
  98. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/input-contract.schema.json +247 -0
  99. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/orchestrator-prompt.md +362 -0
  100. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/output-contract.schema.json +87 -0
  101. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +105 -0
  102. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +105 -0
  103. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +165 -0
  104. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +379 -0
  105. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/input-contract.schema.json +33 -0
  106. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/output-contract.schema.json +41 -0
  107. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.codex.md +307 -0
  108. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.cursor.md +307 -0
  109. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.md +373 -0
  110. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.opencode.md +307 -0
  111. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/SKILL.zed.md +307 -0
  112. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/input-contract.schema.json +130 -0
  113. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/issue-request.template.md +50 -0
  114. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/orchestrator-prompt.md +155 -0
  115. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/output-contract.schema.json +61 -0
  116. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.codex.md +365 -0
  117. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.cursor.md +365 -0
  118. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.md +373 -0
  119. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.opencode.md +365 -0
  120. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.zed.md +365 -0
  121. package/src/gdskills/bundled/skills/orchestration/job-documenter/input-contract.schema.json +55 -0
  122. package/src/gdskills/bundled/skills/orchestration/job-documenter/output-contract.schema.json +58 -0
  123. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +1701 -0
  124. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +1701 -0
  125. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1734 -0
  126. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +1701 -0
  127. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +1701 -0
  128. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/input-contract.schema.json +188 -0
  129. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/orchestrator-prompt.md +179 -0
  130. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/output-contract.schema.json +103 -0
  131. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/state.schema.json +164 -0
  132. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +395 -0
  133. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +395 -0
  134. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +556 -0
  135. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +395 -0
  136. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +395 -0
  137. package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +204 -0
  138. package/src/gdskills/bundled/skills/orchestration/task-implementer/orchestrator-prompt.md +206 -0
  139. package/src/gdskills/bundled/skills/orchestration/task-implementer/output-contract.schema.json +51 -0
  140. package/src/gdskills/bundled/skills/orchestration/task-implementer/task-request.template.md +111 -0
  141. package/src/gdskills/bundled/skills/planning/autodoc-analyst/SKILL.md +163 -0
  142. package/src/gdskills/bundled/skills/planning/autodoc-architect/SKILL.md +161 -0
  143. package/src/gdskills/bundled/skills/planning/autodoc-assembler/SKILL.md +128 -0
  144. package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +321 -0
  145. package/src/gdskills/bundled/skills/planning/autodoc-scanner/SKILL.md +166 -0
  146. package/src/gdskills/bundled/skills/planning/autodoc-writer/SKILL.md +253 -0
  147. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.claude.md +46 -0
  148. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.codex.md +90 -0
  149. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.cursor.md +90 -0
  150. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +90 -0
  151. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +33 -0
  152. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +33 -0
  153. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +190 -0
  154. package/src/gdskills/bundled/skills/planning/docpack-orchestrator/SKILL.md +142 -0
  155. package/src/gdskills/bundled/skills/planning/docpack-orchestrator/input-contract.schema.json +31 -0
  156. package/src/gdskills/bundled/skills/planning/docpack-orchestrator/output-contract.schema.json +31 -0
  157. package/src/gdskills/bundled/skills/planning/docpack-review/SKILL.md +80 -0
  158. package/src/gdskills/bundled/skills/planning/docpack-review/input-contract.schema.json +20 -0
  159. package/src/gdskills/bundled/skills/planning/docpack-review/output-contract.schema.json +36 -0
  160. package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +181 -0
  161. package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +181 -0
  162. package/src/gdskills/bundled/skills/planning/interview/SKILL.md +187 -0
  163. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.claude.md +94 -0
  164. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +99 -0
  165. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +99 -0
  166. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +105 -0
  167. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +33 -0
  168. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +33 -0
  169. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +237 -0
  170. package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +33 -0
  171. package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +33 -0
  172. package/src/gdskills/bundled/skills/planning/planner/SKILL.md +190 -0
  173. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.codex.md +193 -0
  174. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.cursor.md +193 -0
  175. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.md +193 -0
  176. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.opencode.md +193 -0
  177. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.zed.md +193 -0
  178. package/src/gdskills/bundled/skills/planning/prd-creator/input-contract.schema.json +63 -0
  179. package/src/gdskills/bundled/skills/planning/prd-creator/output-contract.schema.json +175 -0
  180. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +31 -0
  181. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +31 -0
  182. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +153 -0
  183. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +32 -0
  184. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +32 -0
  185. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +166 -0
  186. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +44 -0
  187. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +44 -0
  188. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +243 -0
  189. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +43 -0
  190. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +43 -0
  191. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +193 -0
  192. package/src/gdskills/bundled/skills/platform/agent-entrypoint-distiller/SKILL.md +47 -0
  193. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.codex.md +87 -0
  194. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.cursor.md +87 -0
  195. package/src/gdskills/bundled/skills/platform/claude-md-management/SKILL.md +87 -0
  196. package/src/gdskills/bundled/skills/platform/hookify/SKILL.codex.md +100 -0
  197. package/src/gdskills/bundled/skills/platform/hookify/SKILL.cursor.md +100 -0
  198. package/src/gdskills/bundled/skills/platform/hookify/SKILL.md +100 -0
  199. package/src/gdskills/bundled/skills/quality/changelog/SKILL.claude.md +45 -0
  200. package/src/gdskills/bundled/skills/quality/changelog/SKILL.codex.md +84 -0
  201. package/src/gdskills/bundled/skills/quality/changelog/SKILL.cursor.md +84 -0
  202. package/src/gdskills/bundled/skills/quality/changelog/SKILL.md +84 -0
  203. package/src/gdskills/bundled/skills/quality/commit/SKILL.codex.md +66 -0
  204. package/src/gdskills/bundled/skills/quality/commit/SKILL.cursor.md +66 -0
  205. package/src/gdskills/bundled/skills/quality/commit/SKILL.md +66 -0
  206. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.claude.md +40 -0
  207. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.codex.md +66 -0
  208. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.cursor.md +66 -0
  209. package/src/gdskills/bundled/skills/quality/db-migrate/SKILL.md +66 -0
  210. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.claude.md +45 -0
  211. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.codex.md +81 -0
  212. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.cursor.md +81 -0
  213. package/src/gdskills/bundled/skills/quality/dependency-update/SKILL.md +81 -0
  214. package/src/gdskills/bundled/skills/quality/deploy/SKILL.claude.md +42 -0
  215. package/src/gdskills/bundled/skills/quality/deploy/SKILL.codex.md +70 -0
  216. package/src/gdskills/bundled/skills/quality/deploy/SKILL.cursor.md +70 -0
  217. package/src/gdskills/bundled/skills/quality/deploy/SKILL.md +70 -0
  218. package/src/gdskills/bundled/skills/quality/metaproject-security/SKILL.md +103 -0
  219. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.claude.md +48 -0
  220. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.codex.md +83 -0
  221. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.cursor.md +83 -0
  222. package/src/gdskills/bundled/skills/quality/perf-check/SKILL.md +83 -0
  223. package/src/gdskills/bundled/skills/quality/pr/SKILL.codex.md +75 -0
  224. package/src/gdskills/bundled/skills/quality/pr/SKILL.cursor.md +75 -0
  225. package/src/gdskills/bundled/skills/quality/pr/SKILL.md +75 -0
  226. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.codex.md +364 -0
  227. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.cursor.md +295 -0
  228. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.md +378 -0
  229. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.opencode.md +364 -0
  230. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.zed.md +38 -0
  231. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/input-contract.schema.json +53 -0
  232. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/output-contract.schema.json +46 -0
  233. package/src/gdskills/bundled/skills/quality/push/SKILL.codex.md +52 -0
  234. package/src/gdskills/bundled/skills/quality/push/SKILL.cursor.md +52 -0
  235. package/src/gdskills/bundled/skills/quality/push/SKILL.md +52 -0
  236. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.claude.md +40 -0
  237. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.codex.md +61 -0
  238. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.cursor.md +61 -0
  239. package/src/gdskills/bundled/skills/quality/security-audit/SKILL.md +61 -0
  240. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.claude.md +30 -0
  241. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.codex.md +75 -0
  242. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.cursor.md +75 -0
  243. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.md +75 -0
  244. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.codex.md +64 -0
  245. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.cursor.md +74 -0
  246. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +339 -0
  247. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.opencode.md +48 -0
  248. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.zed.md +44 -0
  249. package/src/gdskills/bundled/skills/quality/tests-creator/input-contract.schema.json +121 -0
  250. package/src/gdskills/bundled/skills/quality/tests-creator/output-contract.schema.json +127 -0
  251. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.codex.md +204 -0
  252. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.cursor.md +204 -0
  253. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.md +203 -0
  254. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.opencode.md +204 -0
  255. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.zed.md +204 -0
  256. package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.codex.md +209 -0
  257. package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.cursor.md +209 -0
  258. package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.md +208 -0
  259. package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.opencode.md +209 -0
  260. package/src/gdskills/bundled/skills/review/code-b091-review/SKILL.zed.md +209 -0
  261. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.codex.md +263 -0
  262. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.cursor.md +263 -0
  263. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.md +258 -0
  264. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.opencode.md +263 -0
  265. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.zed.md +263 -0
  266. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.codex.md +175 -0
  267. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.cursor.md +175 -0
  268. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +168 -0
  269. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.opencode.md +175 -0
  270. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.zed.md +175 -0
  271. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +360 -0
  272. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +337 -0
  273. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +477 -0
  274. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +93 -0
  275. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +119 -0
  276. package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +595 -0
  277. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +144 -0
  278. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +519 -0
  279. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +323 -0
  280. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +927 -0
  281. package/src/gdskills/bundled/skills/review/review-orchestrator/input-contract.schema.json +153 -0
  282. package/src/gdskills/bundled/skills/review/review-orchestrator/output-contract.schema.json +77 -0
  283. package/src/gdskills/bundled/skills/review/review-orchestrator/review-context.schema.json +389 -0
  284. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +189 -0
  285. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +241 -0
  286. package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +344 -0
  287. package/src/gdskills/bundled/skills/review/review-pr-feedback/SKILL.md +327 -0
  288. package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +348 -0
  289. package/src/gdskills/bundled/skills/review/review-strict/SKILL.md +328 -0
  290. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +343 -0
  291. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +134 -0
  292. package/src/gdskills/bundled/skills/shared/git-merge-base.md +33 -0
  293. package/src/gdskills/contracts/agent-event.schema.json +32 -0
  294. package/src/gdskills/contracts/orchestrator-state.schema.json +58 -0
  295. package/src/gdskills/contracts/review-finding.schema.json +59 -0
  296. package/src/gdskills/contracts/subagent-dispatch.schema.json +123 -0
  297. package/src/gdskills/contracts/subagent-result.schema.json +136 -0
@@ -0,0 +1,360 @@
1
+ ---
2
+ name: review-architecture
3
+ description: |
4
+ Use when: reviewing code for architectural violations — layer violations, dependency direction
5
+ mistakes, module boundary coupling, SOLID principle breaches, NestJS module/provider structure,
6
+ React MVVM boundary violations, or MobX store layer misplacement.
7
+ Triggered by: "review architecture", "check architecture", "architectural review",
8
+ or dispatched by review-orchestrator with --architecture or --backend.
9
+ NOT for: style/naming preferences, logic correctness bugs, or security vulnerabilities.
10
+ version: "1.0.0"
11
+ triggers:
12
+ - "review architecture"
13
+ - "check architecture"
14
+ - "architectural review"
15
+ - "architecture review"
16
+ - "check layers"
17
+ - "dispatched by review-orchestrator"
18
+ metadata:
19
+ author: "MrCipherSmith"
20
+ version: "1.0.0"
21
+ category: "review"
22
+ license: "MIT"
23
+ compatibility: "cursor,codex,zed,opencode,claude"
24
+ ---
25
+
26
+ # Review Architecture
27
+
28
+ Specialized reviewer for **architectural patterns and structural decisions**.
29
+ Reviews only changes introduced in the current branch (merge-base to HEAD).
30
+ Focuses exclusively on verifiable structural violations — not style opinions or hypothetical concerns.
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ ```
37
+ Architecture Review Progress:
38
+ - [ ] Step 1: Read Job Context (if provided) — understand intentional stack choices
39
+ - [ ] Step 2: Determine git scope (merge-base)
40
+ - [ ] Step 3: Collect diff and changed file list
41
+ - [ ] Step 4: Identify stack (NestJS, React+MobX, generic TS, mixed)
42
+ - [ ] Step 5: Check layer assignments and dependency direction
43
+ - [ ] Step 6: Check module/provider boundaries
44
+ - [ ] Step 7: Check design pattern correctness (Repository, DI, MVVM)
45
+ - [ ] Step 8: Check SOLID violations
46
+ - [ ] Step 9: Check framework-specific concerns (NestJS / React / MobX)
47
+ - [ ] Step 10: Emit findings in unified format
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Input Contract
53
+
54
+ | Field | Type | Required | Description |
55
+ |-------|------|----------|-------------|
56
+ | `branch` | string | no | Branch to review. Defaults to current branch. |
57
+ | `commit_range` | string | no | Explicit hash or range. Overrides merge-base detection. |
58
+ | `context_doc` | string | no | Path to job context document. Read before reviewing to understand intentional decisions. |
59
+ | `stack_hint` | string | no | Optional hint: `nestjs`, `react-mobx`, `generic-ts`. Reviewer auto-detects if absent. |
60
+
61
+ ---
62
+
63
+ ## Scope Detection
64
+
65
+ See shared script: `skills/shared/git-merge-base.md`
66
+
67
+ Run the script to determine `BASE_SHA`, then collect the diff:
68
+
69
+ ```bash
70
+ # Changed files — used for stack auto-detection
71
+ git diff --name-status "${BASE_SHA}"
72
+
73
+ # Full diff — used for finding exact violations
74
+ git diff "${BASE_SHA}"
75
+
76
+ # Untracked new files
77
+ git ls-files --others --exclude-standard
78
+ ```
79
+
80
+ Review scope: **changes introduced in the current branch since merge-base only**.
81
+ Do not review pre-existing architectural problems unless they are directly touched by the diff.
82
+
83
+ ---
84
+
85
+ ## Stack Auto-Detection
86
+
87
+ When `stack_hint` is not provided, infer from changed file paths:
88
+
89
+ | Signal | Detected stack |
90
+ |--------|---------------|
91
+ | `*.module.ts`, `*.controller.ts`, `*.provider.ts`, `@Injectable`, `@Module` | NestJS |
92
+ | `*.store.ts`, `makeObservable`, `observable`, `action`, `computed` (MobX) | React + MobX |
93
+ | `*.tsx` / `*.jsx` | React (check MVVM boundaries) |
94
+ | `prisma/`, `*.repository.ts`, `*.entity.ts` | Backend data layer |
95
+ | Mixed signals | fullstack — apply all relevant checks |
96
+
97
+ ---
98
+
99
+ ## Focus Areas and Checklist
100
+
101
+ ### Layer Violations
102
+
103
+ A **layer violation** occurs when code belonging to one architectural layer is placed in another.
104
+ Common layers (adapt to the project's actual layering):
105
+
106
+ ```
107
+ UI (View) → ViewModel / Store → Service → Domain → Infrastructure (DB, HTTP)
108
+ ```
109
+
110
+ - [ ] API call or HTTP client import inside a React component (should be in store/service)
111
+ - [ ] Business logic inside a controller (should be in service/use-case)
112
+ - [ ] Database query directly inside a service bypassing the repository layer
113
+ - [ ] Domain entity mutating itself with HTTP response data (infrastructure leaking into domain)
114
+ - [ ] UI component computing derived state that belongs in a ViewModel or computed property
115
+
116
+ ### Dependency Direction
117
+
118
+ Dependencies must flow **inward** (from infrastructure toward domain), never outward.
119
+
120
+ - [ ] Domain module importing from infrastructure (e.g., domain entity importing ORM types)
121
+ - [ ] Core/shared module importing from feature module (inverted dependency)
122
+ - [ ] Circular import between modules (A imports B, B imports A)
123
+ - [ ] Barrel file (`index.ts`) that creates hidden circular references
124
+
125
+ ### Module Boundary Violations
126
+
127
+ - [ ] Feature A directly accessing feature B's internal service instead of a public API/facade
128
+ - [ ] Shared `utils/` or `common/` module containing domain-specific business logic
129
+ - [ ] Cross-module data transformation happening in the wrong module
130
+
131
+ ### Design Pattern Misuse
132
+
133
+ **Repository pattern:**
134
+ - [ ] Repository method containing business logic (filtering/transformation beyond simple queries)
135
+ - [ ] Service bypassing repository and using ORM/DB client directly
136
+ - [ ] Multiple repositories doing the same data transformation independently
137
+
138
+ **Dependency Injection:**
139
+ - [ ] `new SomeService()` inside a class that should receive it via DI
140
+ - [ ] Service locator pattern used instead of constructor injection
141
+ - [ ] Singleton service holding request-scoped state
142
+
143
+ **CQRS / Use-case:**
144
+ - [ ] Command handler performing a query and returning domain data (mixed responsibility)
145
+ - [ ] Use-case importing another use-case (chain via domain events instead)
146
+
147
+ ### SOLID Violations
148
+
149
+ Focus on **SRP** and **DIP** — the two most commonly violated in practice.
150
+
151
+ **SRP (Single Responsibility):**
152
+ - [ ] Class/module doing two unrelated things (e.g., handles auth AND sends emails)
153
+ - [ ] Service with >5 injected dependencies (smell: likely SRP violation)
154
+ - [ ] Component rendering UI AND fetching data AND computing derived state
155
+
156
+ **OCP (Open/Closed):**
157
+ - [ ] `switch`/`if-else` chain over a type discriminant that will grow (should be polymorphism or strategy)
158
+
159
+ **LSP (Liskov Substitution):**
160
+ - [ ] Subclass overriding a method with stronger preconditions or weaker postconditions
161
+
162
+ **ISP (Interface Segregation):**
163
+ - [ ] Implementing interface that forces implementing methods never used by this class
164
+
165
+ **DIP (Dependency Inversion):**
166
+ - [ ] High-level module importing a concrete low-level class (should import an abstraction)
167
+ - [ ] Infrastructure class passed directly through multiple layers instead of behind an interface
168
+
169
+ ### NestJS-Specific
170
+
171
+ - [ ] `@Injectable` service used across modules without being exported from its owning module
172
+ - [ ] `@Global()` overused — global providers for non-truly-global concerns
173
+ - [ ] Circular dependency between NestJS modules without `forwardRef`
174
+ - [ ] Provider scope mismatch: `REQUEST`-scoped service injected into `DEFAULT`-scoped service
175
+ - [ ] Controller fat with business logic that belongs in the service layer
176
+ - [ ] `@Module` imports array including modules it does not need (unnecessary coupling)
177
+
178
+ ### React + MVVM (with MobX)
179
+
180
+ - [ ] Business logic directly in a component (should be in store action or computed)
181
+ - [ ] `useEffect` performing state orchestration that belongs in a MobX reaction or action
182
+ - [ ] Store method calling another store's `private` action directly (should go through public API)
183
+ - [ ] Component subscribing to raw observable fields instead of using computed/derived values
184
+ - [ ] View rendering based on multiple raw observable fields instead of a single computed boolean
185
+
186
+ ### MobX Store Layer
187
+
188
+ - [ ] `@action` performing async work without wrapping in `runInAction` on resolution
189
+ - [ ] `@computed` with side effects (computed must be pure)
190
+ - [ ] Observable state mutated outside of an `@action` (MobX strict mode violation)
191
+ - [ ] Store importing from another store's internal file instead of its public export
192
+ - [ ] Inter-store callback (`onChangeX`, `handleX`, `syncX`) declared `public` when only used internally (should be `private`)
193
+
194
+ ---
195
+
196
+ ## Scope Boundaries
197
+
198
+ | Concern | This skill | Use instead |
199
+ |---------|------------|-------------|
200
+ | Layer violations, dependency direction, module coupling | YES | — |
201
+ | SOLID violations (SRP, DIP, OCP, LSP, ISP) | YES | — |
202
+ | NestJS module/provider/scope issues | YES | — |
203
+ | React MVVM boundary, MobX store layer | YES | — |
204
+ | Logic bugs, off-by-one, null safety | NO | `review-logic` |
205
+ | Security vulnerabilities (injection, auth bypass) | NO | `review-security-code` |
206
+ | Style, naming, import order | NO | `review-style` |
207
+ | Performance (bundle size, render cost, query plan) | NO | `review-performance` |
208
+ | MobX store internals deep-dive | surface violations only | `code-mobx-store-review` for full store audit |
209
+
210
+ ---
211
+
212
+ ## Orchestrated Review Contract
213
+
214
+ When dispatched by `review-orchestrator`, follow the provided `reviewer-input.schema.json` payload. Return a `REVIEW_RESULT` object compatible with `skills/review-orchestrator/reviewer-finding.schema.json`, then a concise markdown summary. Keep findings evidence-based, include concrete `suggested_fix` for every blocker/major, and return `NEEDS_CONTEXT` instead of guessing when required context is missing.
215
+
216
+ ---
217
+
218
+ ## Finding Format
219
+
220
+ ### Class scope — required for `blocker` and `major`
221
+
222
+ Every `blocker` and `major` finding must carry `class_scope`: **every** site that
223
+ holds the shape you found, and **how you enumerated them** — the grep or query
224
+ you ran, or the guard that derives the set.
225
+
226
+ A finding anchored to one `file:line` is a claim about one site. The recorded
227
+ history of this repository is that a fix then repairs that site and leaves its
228
+ siblings: one writer of five, one operator instruction of four, six readers of
229
+ eight. Each was found by the *next* review round, which is why reviews here have
230
+ run to seven and four rounds instead of one.
231
+
232
+ ```yaml
233
+ class_scope:
234
+ sites: ["src/lib/shell-config.ts:60", "src/session/store.ts:133"]
235
+ enumeration_method: "grep for the config-path resolvers; 7 writers, 2 unguarded"
236
+ ```
237
+
238
+ "I checked the others" is not an enumeration method. A single-entry `sites` list
239
+ is a claim that the class has exactly one member — make it deliberately, because
240
+ `review-finding.schema.json` accepts it and the next round tests it.
241
+
242
+ `minor` and `info` may omit it: enumerating the class for every low-severity
243
+ observation is theatre, not rigour.
244
+
245
+ ```markdown
246
+ ### [F-NNN] Title
247
+
248
+ - **Severity**: blocker | major | minor | info
249
+ - **File**: path/to/file.ts:line
250
+ - **Problem**: what architectural rule is violated and how
251
+ - **Why it matters**: impact on testability / maintainability / correctness
252
+ - **Fix**: concrete structural change
253
+ - **Patch** (optional):
254
+ ```diff
255
+ - old line
256
+ + new line
257
+ ```
258
+ ```
259
+
260
+ Severity guide for this reviewer:
261
+
262
+ | Severity | When to use |
263
+ |----------|------------|
264
+ | `blocker` | Circular dependency causing runtime failure; NestJS module scope mismatch causing incorrect behavior; domain importing infrastructure breaking testability entirely |
265
+ | `major` | Clear layer violation (API call in component, business logic in controller); broken DIP; cross-module boundary coupling that will cause maintainability failures |
266
+ | `minor` | SRP smell with clear separation path; ISP violation; component using multiple raw observables instead of computed |
267
+ | `info` | Architectural opinion without clear violation; pattern that could be improved but works correctly |
268
+
269
+ Iron laws:
270
+ - Only flag actual violations found **in the diff**, not pre-existing issues untouched by the change.
271
+ - Every finding MUST cite a specific `file:line` from the diff.
272
+ - Architecture opinions without a clear, named violation (layer, SOLID principle, pattern misuse) are `info` only — never `blocker` or `major`.
273
+ - Do not flag correct framework usage as a violation just because an alternative exists.
274
+
275
+ ---
276
+
277
+ ## Output Contract
278
+
279
+ ```
280
+ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
281
+ ```
282
+
283
+ | Status | Meaning |
284
+ |--------|---------|
285
+ | `DONE` | No blockers or majors found; architecture is sound in this diff |
286
+ | `DONE_WITH_CONCERNS` | One or more blocker or major findings present |
287
+ | `NEEDS_CONTEXT` | Cannot determine correct layering without knowing the project's architecture decisions |
288
+ | `BLOCKED` | Cannot access diff or required files |
289
+
290
+ ```markdown
291
+ ## Architecture Review
292
+
293
+ ### Review Scope
294
+ - Branch: `<BRANCH>`
295
+ - Parent ref: `<PARENT>`
296
+ - Merge-base: `<BASE_SHA>`
297
+ - Scope mode: `<default-with-uncommitted | explicit-hash-range>`
298
+ - Stack detected: <NestJS | React+MobX | generic-ts | fullstack>
299
+
300
+ ### Summary
301
+ <2-3 sentences: what structural changes were introduced, overall architectural verdict.>
302
+
303
+ ### Stats
304
+ - blocker: N | major: N | minor: N | info: N
305
+
306
+ ### Layer Violations
307
+ <[F-NNN] findings or "None detected.">
308
+
309
+ ### Dependency Direction
310
+ <[F-NNN] findings or "None detected.">
311
+
312
+ ### Module Boundary Violations
313
+ <[F-NNN] findings or "None detected.">
314
+
315
+ ### Design Pattern Misuse
316
+ <[F-NNN] findings or "None detected.">
317
+
318
+ ### SOLID Violations
319
+ <[F-NNN] findings or "None detected.">
320
+
321
+ ### Framework-Specific (NestJS / React+MobX)
322
+ <[F-NNN] findings or "None detected." or "N/A — not detected in stack.">
323
+
324
+ ### Suggested Patches
325
+ <Minimal unified diffs for straightforward structural fixes. Omit if not warranted.>
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Job Context Awareness
331
+
332
+ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY include:
333
+
334
+ ```
335
+ JOB_NAME: <job-name>
336
+ CONTEXT_PATH: .metaproject/jobs/<job-name>/ai/context.md
337
+ ```
338
+
339
+ If provided and the file exists, read the context document **before** reviewing the diff.
340
+ Use it to:
341
+ - Understand which architectural patterns and layers were intentionally chosen
342
+ - Avoid flagging deliberate deviations from the default layer model as violations
343
+ - Identify framework and library choices that affect what counts as a valid pattern
344
+
345
+ If absent, proceed normally — context is optional and non-blocking.
346
+ When in doubt about whether a pattern was intentional, use `info` severity and note the uncertainty.
347
+
348
+ ---
349
+
350
+ ## Red Flags
351
+
352
+ | Rationalization | Why it is wrong |
353
+ |----------------|-----------------|
354
+ | "This class is large, so it must violate SRP" | Size alone is not a violation; cite what two unrelated responsibilities it holds |
355
+ | "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
+ | "This architecture opinion makes things cleaner, so it's a major" | Opinions without a named violation are `info` only |
357
+ | "I'll flag every cross-import as a boundary violation" | Not all cross-imports violate boundaries; check whether the dependency direction is correct |
358
+ | "The team probably didn't intend this pattern" | Unless the context doc or a clear rule says otherwise, assume intentional; use `info` if unsure |
359
+ | "NestJS global module is always wrong" | `@Global()` is a violation only when used for non-global concerns; framework-provided globals are fine |
360
+ | "I can't determine if this is wrong without knowing the full architecture" | Use `NEEDS_CONTEXT` status and ask one specific question |
@@ -0,0 +1,337 @@
1
+ ---
2
+ name: review-backend
3
+ description: |
4
+ Use when: reviewing NestJS backend changes — API design, service layer, DTO validation,
5
+ database patterns, and TypeScript correctness. Covers "review backend", "backend review",
6
+ "review API", "review NestJS", or dispatched by review-orchestrator with --backend flag.
7
+ NOT for: frontend patterns, MobX, React components, general security vulnerabilities
8
+ (use review-security-code for XSS/injection/auth-bypass), or performance profiling
9
+ (use review-performance).
10
+ version: "1.0.0"
11
+ triggers:
12
+ - "review backend"
13
+ - "backend review"
14
+ - "review API"
15
+ - "review NestJS"
16
+ - "review --backend"
17
+ metadata:
18
+ author: "MrCipherSmith"
19
+ version: "1.0.0"
20
+ category: "review"
21
+ license: "MIT"
22
+ compatibility: "cursor,codex,zed,opencode,claude"
23
+ ---
24
+
25
+ # Review — Backend (NestJS / API / DB)
26
+
27
+ Focused backend reviewer covering NestJS patterns, REST API design, database access patterns,
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`.
30
+
31
+ ---
32
+
33
+ ## Workflow
34
+
35
+ ```
36
+ review-backend Progress:
37
+ - [ ] Step 1: Read Job Context (if CONTEXT_PATH provided)
38
+ - [ ] Step 2: Determine git scope (merge-base) — see skills/shared/git-merge-base.md
39
+ - [ ] Step 3: Collect diff and changed file list
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
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Input Contract
50
+
51
+ | Field | Type | Required | Description |
52
+ |-------|------|----------|-------------|
53
+ | `branch` | string | no | Branch to review. Defaults to current branch. |
54
+ | `commit_range` | string | no | Explicit range (e.g., `abc123..HEAD`). Overrides merge-base detection. |
55
+ | `context_doc` | string | no | Path to job context document (e.g., `<JOBS_ROOT>/<job>/ai/context.md`). |
56
+ | `issue_url` | string | no | GitHub issue or task URL for spec compliance reference. |
57
+
58
+ ---
59
+
60
+ ## Scope Detection
61
+
62
+ See shared script: `skills/shared/git-merge-base.md`
63
+
64
+ Run that script to determine `BASE_SHA` before collecting the diff.
65
+
66
+ ```bash
67
+ # Default mode — all changes from merge-base to working tree
68
+ git diff --name-only "${BASE_SHA}"
69
+ git diff "${BASE_SHA}"
70
+
71
+ # Explicit range mode
72
+ git diff --name-only <FROM_SHA>..<TO_SHA>
73
+ git diff <FROM_SHA>..<TO_SHA>
74
+ ```
75
+
76
+ Only review files changed in scope. Do not comment on legacy code outside the diff.
77
+
78
+ ---
79
+
80
+ ## Review Checklist
81
+
82
+ ### 1. NestJS Patterns
83
+
84
+ **Module structure**
85
+ - `@Module()` declaration present; providers, imports, exports are correctly listed
86
+ - Circular dependency risk: two modules importing each other — flag as `major` if detected; suggest `forwardRef()`
87
+ - Feature modules do not import `AppModule`
88
+
89
+ **Provider scope**
90
+ - Default scope is `Singleton` — correct for stateless services
91
+ - `REQUEST`-scoped provider injected into a `Singleton` provider is a **blocker** (creates hidden state sharing)
92
+ - `TRANSIENT` scope used unnecessarily when singleton would suffice — flag as `minor`
93
+
94
+ **DTO validation**
95
+ - All controller methods accepting user input (body, query, param) have a DTO class decorated with `class-validator` decorators
96
+ - Required fields: `@IsString()`, `@IsNumber()`, `@IsEmail()`, etc. present and accurate
97
+ - `@IsOptional()` used only on truly optional fields; non-optional fields must not have `@IsOptional()`
98
+ - `ValidationPipe` applied globally (in `main.ts`) or explicitly via `@UsePipes(ValidationPipe)` — **blocker** if missing on any endpoint accepting user input
99
+ - `@Transform()` used where input coercion is needed (e.g., string → number from query params)
100
+
101
+ **Guards and roles**
102
+ - Protected endpoints have `@UseGuards(...)` with appropriate guard(s)
103
+ - Role-based access uses `@Roles(...)` decorator with a roles guard — missing guard on an endpoint that should be protected is a **blocker**
104
+ - Public endpoints explicitly marked with `@Public()` or equivalent decorator, not just left unguarded
105
+
106
+ **Controller responsibilities**
107
+ - Controllers are thin: no business logic, no direct ORM calls, no computation
108
+ - Controller methods do: parse input → delegate to service → return response
109
+ - If business logic is in a controller method, flag as `major` ("move to service layer")
110
+
111
+ **Service layer**
112
+ - Business logic lives in services
113
+ - Services do not directly call the ORM in complex multi-step ways — that belongs in a repository or query object
114
+ - Services do not import `Request`/`Response` from HTTP framework (except for streaming or special cases)
115
+ - Services declare return types on all public methods
116
+
117
+ ---
118
+
119
+ ### 2. API Design
120
+
121
+ **HTTP method conventions**
122
+ - `GET` requests carry no body (flag as `major` if present)
123
+ - `POST` used for resource creation
124
+ - `PUT` for full replacement, `PATCH` for partial update — mixed usage without clear reason flagged as `minor`
125
+ - `DELETE` on correct resource path
126
+
127
+ **Response shape consistency**
128
+ - All endpoints in a controller return the same envelope shape (e.g., `{ data, meta }`) — inconsistency (sometimes object, sometimes raw array) flagged as `major`
129
+ - 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
130
+
131
+ **Pagination**
132
+ - List endpoints that could return unbounded datasets must have pagination (`limit`/`offset` or `cursor`)
133
+ - Missing pagination on a list endpoint flagged as `major` when no obvious bound exists
134
+
135
+ **Error handling**
136
+ - Async controller methods must have error handling: either `try/catch` or a global exception filter
137
+ - Unhandled promise rejections (async method without try/catch, no global filter) — **blocker**
138
+ - Exception messages must not leak internal details (stack traces, ORM error strings) to the HTTP response — leaking is a **blocker**
139
+ - NestJS built-in exceptions (`NotFoundException`, `BadRequestException`, etc.) preferred over generic `Error`
140
+
141
+ ---
142
+
143
+ ### 3. Database Patterns (ORM)
144
+
145
+ **N+1 queries**
146
+ - Relation loaded inside a loop without eager loading (`relations`, `leftJoinAndSelect`) or a DataLoader — **always major**
147
+ - Example: `for (const user of users) { user.orders = await orderRepo.find(...) }` — flag with concrete suggestion to use `relations: ['orders']` or batch query
148
+
149
+ **Transactions**
150
+ - Multi-step operations that must be atomic (e.g., create + update + delete across tables) must use a transaction
151
+ - Missing transaction on a multi-step mutation is a **major** finding
152
+ - NestJS TypeORM: use `dataSource.transaction(async (manager) => { ... })` or `@Transaction()` decorator pattern
153
+
154
+ **Raw query safety**
155
+ - String interpolation in raw queries is a **blocker** (SQL injection risk)
156
+ - Use parameterized queries: `query('SELECT * FROM users WHERE id = $1', [id])`
157
+ - Flag `createQueryBuilder().where('id = ' + id)` as blocker
158
+
159
+ **Soft deletes**
160
+ - If the project schema uses `deletedAt` / `@DeleteDateColumn()`, deletions must use `.softRemove()` / `.softDelete()`, not `.remove()` / `.delete()`
161
+ - Hard delete on a soft-delete entity flagged as `major`
162
+
163
+ **Migration safety**
164
+ - Column removed in migration — check that no application code still references it
165
+ - Dropping a column without a deprecation period in a live system flagged as `major`
166
+ - `NOT NULL` column added without a default value to a populated table — **blocker**
167
+
168
+ ---
169
+
170
+ ### 4. TypeScript Correctness
171
+
172
+ - No `any` in new code — suggest `unknown` with type guards, or correct typed return
173
+ - Public service methods must have explicit return types (`Promise<UserDto>`, not inferred)
174
+ - Service contracts expressed as interfaces (`IUserService`), not just class implementations
175
+ - No `as any` or unsafe casts (`as unknown as T`) without a comment explaining why
176
+ - `@ts-ignore` / `@ts-expect-error` without explanation comment — flag as `minor`
177
+
178
+ ---
179
+
180
+ ## Iron Laws
181
+
182
+ | Condition | Severity |
183
+ |-----------|----------|
184
+ | Missing DTO validation on an endpoint accepting user input | **blocker** |
185
+ | `REQUEST`-scoped provider injected into `Singleton` | **blocker** |
186
+ | Leaking stack trace / raw ORM error to API response | **blocker** |
187
+ | Unhandled promise rejection in controller method | **blocker** |
188
+ | String interpolation in raw SQL query | **blocker** |
189
+ | N+1 query (relation loaded in a loop) | **major** (minimum) |
190
+ | Missing transaction on multi-step atomic mutation | **major** |
191
+ | Business logic in controller | **major** |
192
+ | Missing pagination on unbounded list endpoint | **major** |
193
+ | `NOT NULL` column added without default to populated table (migration) | **blocker** |
194
+
195
+ ---
196
+
197
+ ## Orchestrated Review Contract
198
+
199
+ When dispatched by `review-orchestrator`, follow the provided `reviewer-input.schema.json` payload. Return a `REVIEW_RESULT` object compatible with `skills/review-orchestrator/reviewer-finding.schema.json`, then a concise markdown summary. Keep findings evidence-based, include concrete `suggested_fix` for every blocker/major, and return `NEEDS_CONTEXT` instead of guessing when required context is missing.
200
+
201
+ ---
202
+
203
+ ## Finding Format
204
+
205
+ ### Class scope — required for `blocker` and `major`
206
+
207
+ Every `blocker` and `major` finding must carry `class_scope`: **every** site that
208
+ holds the shape you found, and **how you enumerated them** — the grep or query
209
+ you ran, or the guard that derives the set.
210
+
211
+ A finding anchored to one `file:line` is a claim about one site. The recorded
212
+ history of this repository is that a fix then repairs that site and leaves its
213
+ siblings: one writer of five, one operator instruction of four, six readers of
214
+ eight. Each was found by the *next* review round, which is why reviews here have
215
+ run to seven and four rounds instead of one.
216
+
217
+ ```yaml
218
+ class_scope:
219
+ sites: ["src/lib/shell-config.ts:60", "src/session/store.ts:133"]
220
+ enumeration_method: "grep for the config-path resolvers; 7 writers, 2 unguarded"
221
+ ```
222
+
223
+ "I checked the others" is not an enumeration method. A single-entry `sites` list
224
+ is a claim that the class has exactly one member — make it deliberately, because
225
+ `review-finding.schema.json` accepts it and the next round tests it.
226
+
227
+ `minor` and `info` may omit it: enumerating the class for every low-severity
228
+ observation is theatre, not rigour.
229
+
230
+ ```markdown
231
+ ### [F-001] Title
232
+
233
+ - **Severity**: blocker | major | minor | info
234
+ - **File**: path/to/file.ts:line
235
+ - **Problem**: what is wrong
236
+ - **Why it matters**: impact on correctness / safety / maintainability
237
+ - **Fix**: concrete suggestion
238
+ - **Patch** (optional):
239
+ ```diff
240
+ - old line
241
+ + new line
242
+ ```
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Output Contract
248
+
249
+ ```
250
+ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
251
+ ```
252
+
253
+ - `DONE` — no blockers or majors found
254
+ - `DONE_WITH_CONCERNS` — one or more blocker or major findings present
255
+ - `NEEDS_CONTEXT` — cannot determine intent without context doc or issue; state what is missing
256
+ - `BLOCKED` — cannot access diff or required files; state reason
257
+
258
+ ```markdown
259
+ # Backend Review Report
260
+
261
+ ## Verdict: APPROVE | APPROVE_WITH_SUGGESTIONS | REQUEST_CHANGES
262
+
263
+ ## Summary
264
+ <2-4 sentences covering what changed, overall backend health, key concerns.>
265
+
266
+ ## Review Scope
267
+ - Branch: `<BRANCH>`
268
+ - Parent ref: `<PARENT>`
269
+ - Merge-base: `<BASE_SHA>`
270
+ - Scope mode: `<default-with-uncommitted | explicit-hash-range>`
271
+ - Changed files: <count>
272
+
273
+ ## Stats
274
+ - blocker: N
275
+ - major: N
276
+ - minor: N
277
+ - info: N
278
+
279
+ ## Blockers (must fix before merge)
280
+ <[F-NNN] findings>
281
+
282
+ ## Major Issues
283
+ <[F-NNN] findings>
284
+
285
+ ## Minor & Info
286
+ <[F-NNN] findings>
287
+
288
+ ## Positive Notes
289
+ <Optional. Things done well.>
290
+ ```
291
+
292
+ ---
293
+
294
+ ## Scope Boundaries
295
+
296
+ | Concern | This skill | Use instead |
297
+ |---------|------------|-------------|
298
+ | NestJS module / provider / DTO / controller / service | YES | — |
299
+ | REST API shape, HTTP methods, error handling | YES | — |
300
+ | Database ORM patterns, N+1, transactions, migrations | YES | — |
301
+ | TypeScript strictness in service layer | YES | — |
302
+ | XSS, injection (beyond SQL in raw queries), auth bypass | NO | `review-security-code` |
303
+ | Bundle size, query latency profiling | NO | `review-performance` |
304
+ | Frontend, React, MobX | NO | `review-frontend` |
305
+ | Architectural layer violations (cross-module) | NO | `review-architecture` |
306
+ | Naming, style, import order | NO | `review-style` |
307
+
308
+ ---
309
+
310
+ ## Job Context Awareness
311
+
312
+ When dispatched by `job-orchestrator` or called with an explicit context path, the prompt MAY include:
313
+
314
+ ```
315
+ JOB_NAME: <job-name>
316
+ CONTEXT_PATH: <JOBS_ROOT>/<job-name>/ai/context.md
317
+ ```
318
+
319
+ If provided and the file exists, read the context document **before** running scope detection.
320
+ Use it to understand:
321
+ - Which ORM, validation library, or guard strategy was intentionally chosen
322
+ - Project-level architectural decisions (e.g., no repository pattern by design)
323
+ - Acceptance criteria to verify spec compliance
324
+
325
+ If absent, proceed normally — context is optional and non-blocking.
326
+
327
+ ---
328
+
329
+ ## Red Flags
330
+
331
+ | Rationalization | Why it is wrong |
332
+ |----------------|-----------------|
333
+ | "ValidationPipe is probably configured somewhere" | Always verify it is applied; assumption lets injection reach service layer |
334
+ | "The N+1 only runs on small datasets now" | Data grows; flag it now with a clear fix, not after the incident |
335
+ | "The controller has some logic but it's minor" | The line is binary — logic in controller = untestable without HTTP stack |
336
+ | "Stack trace in response only shows in dev" | Config can be wrong in prod; treat it as blocker always |
337
+ | "I'll skip the migration check — it's just a column rename" | Column renames without fallback break zero-downtime deploys |