@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,927 @@
1
+ ---
2
+ name: review-orchestrator
3
+ description: |
4
+ Use when: a code review is requested and the user does not explicitly name a specialized reviewer.
5
+ Handles "review", "code review", "review PR", "review --frontend", "review --backend",
6
+ "review --architecture", "review --security", "review --performance", "review --style",
7
+ "review --strict", "review --project-conventions", "review --legacy-profiles", "review --all". Routes to specialized reviewers in parallel and
8
+ consolidates findings into one unified report.
9
+ NOT for: running a single specialized reviewer — invoke it directly by name instead.
10
+ version: "1.6.0"
11
+ triggers:
12
+ - "review"
13
+ - "code review"
14
+ - "review PR"
15
+ - "review --frontend"
16
+ - "review --backend"
17
+ - "review --architecture"
18
+ - "review --security"
19
+ - "review --performance"
20
+ - "review --style"
21
+ - "review --strict"
22
+ - "review --all"
23
+ - "review --clean-code"
24
+ - "review --highload"
25
+ - "review --greptile"
26
+ - "review --project-conventions"
27
+ - "review --frontend-conventions"
28
+ - "review --testing-practices"
29
+ - "review --core-boundaries"
30
+ - "review --flow-graph"
31
+ - "review --legacy-profiles"
32
+ - "review --code-ai"
33
+ - "review --b091"
34
+ - "review --code-style"
35
+ - "review --mobx-store"
36
+ metadata:
37
+ author: "MrCipherSmith"
38
+ version: "1.6.0"
39
+ category: "review"
40
+ license: "MIT"
41
+ compatibility: "cursor,codex,zed,opencode,claude"
42
+ ---
43
+
44
+ # Review Orchestrator
45
+
46
+ Entry point for the entire review domain. This skill is a thin router: it detects scope,
47
+ dispatches specialized reviewers in parallel, then consolidates their findings into one
48
+ unified report sorted by severity. It does not perform any review logic itself.
49
+
50
+ ---
51
+
52
+ ## Workflow
53
+
54
+ ```
55
+ Review Orchestrator Progress:
56
+ - [ ] Step 1: Build Review Context Pack (PR metadata, scope, rules, context_doc summary)
57
+ - [ ] Step 2: Detect review mode (diff mode vs. path mode)
58
+ - [ ] Step 3: Collect bounded scope - git diff OR file list from path
59
+ - [ ] Step 4: Parse flags / auto-detect domain from scope
60
+ - [ ] Step 5: Ask user to confirm optional convention and legacy/profile reviewers
61
+ - [ ] Step 6: Plan sub-agent dispatch, token budgets, and model strategy
62
+ - [ ] Step 7: Stage 1 gate - spec compliance check (if issue/task provided)
63
+ - [ ] Step 8: Dispatch selected reviewers in PARALLEL with reviewer-input schema
64
+ - [ ] Step 9: Collect reviewer-finding schema results and handle NEEDS_CONTEXT
65
+ - [ ] Step 10: Run strict synthesis when blockers/majors exist or --strict is set
66
+ - [ ] Step 11: Sort by severity, deduplicate, emit unified report
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Input Contract
72
+
73
+ | Field | Type | Required | Description |
74
+ |-------|------|----------|-------------|
75
+ | `flags` | string[] | no | One or more of: `--frontend`, `--backend`, `--architecture`, `--security`, `--performance`, `--style`, `--clean-code`, `--highload`, `--project-conventions`, `--frontend-conventions`, `--testing-practices`, `--core-boundaries`, `--flow-graph`, `--legacy-profiles`, `--code-ai`, `--b091`, `--code-style`, `--mobx-store`, `--strict`, `--all` |
76
+ | `path` | string | no | File or directory path to review (e.g., `src/stores/`, `src/components/UserCard.tsx`). Activates **path mode** — reviews the files at this path directly, not a git diff. |
77
+ | `commit_range` | string | no | Explicit commit hash or range (e.g., `abc123..HEAD`). Overrides merge-base detection. Ignored in path mode. |
78
+ | `issue_url` | string | no | GitHub issue or task URL. If provided, Stage 1 gate checks spec compliance before dispatching reviewers. |
79
+ | `context_doc` | string | no | Path to job context document (e.g., `.metaproject/jobs/<job>/ai/context.md`). |
80
+ | `context_mode` | string | no | `none`, `light`, or `full`. Default: `light` for PR review, `none` for small path reviews. `full` may call `context-collector` before dispatch. |
81
+ | `token_budget` | object | no | Optional budget controls: `{total, per_reviewer, diff_max_chars, file_max_chars}`. |
82
+ | `model_strategy` | string | no | `current`, `ask`, or `adaptive`. Default: `current`; do not switch models unless user or automation allows it. |
83
+ | `managed_review` | object | no | Optional managed review mode: `{mode, target, target_ref, flow_id, reviewers}` where mode is `lightweight`, `attach-review`, `review-flow`, or `ingest`. |
84
+
85
+ ---
86
+
87
+ ## Managed Review Feedback Loop
88
+
89
+ A **first-pass** review is lightweight by default: emit the consolidated report
90
+ only and create no Task Manager artifacts. Use managed mode when requested by the
91
+ caller or when an unambiguous related flow is detected and the caller accepts
92
+ attachment.
93
+
94
+ **A fix round is managed, not optional.** Before dispatching reviewers on any
95
+ round where `is_fix_round: true`, run `keryx review start --target <kind> --ref
96
+ <ref>`; after synthesis, run `keryx review ingest --report <path> --ref <ref>`.
97
+ A round whose findings were never ingested cannot be cited as a completed round,
98
+ because nothing durable records what it found.
99
+
100
+ The reason is measured, not theoretical: eleven review rounds across flows 127
101
+ and 128 ran without this. `.metaproject/data/reviews/` did not exist afterwards.
102
+ Every finding lived in a chat transcript and, later, in hand-written journal
103
+ prose — so round N+1 had nothing to diff against, `prior_findings` could not be
104
+ populated from anything but memory, and `keryx memory ingest --from-review` had
105
+ no input. The loop that produced "reviewers keep finding problems in fixes"
106
+ starts here.
107
+
108
+ Runtime CLI surface:
109
+
110
+ ```text
111
+ keryx review attach --flow <id> --target <kind> --ref <ref>
112
+ keryx review start --target <kind> --ref <ref>
113
+ keryx review ingest --report <path> [--flow <id>] --ref <ref>
114
+ keryx review status <review-id-or-path>
115
+ keryx review complete <review-id-or-path>
116
+ ```
117
+
118
+ Managed modes:
119
+
120
+ - `lightweight`: report-only; no flow or managed review artifacts are created.
121
+ - `attach-review`: write under
122
+ `.metaproject/flows/<flow-dir>/reviews/<review-id>/`.
123
+ - `review-flow`: write under `.metaproject/reviews/<review-id>/`.
124
+ - `ingest`: convert an existing review report into managed findings, decisions,
125
+ and learning handoff, attached to a flow when one is explicit or matched.
126
+
127
+ Required artifacts for managed modes:
128
+
129
+ - `manifest.json`
130
+ - `scope.md`
131
+ - `coverage.md`
132
+ - `report.md`
133
+ - `findings.json`
134
+ - `learning.md`
135
+ - `decisions.md`
136
+
137
+ When attaching to a flow, resolve the flow by explicit `flow_id`, PR URL, issue
138
+ URL, or branch metadata. Never mutate `.metaproject/flows/*/flow.json` from
139
+ review code; Task Manager state changes remain owned by `keryx flow`.
140
+
141
+ ## Review Context Pack
142
+
143
+ Before routing reviewers, build a compact `review_context` object. This is the shared source of truth for all sub-agents and must follow `skills/review-orchestrator/review-context.schema.json`.
144
+
145
+ Required content:
146
+ - Request: raw user request, flags, review mode, explicit paths or commit range.
147
+ - Git/PR metadata: repo, branch, base, head, merge-base, PR number/URL when available.
148
+ - Scope summary: changed files grouped by domain, high-risk files, generated/ignored files.
149
+ - Requirements: issue URL, linked task docs, acceptance criteria extracted from `context_doc` when available.
150
+ - Rules: matched repository rules and convention docs by path.
151
+ - **Memory: accepted project memory intersecting the changed paths.** See below — this step is required, not best-effort.
152
+ - Decisions: why each reviewer was selected or skipped.
153
+ - Token policy: effective budget, truncation decisions, files summarized instead of fully inlined.
154
+ - Legacy/profile reviewer availability and selection state.
155
+
156
+ ### Memory (required)
157
+
158
+ Run, once, per review:
159
+
160
+ ```bash
161
+ keryx memory search "<changed modules and the concepts they touch>" --status accepted
162
+ ```
163
+
164
+ Put the matched entries in `review_context.memory` and in each reviewer's
165
+ `metaproject.memory`. Record `query` alongside them so the search is
166
+ reproducible, and set `searched: false` **only** when the memory module is
167
+ disabled — an empty `entries` with `searched: true` means the search ran and
168
+ matched nothing, which is a different fact and must stay distinguishable.
169
+
170
+ Two rules, both load-bearing:
171
+
172
+ - **`--status accepted` only.** A draft entry is a hypothesis. Handing one to a
173
+ reviewer as project truth is how a wrong hypothesis becomes a wrong finding.
174
+ - **Scope it to the change.** The whole memory index is not context; entries
175
+ whose recorded scope does not intersect the changed files or modules are noise
176
+ that costs budget in every reviewer prompt.
177
+
178
+ Why this is required rather than advisory: `keryx flow init` already collects
179
+ memory automatically for an implementation flow, and the review pipeline
180
+ collected none for eleven rounds across flows 127 and 128. A recorded lesson
181
+ naming the exact failure those rounds kept repeating existed the whole time and
182
+ never reached a reviewer.
183
+
184
+ Context modes:
185
+ - `none`: no additional context collection; use only diff/path and local rules.
186
+ - `light`: default for PR review. Read existing `context_doc`, local `AGENTS.md`/`CLAUDE.md`, and matching rule files. Do not browse external docs.
187
+ - `full`: for large/high-risk PRs or user request. Invoke `context-collector` first, then pass the resulting context path and summary to reviewers.
188
+
189
+ High-risk triggers for `full` recommendation:
190
+ - Auth, permissions, API contracts, migrations, shared core, state management, graph/flow, security, performance-critical paths.
191
+ - More than 20 changed source files or more than 2,000 changed lines.
192
+ - Missing or ambiguous linked requirements.
193
+
194
+ If `full` context would be useful but was not explicitly requested, ask once:
195
+
196
+ ```text
197
+ This PR touches high-risk areas. Build full review context before dispatching reviewers?
198
+
199
+ A) Yes - collect full context first (recommended)
200
+ B) No - use light context and continue
201
+
202
+ > pick a letter (default: A)
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Token and Context Budget Management
208
+
209
+ The orchestrator owns token budget. Sub-reviewers should receive only the context needed for their domain.
210
+
211
+ Budget rules:
212
+ - Compute a scope digest before dispatch: file list, diff stats, module map, and top risks.
213
+ - Send full diffs only for files relevant to each reviewer.
214
+ - For large files, send changed hunks plus nearby symbols first; include full file only when path mode or the reviewer requires whole-file context.
215
+ - Never send generated files, lockfiles, snapshots, build output, or vendored code unless the reviewer is specifically about that file type.
216
+ - Cap each reviewer prompt with `per_reviewer` budget when provided; otherwise use the smallest prompt that preserves evidence.
217
+ - Record omitted files and truncation in `review_context.token_policy.omissions`.
218
+ - If a reviewer returns `NEEDS_CONTEXT`, provide only the missing targeted context, not the entire repository.
219
+
220
+ Default budget guidance:
221
+
222
+ | Review size | Detection | Context mode | Dispatch style |
223
+ |---|---|---|---|
224
+ | small | <= 5 files and <= 300 changed lines | `light` | full relevant diff to selected reviewers |
225
+ | medium | <= 20 files or <= 2,000 changed lines | `light` | per-domain filtered diff |
226
+ | large | > 20 files or > 2,000 changed lines | ask `full` | staged waves by domain |
227
+ | high-risk | auth/API/core/security/data migrations | ask `full` | include strict synthesis |
228
+
229
+ ---
230
+
231
+ ## Model Strategy
232
+
233
+ Default: keep the current model for all reviewers.
234
+
235
+ If the platform supports assigning models to sub-agents and the user/automation allows it, the orchestrator may use `model_strategy: adaptive`:
236
+
237
+ | Complexity | Suggested model class | Reviewers |
238
+ |---|---|---|
239
+ | simple | cheaper/faster coding model | `review-style`, `review-clean-code`, docs-only convention checks, legacy/profile checks |
240
+ | normal | current/default model | `review-frontend`, `review-backend`, `review-testing-practices`, convention reviewers |
241
+ | complex | strongest available coding/reasoning model | `review-logic`, `review-architecture`, `review-security-code`, `review-highload`, `review-greptile`, strict synthesis |
242
+
243
+ Rules:
244
+ - Do not silently change model class when `model_strategy` is `current`.
245
+ - With `model_strategy: ask`, present the model plan once before dispatch.
246
+ - With `model_strategy: adaptive`, record chosen model class per reviewer in the final report metadata.
247
+ - If model assignment is unsupported, record `model_strategy: current-session`.
248
+
249
+ ---
250
+
251
+ ## Scope Detection
252
+
253
+ ### Step 0: Is this a fix round?
254
+
255
+ A **fix round** is any review of work produced to answer earlier findings. Set
256
+ `is_fix_round: true` on every reviewer input, and populate `prior_findings` with
257
+ the earlier findings and the disposition the fix claimed for each — the schema
258
+ rejects the dispatch otherwise. A reviewer that cannot see what the fix was
259
+ answering cannot tell whether the fix is complete.
260
+
261
+ Two scope rules apply, and they exist because breaking them is what produced
262
+ seven rounds on PR #215 and four on PR #216:
263
+
264
+ 1. **Review `merge-base..HEAD`, never the fix commit alone.** Narrowing to the
265
+ newest commit is the intuitive move and it is wrong: it hides the blast
266
+ radius. A fix that changes a guard, an instruction, a refusal or a helper
267
+ makes every *other* site that names it wrong, and those sites are outside the
268
+ fix commit by construction.
269
+
270
+ 2. **Enumerate what NAMES the thing the fix changed.** For each guard,
271
+ instruction, message, refusal or helper the fix touched, grep for its callers
272
+ and for the text that recommends it, and record the result in
273
+ `review_context.scope.files`. On PR #216 a round corrected one operator
274
+ instruction of four; the correction silently broke the other three, and
275
+ nothing looked for them because nothing was asked to.
276
+
277
+ Recording the enumeration matters as much as doing it: a round that searched and
278
+ found nothing is a different fact from a round that never searched, and only the
279
+ recorded list distinguishes them.
280
+
281
+ ### Step 1: Determine Review Mode
282
+
283
+ Before anything else, determine whether the request is **diff mode** or **path mode**:
284
+
285
+ **Path mode** is active when ANY of these is true:
286
+ - User explicitly provides a file or directory path (`src/stores/`, `src/components/UserCard.tsx`)
287
+ - User names a specific module, component, or store: "review the UserStore", "review the pipelines module", "review src/auth/"
288
+ - User says "review [the entire / whole / all of] X" where X is a module name, not a branch name
289
+
290
+ **Diff mode** (default) is active when:
291
+ - No path or target name provided
292
+ - User says "review", "review my changes", "review PR", "review this branch"
293
+
294
+ ---
295
+
296
+ ### Diff Mode
297
+
298
+ See shared script: `skills/shared/git-merge-base.md`
299
+
300
+ Run the script to determine `BASE_SHA`, then:
301
+
302
+ ```bash
303
+ git diff --name-only "${BASE_SHA}" # changed files for auto-detection
304
+ git diff "${BASE_SHA}" # full diff passed to reviewers
305
+ ```
306
+
307
+ Scope is limited to **changes introduced in the current branch since merge-base**.
308
+
309
+ ---
310
+
311
+ ### Path Mode
312
+
313
+ When a path or target is named, collect the files to review:
314
+
315
+ ```bash
316
+ # If a directory path is given:
317
+ find <path> -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) | sort
318
+
319
+ # If a file path is given:
320
+ cat <file>
321
+
322
+ # If a module name is given (e.g. "UserStore", "pipelines module"):
323
+ find . -type f -name "*<name>*" \( -name "*.ts" -o -name "*.tsx" \)
324
+ # Also check common locations: src/stores/, src/modules/, src/components/
325
+ ```
326
+
327
+ Pass the full **file contents** (not a diff) to sub-reviewers. Set `SCOPE_MODE: path`.
328
+
329
+ **Reviewer behavior in path mode:** reviewers check the entire file content — not just added lines. All findings apply to the current state of the code, not only to changes.
330
+
331
+ ---
332
+
333
+ ### Auto-detection of Reviewers (both modes)
334
+
335
+ When no flag is provided, infer reviewers from the collected file list:
336
+
337
+ | File pattern | Domain detected | Reviewers invoked |
338
+ |---|---|---|
339
+ | `*.tsx`, `*.jsx`, `*.css`, `*.scss`, `*.html` | frontend | `review-logic` + `review-frontend` + `review-style` |
340
+ | `*.store.ts`, files containing `makeObservable` | frontend/store | `review-logic` + `review-frontend` + `review-style` |
341
+ | `*.ts`, `*.js` in `src/api/`, `src/services/`, `src/controllers/`, `src/modules/` | backend | `review-logic` + `review-backend` + `review-architecture` |
342
+ | `*.ts`, `*.js` mixed (both UI and service files) | fullstack | all of the above |
343
+ | Migration files, `*.sql`, `prisma/schema.prisma` | backend | `review-backend` + `review-architecture` |
344
+ | `*.test.*`, `*.spec.*` | any | append `review-logic` (spec compliance focus) |
345
+ | No recognizable extension pattern | fallback | `review-logic` + `review-architecture` |
346
+
347
+ ### Project Convention Auto-Detection
348
+
349
+ If the repository has local convention docs such as `CLAUDE.md`, `AGENTS.md`,
350
+ `.junie/guidelines.md`, or module-level `CLAUDE.md` files, append these reviewers by path:
351
+
352
+ | File pattern | Reviewers appended |
353
+ |---|---|
354
+ | `src/**/*.ts`, `src/**/*.tsx`, `*.stories.tsx` | `review-frontend-conventions` |
355
+ | `**/*.test.*`, `**/*.spec.*`, `**/*.integration.test.*`, `**/*.msw.ts`, `src/test/**`, `test/**`, `e2e/**` | `review-testing-practices` |
356
+ | `src/core/**`, `core/**`, `shared/**`, `foundation/**` | `review-core-boundaries` |
357
+ | `src/core/flow/**`, `src/graph/**`, `src/shared/flow/**` | `review-flow-graph` |
358
+
359
+ These convention reviewers are additive: keep the generic reviewers selected by normal detection,
360
+ then add the matching convention pass. Deduplicate reviewer names before dispatch.
361
+
362
+ ### Convention Reviewer Confirmation
363
+
364
+ When convention reviewers are auto-detected and the user did not explicitly pass
365
+ `--project-conventions`, `--frontend-conventions`, `--testing-practices`, `--core-boundaries`,
366
+ `--flow-graph`, or `--all`, ask before dispatch:
367
+
368
+ ```text
369
+ I found local convention reviewers that match this review scope:
370
+
371
+ A) Include all detected convention reviewers (recommended)
372
+ B) Choose individually
373
+ C) Skip convention reviewers for this run
374
+
375
+ Detected:
376
+ - review-frontend-conventions: <why detected, or omit if not detected>
377
+ - review-testing-practices: <why detected, or omit if not detected>
378
+ - review-core-boundaries: <why detected, or omit if not detected>
379
+ - review-flow-graph: <why detected, or omit if not detected>
380
+ ```
381
+
382
+ If the user chooses B, list only detected reviewers and ask for names to include/exclude.
383
+ If the user does not answer and the review is part of an automated `job-orchestrator` pipeline,
384
+ use the job setting `convention_reviewers` (default: `"ask"`; if still unresolved, include all
385
+ detected reviewers and record that choice in the review scope).
386
+
387
+ ---
388
+
389
+ ## Legacy/Profile Reviewer Auto-Detection
390
+
391
+ Legacy/profile reviewers are specialized review profiles that predate the review-domain `review-*` naming. They are still valid and must be shown separately from generic and convention reviewers so the user can opt in deliberately.
392
+
393
+ | Trigger | Reviewers appended |
394
+ |---|---|
395
+ | `--legacy-profiles` | `code-ai-review` + `code-b091-review` + `code-style-review` + `code-mobx-store-review` when MobX/store files are present |
396
+ | `--code-ai` | `code-ai-review` |
397
+ | `--b091` | `code-b091-review` |
398
+ | `--code-style` | `code-style-review` |
399
+ | `--mobx-store` | `code-mobx-store-review` |
400
+ | `*.store.ts`, `makeObservable`, `observable`, `computed`, `action.bound` | suggest `code-mobx-store-review` as optional profile reviewer |
401
+
402
+ When any legacy/profile reviewer is available and the user did not explicitly pass its flag, ask after convention prompts:
403
+
404
+ ```text
405
+ This question controls only optional legacy/profile reviewers. Generic and convention reviewer choices listed above are unchanged.
406
+
407
+ Include legacy/profile reviewers?
408
+
409
+ A) Include all applicable profile reviewers
410
+ B) Choose individually
411
+ C) Skip legacy/profile reviewers (recommended unless you need these profiles)
412
+
413
+ Available:
414
+ - code-ai-review: strict AI review profile
415
+ - code-b091-review: b091-style strict logic profile
416
+ - code-style-review: legacy style/architecture profile
417
+ - code-mobx-store-review: MobX store/state profile (only if MobX/store files are present)
418
+ ```
419
+
420
+ If the user chooses B, list only applicable reviewers and ask for exact names. If the review is part of `job-orchestrator`, use `reviewers` and `conditional_reviewers` automation settings when provided.
421
+
422
+ Review Plan Preview must include an `Optional legacy/profile reviewers` group and a `Skipped reviewers` group with reasons such as:
423
+
424
+ ```text
425
+ Optional legacy/profile reviewers:
426
+ - code-ai-review: available via --code-ai or --legacy-profiles
427
+ - code-b091-review: available via --b091 or --legacy-profiles
428
+ - code-style-review: available via --code-style or --legacy-profiles
429
+ - code-mobx-store-review: auto-suggest when *.store.ts or MobX patterns are present; available via --mobx-store or --legacy-profiles
430
+
431
+ Skipped reviewers:
432
+ - code-ai-review: profile reviewer, not selected unless --code-ai/--legacy-profiles
433
+ - code-b091-review: profile reviewer, not selected unless --b091/--legacy-profiles
434
+ - code-style-review: legacy style profile, not selected unless --code-style/--legacy-profiles
435
+ - code-mobx-store-review: not selected unless --mobx-store/--legacy-profiles or MobX store files are detected
436
+ ```
437
+
438
+ ## Routing Table
439
+
440
+ | Flag | Reviewers dispatched |
441
+ |------|---------------------|
442
+ | `--frontend` | `review-logic` + `review-frontend` + `review-style` |
443
+ | `--backend` | `review-logic` + `review-backend` + `review-architecture` |
444
+ | `--architecture` | `review-architecture` |
445
+ | `--security` | `review-security-code` |
446
+ | `--performance` | `review-performance` |
447
+ | `--style` | `review-style` |
448
+ | `--clean-code` | `review-clean-code` |
449
+ | `--highload` | `review-highload` |
450
+ | `--greptile` | `review-greptile` (codebase-aware; requires PR number) |
451
+ | `--project-conventions` | all generic convention reviewers: `review-frontend-conventions` + `review-testing-practices` + `review-core-boundaries` + `review-flow-graph` |
452
+ | `--frontend-conventions` | `review-frontend-conventions` |
453
+ | `--testing-practices` | `review-testing-practices` |
454
+ | `--core-boundaries` | `review-core-boundaries` |
455
+ | `--flow-graph` | `review-flow-graph` |
456
+ | `--all` | all reviewers above (including `review-clean-code`, `review-highload`, applicable legacy/profile reviewers, project convention reviewers when local convention docs exist, and `review-greptile` when PR number is present) |
457
+ | `--strict` | runs AFTER all others; adds a strict commentary pass on consolidated findings |
458
+ | (auto) | detected from diff file extensions — see Auto-detection table |
459
+
460
+ Multiple flags may be combined. Example: `review --backend --security` dispatches
461
+ `review-logic` + `review-backend` + `review-architecture` + `review-security-code`.
462
+ Example: `review --frontend --frontend-conventions` dispatches the generic frontend set plus the
463
+ local frontend conventions reviewer.
464
+
465
+ ---
466
+
467
+ ## Stage 1 Gate — Spec Compliance
468
+
469
+ **Run this FIRST, before dispatching quality reviewers, when an `issue_url` or task doc is provided.**
470
+
471
+ 1. Fetch issue or task requirements.
472
+ 2. Map changed files and functions to acceptance criteria.
473
+ 3. Identify any criteria that are not addressed by the diff.
474
+ 4. If there are unimplemented criteria: emit them as `blocker` findings in the final report and note them in `## Blockers`.
475
+ 5. Continue dispatching the remaining reviewers regardless (spec gaps + quality issues both belong in the report).
476
+
477
+ ---
478
+
479
+ ## Dispatching Reviewers
480
+
481
+ Dispatch selected reviewers in parallel when independent. Use waves when token budget is tight or when one reviewer needs another result:
482
+
483
+ 1. Wave A - core correctness/risk reviewers: logic, architecture, security/highload when selected.
484
+ 2. Wave B - domain reviewers: frontend/backend/testing/convention reviewers filtered to relevant files.
485
+ 3. Wave C - synthesis: strict pass when blockers/majors exist, `--strict` is set, or PR is high-risk.
486
+
487
+ ### Agent Runtime Compatibility
488
+
489
+ Before dispatching a reviewer through a platform-native sub-agent mechanism, verify that the exact reviewer name is available as an agent type in the current runtime.
490
+
491
+ Runtime rules:
492
+ - If the exact reviewer agent type exists, dispatch that reviewer directly.
493
+ - If the exact reviewer agent type does not exist but `skills/<reviewer>/SKILL.md` exists, dispatch `general-purpose` and include the reviewer name, skill path, bounded review context, and required `REVIEW_RESULT` schema in the prompt.
494
+ - If neither the agent type nor the skill file exists, do not silently substitute another reviewer. Mark that reviewer as `BLOCKED`, include the missing agent/skill name, and continue only with independent reviewers.
495
+ - Record the chosen runtime per reviewer in `review_context.review_plan.dispatch_plan`.
496
+ - The user-facing progress line must be explicit: "Running `<reviewer>` via `general-purpose` fallback because native agent type is unavailable."
497
+
498
+ Do not use vague fallback messages such as "running through available agent types" without naming which reviewers used fallback and why.
499
+
500
+ Pass each sub-reviewer a payload matching `skills/review-orchestrator/reviewer-input.schema.json`:
501
+
502
+ ```yaml
503
+ review_context: <bounded context pack>
504
+ reviewer: <skill-name>
505
+ scope_mode: diff | path
506
+ context_doc: <path or empty>
507
+ issue_url: <url or empty>
508
+ model_class: simple | normal | complex | current-session
509
+ budget:
510
+ max_prompt_tokens: <number or null>
511
+ max_findings: <number>
512
+
513
+ # If scope_mode = diff:
514
+ branch: <branch>
515
+ base_sha: <base sha>
516
+ diff: <filtered diff relevant to this reviewer>
517
+
518
+ # If scope_mode = path:
519
+ target_path: <resolved path or file list>
520
+ file_contents: <bounded file contents relevant to this reviewer>
521
+ ```
522
+
523
+ Each reviewer must return a `REVIEW_RESULT` object matching `skills/review-orchestrator/reviewer-finding.schema.json`, followed by a concise markdown summary. The orchestrator must reject or normalize free-form reports before consolidation.
524
+
525
+ **Important for path mode:** instruct each reviewer to check the **entire file**, not just changes. The scope report should say "Path: `<TARGET_PATH>`" instead of a branch/merge-base.
526
+
527
+ ### Greptile Reviewer
528
+
529
+ `review-greptile` runs in parallel with the other reviewers **when a PR number is available** (diff mode with a PR). It is excluded in path mode (no PR) unless `--greptile` is explicitly specified.
530
+
531
+ When dispatching `review-greptile`, pass additionally:
532
+
533
+ ```
534
+ PR_NUMBER: <pr number>
535
+ REPO: <owner/repo>
536
+ REMOTE: github | gitlab
537
+ ```
538
+
539
+ Greptile findings use `G-` prefixed IDs and are merged into the consolidated report under a dedicated section **"## Greptile (Codebase-Aware Findings)"** placed before the Blockers section. If Greptile identified cross-file impact not caught by other reviewers, those appear as additional blockers/majors.
540
+
541
+ **Auto-include Greptile when:** `--all` flag is used AND a PR number is resolvable from the current branch (`gh pr view` succeeds).
542
+
543
+ ---
544
+
545
+ ## Scope Boundaries
546
+
547
+ | Concern | This skill | Use instead |
548
+ |---------|------------|-------------|
549
+ | Routing and consolidation | YES | — |
550
+ | Logic correctness | NO | `review-logic` |
551
+ | Frontend patterns (React, MVVM) | NO | `review-frontend` |
552
+ | Architectural violations | NO | `review-architecture` |
553
+ | Security vulnerabilities | NO | `review-security-code` |
554
+ | Performance anti-patterns | NO | `review-performance` |
555
+ | Style / naming / import order | NO | `review-style` |
556
+ | Clean Code principles + SOLID at code level | NO | `review-clean-code` |
557
+ | Concurrency, resource pools, caching, queues, idempotency | NO | `review-highload` |
558
+ | Frontend repository conventions | NO | `review-frontend-conventions` |
559
+ | Test / e2e conventions | NO | `review-testing-practices` |
560
+ | Shared core boundary rules | NO | `review-core-boundaries` |
561
+ | Shared flow/graph abstraction contracts | NO | `review-flow-graph` |
562
+ | Legacy/profile review profiles | NO | `code-ai-review`, `code-b091-review`, `code-style-review`, `code-mobx-store-review` |
563
+
564
+ ---
565
+
566
+ ## Sub-Agent Report Quality Gate
567
+
568
+ Before consolidation, validate every reviewer result:
569
+ - Required status: `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, or `BLOCKED`.
570
+ - Required finding fields: id, severity, file, line (nullable only for repo-wide findings), problem, impact, suggested_fix, evidence, confidence, reviewer.
571
+ - Every blocker must include evidence and a concrete suggested fix.
572
+ - Findings without evidence are downgraded to `info` or returned to the reviewer for clarification.
573
+ - Duplicate findings are merged by `dedupe_key` or by `(file, line, problem)`.
574
+ - `NEEDS_CONTEXT` triggers one targeted context refill. If still unresolved, keep it as an explicit open question, not as a blocker.
575
+ - If a reviewer exceeds `max_findings`, keep blockers/majors first and summarize lower severity findings.
576
+
577
+ ---
578
+
579
+ ## Finding Format
580
+
581
+ ### Class scope — required for `blocker` and `major`
582
+
583
+ Every `blocker` and `major` finding must carry `class_scope`: **every** site that
584
+ holds the shape you found, and **how you enumerated them** — the grep or query
585
+ you ran, or the guard that derives the set.
586
+
587
+ A finding anchored to one `file:line` is a claim about one site. The recorded
588
+ history of this repository is that a fix then repairs that site and leaves its
589
+ siblings: one writer of five, one operator instruction of four, six readers of
590
+ eight. Each was found by the *next* review round, which is why reviews here have
591
+ run to seven and four rounds instead of one.
592
+
593
+ ```yaml
594
+ class_scope:
595
+ sites: ["src/lib/shell-config.ts:60", "src/session/store.ts:133"]
596
+ enumeration_method: "grep for the config-path resolvers; 7 writers, 2 unguarded"
597
+ ```
598
+
599
+ "I checked the others" is not an enumeration method. A single-entry `sites` list
600
+ is a claim that the class has exactly one member — make it deliberately, because
601
+ `review-finding.schema.json` accepts it and the next round tests it.
602
+
603
+ `minor` and `info` may omit it: enumerating the class for every low-severity
604
+ observation is theatre, not rigour.
605
+
606
+ All findings from all sub-reviewers must be normalized to this format before consolidation:
607
+
608
+ ```markdown
609
+ ### [F-NNN] Title
610
+
611
+ - **Severity**: blocker | major | minor | info
612
+ - **File**: path/to/file.ts:line
613
+ - **Problem**: what is wrong
614
+ - **Why it matters**: impact on correctness / safety / maintainability / UX
615
+ - **Fix**: concrete suggestion
616
+ - **Patch** (optional):
617
+ ```diff
618
+ - old line
619
+ + new line
620
+ ```
621
+ ```
622
+
623
+ Severity ordering for sort: `blocker` > `major` > `minor` > `info`.
624
+
625
+ ---
626
+
627
+ ### Model Metadata Rules
628
+
629
+ `current-session` is a model assignment/runtime strategy, not a model name. Never render it as `model: current-session` or as the PR comment `Model` value.
630
+
631
+ When writing review report metadata or a PR comment:
632
+ 1. Read `review_context.token_policy.model_plan`.
633
+ 2. Set `Model strategy` from `model_plan.strategy`.
634
+ 3. Set `Current model` from the first available value: `model_plan.current_model`, detected tool output, current runtime model shown by the platform, or `unknown`.
635
+ 4. If `strategy` is `adaptive`, `economy`, or `per-group`, include model classes: `complex_model`, `normal_model`, and `simple_model` when known.
636
+ 5. If model assignment is unsupported and `strategy` is `current-session`, write `Model assignment: current session` and still write `Current model: <actual model or unknown>`.
637
+ 6. If the actual model is unknown, write `unknown`; do not substitute `current-session`.
638
+
639
+ ---
640
+
641
+ ## Output Contract
642
+
643
+ ```
644
+ STATUS: DONE | DONE_WITH_CONCERNS
645
+ ```
646
+
647
+ `DONE` — no blockers or majors found.
648
+ `DONE_WITH_CONCERNS` — one or more blocker or major findings present.
649
+
650
+ ```markdown
651
+ # Review Report
652
+
653
+ ## Verdict: APPROVE | APPROVE_WITH_SUGGESTIONS | REQUEST_CHANGES
654
+ <!-- APPROVE: zero blockers/majors. APPROVE_WITH_SUGGESTIONS: minors/info only.
655
+ REQUEST_CHANGES: one or more blocker or major. -->
656
+
657
+ ## Summary
658
+ <2-4 sentences: what the change does, overall code health, key concerns.>
659
+
660
+ ## Review Scope
661
+ - Branch: `<BRANCH>`
662
+ - Parent ref: `<PARENT>`
663
+ - Merge-base: `<BASE_SHA>`
664
+ - Scope mode: `<default-with-uncommitted | explicit-hash-range>`
665
+ - Reviewers dispatched: <comma-separated list>
666
+ - Changed files: <count>
667
+ - Context mode: `<none | light | full>`
668
+ - Model strategy: `<current | ask | adaptive | economy | per-group | current-session>`
669
+ - Current model: `<actual current model id/name, or unknown>`
670
+ - Model assignment: `<single current session | adaptive classes | per reviewer classes | unsupported>`
671
+ - Token budget: `<used/limit if known; omissions count>`
672
+
673
+ ## Stats
674
+ - blocker: N
675
+ - major: N
676
+ - minor: N
677
+ - info: N
678
+
679
+ ## Blockers (must fix before merge)
680
+ <[F-NNN] findings with severity=blocker, sorted by file>
681
+
682
+ ## Major Issues
683
+ <[F-NNN] findings with severity=major>
684
+
685
+ ## Minor & Info
686
+ <[F-NNN] findings with severity=minor or info>
687
+
688
+ ## Positive Notes
689
+ <Optional. Highlight things done well. Keep brief.>
690
+ ```
691
+
692
+ ---
693
+
694
+ ## Skill Learning Handoff
695
+
696
+ After findings are consolidated, decide whether any of them should re-train a
697
+ project-skill (see `rules/core/skill-lifecycle.mdc`). A review is the strongest
698
+ learning signal: a finding that a project-skill *should have prevented* means the
699
+ skill is stale or incomplete.
700
+
701
+ 1. For each blocker/major finding, `keryx skills route <finding-file>` to
702
+ see if a project-skill covers that module/entity.
703
+ 2. If a covered skill exists and the finding reflects a rule the skill omits or
704
+ contradicts — especially if the **same class of finding recurs** across files
705
+ or across reviews — flag it for learning.
706
+ 3. Do not mutate the skill yourself. Emit a `Skill Learning` block in the report
707
+ and hand it to the caller (`job-orchestrator` / `flow-orchestrator`), which
708
+ dispatches `skills learn` as a subagent (cheaper model if available):
709
+
710
+ ```markdown
711
+ ## Skill Learning
712
+ - `<module>/<skill>` ← F-012, F-019 (missing null-guard convention). Suggested:
713
+ keryx skills learn --from-review <report-path> --skill <module>/<skill>
714
+ ```
715
+
716
+ If no findings map to a project-skill, write `## Skill Learning\n- none`.
717
+ Never run `skills learn apply` from the reviewer — proposal review and apply are
718
+ the orchestrator's step.
719
+
720
+ ---
721
+
722
+ ## PR Review Report Publication
723
+
724
+ When the review target is a GitHub pull request, ask whether to publish the consolidated review report after the report is generated. A PR target is present when the user provided a PR URL/number, `gh pr view` resolves the current branch, or the caller passes `pr_number` / `pr_url`.
725
+
726
+ Ask before publishing unless `publish_pr_review_report` was explicitly set by automation settings:
727
+
728
+ ```text
729
+ Publish this review report to the PR?
730
+
731
+ A) Concise PR comment only
732
+ B) Concise PR comment + detailed AI markdown artifact (recommended for follow-up fixes)
733
+ C) Do not publish
734
+
735
+ > pick a letter (default: C)
736
+ ```
737
+
738
+ **Automation values:**
739
+ - `publish_pr_review_report: comment` or legacy `true` -> publish the concise PR comment only.
740
+ - `publish_pr_review_report: comment-and-ai-artifact` -> publish the concise PR comment and generate the detailed AI markdown artifact.
741
+ - `publish_pr_review_report: none` or legacy `false` -> do not publish.
742
+
743
+ **Default:** do not publish without explicit confirmation. If no PR number can be resolved, skip publication and state that no PR target was available.
744
+
745
+ ### Concise PR Comment
746
+
747
+ The visible PR comment is for humans. It must be written in English only and stay concise.
748
+
749
+ ```markdown
750
+ ## AI Review Report
751
+
752
+ **Verdict:** REQUEST_CHANGES
753
+ **Summary:** 2-3 concise sentences with overall risk and the main merge blocker.
754
+
755
+ | Severity | Area | Finding | Suggested Fix | Owner |
756
+ |---|---|---|---|---|
757
+ | blocker | `src/file.ts:42` | What is broken and why it matters. | Concrete fix direction, not a vague instruction. | author |
758
+
759
+ <details>
760
+ <summary>Minor / info findings</summary>
761
+
762
+ | Severity | Area | Finding | Suggested Fix |
763
+ |---|---|---|---|
764
+ | minor | `src/other.ts:10` | ... | ... |
765
+
766
+ </details>
767
+
768
+ ### Meta
769
+ | Field | Value |
770
+ |---|---|
771
+ | Orchestrator | `review-orchestrator` |
772
+ | Model | `<actual current model id/name, or unknown; never current-session>` |
773
+ | Model strategy | `<current | ask | adaptive | economy | per-group | current-session>` |
774
+ | Model assignment | `<current session | adaptive classes | per reviewer classes | unsupported>` |
775
+ | Agents run | `<reviewers actually dispatched, including fallback runtimes when used>` |
776
+ | Available reviewers | `<all reviewers considered by the orchestrator for this repository/runtime, grouped briefly as generic/convention/project/legacy when useful>` |
777
+ | Skipped reviewers | `<reviewers not dispatched with short reasons, e.g. no matching files, optional group not selected, unavailable native agent, PR number missing>` |
778
+ | Selection basis | `<auto-detected scope, explicit flags, user-selected optional groups, and why this reviewer set was chosen>` |
779
+ | Fallback/blocked reviewers | `<reviewers run via fallback or blocked because native agent/skill was unavailable, otherwise none>` |
780
+ | Scope | `<PR #N, base..head, merge-base>` |
781
+ | Commit | `<HEAD sha>` |
782
+ | Context | `<job/context path if provided, otherwise none>` |
783
+ | AI artifact | `<markdown link or file path to the detailed AI report when generated, otherwise none>` |
784
+ | AI artifact description | `<one concise human-readable sentence explaining that the linked markdown file contains detailed findings, fix guidance, patch guidance, regression coverage, validation plan, and follow-up agent context>` |
785
+ | Reviewed at | `<UTC timestamp>` |
786
+ ```
787
+
788
+ ### Detailed AI Markdown Artifact
789
+
790
+ When the user chooses option B, generate a separate English-only markdown artifact for AI follow-up work. Prefer a repository-local job/review path such as:
791
+
792
+ ```text
793
+ jobs/reviews/pr-<number>/review-ai-report.md
794
+ ```
795
+
796
+ If the review is running inside `job-orchestrator`, write it under the active job docs, for example:
797
+
798
+ ```text
799
+ .metaproject/jobs/<job-name>/ai/review-ai-report.md
800
+ ```
801
+
802
+ If the environment provides an external artifact mechanism, attach or upload that markdown file and put the link/path in the concise PR comment `AI artifact` meta row. If no attachment/upload mechanism exists, keep the file path in the comment and in `review_context.review_plan.publication_plan.ai_artifact_path`.
803
+
804
+ The concise PR comment must also include an `AI artifact description` meta row whenever an AI artifact is generated. The description is for human readers and must explain what was added and what the file contains, for example: `Detailed AI follow-up report with expanded findings, fix guidance, illustrative patch guidance, Gherkin regression coverage, validation plan, and context for follow-up agents.`
805
+
806
+ The AI artifact must use this structure:
807
+
808
+ ```markdown
809
+ ---
810
+ review_run_id: <stable id, e.g. pr-5462-2026-06-13T10-22-00Z>
811
+ orchestrator: review-orchestrator
812
+ verdict: <APPROVE | APPROVE_WITH_SUGGESTIONS | REQUEST_CHANGES>
813
+ context_mode: <none | light | full>
814
+ model_strategy: <current | ask | adaptive | economy | per-group | current-session>
815
+ current_model: <actual current model id/name, or unknown>
816
+ model_assignment: <current session | adaptive classes | per reviewer classes | unsupported>
817
+ agents:
818
+ - <reviewer>
819
+ scope:
820
+ pr: <number or null>
821
+ base: <base sha/ref>
822
+ head: <head sha/ref>
823
+ files_changed: <count>
824
+ generated_at: <UTC timestamp>
825
+ ---
826
+
827
+ # AI Review Report
828
+
829
+ ## Executive Summary
830
+ <Short machine-readable summary of merge risk and required fix order.>
831
+
832
+ ## Review Context
833
+ <Bounded description of diff scope, requirements, omitted context, and assumptions.>
834
+
835
+ ## Findings
836
+
837
+ ### F-NNN: <title>
838
+
839
+ - Severity: blocker | major | minor | info
840
+ - Reviewer: <reviewer>
841
+ - File: `path/to/file.ts`
842
+ - Lines: <line or range>
843
+ - Confidence: high | medium | low
844
+ - Status: open
845
+
846
+ Problem:
847
+ <Detailed explanation of what is wrong.>
848
+
849
+ Why it matters:
850
+ <Correctness, safety, maintainability, performance, or UX impact.>
851
+
852
+ Evidence:
853
+ <Specific code references or behavior observed.>
854
+
855
+ Suggested fix:
856
+ <Detailed fix plan with steps.>
857
+
858
+ Patch guidance:
859
+ ```diff
860
+ <Optional illustrative diff. Keep it minimal and clearly mark if illustrative.>
861
+ ```
862
+
863
+ Regression coverage:
864
+ ```gherkin
865
+ Feature: <feature or invariant>
866
+
867
+ Scenario: <behavior that should not regress>
868
+ Given <initial state>
869
+ When <action>
870
+ Then <expected result>
871
+ ```
872
+
873
+ ## Fix Order
874
+ 1. <Blocker/major fix sequencing with dependencies.>
875
+
876
+ ## Validation Plan
877
+ - <Commands or checks to run.>
878
+
879
+ ## Notes For Follow-Up Agents
880
+ <Context needed by an implementer agent; no secrets, raw prompts, or unrelated local paths.>
881
+ ```
882
+
883
+ Formatting rules for PR comments and AI artifacts:
884
+ - English only, regardless of chat language or reviewer output language.
885
+ - Keep the visible comment concise: max 10 blocker/major rows before `<details>`.
886
+ - Put minor/info findings under `<details>` unless there are no higher severity findings.
887
+ - Every blocker/major row must include a concrete suggested fix.
888
+ - Include enough metadata to reproduce the review, but do not include internal prompts, raw logs, secrets, or unrelated local paths.
889
+ - The PR comment metadata must distinguish `Agents run` from `Available reviewers` and `Skipped reviewers`; never use a single `Agents` row that hides skipped or unavailable reviewers.
890
+ - `Skipped reviewers` must include short reasons from `review_context.routing.reasons`, `review_context.review_plan.skipped`, and dispatch/runtime compatibility checks.
891
+ - If the list is long, keep `Agents run` complete and summarize `Available reviewers` / `Skipped reviewers` by group with counts plus notable names; put full details in the AI artifact when one is generated.
892
+ - When `comment-and-ai-artifact` is selected, the PR comment meta section must include both `AI artifact` and `AI artifact description`; do not rely on the link alone.
893
+ - In the metadata table, `Model` must be the actual model id/name. Put `current-session`, `adaptive`, or `per-group` under `Model strategy` / `Model assignment`, not under `Model`.
894
+ - If posting via CLI, write the body to a temp file and use `gh pr comment <pr-number> --body-file <file>`; never inline a large heredoc into shell history.
895
+
896
+ ---
897
+
898
+ ## Job Context Awareness
899
+
900
+ When dispatched by `job-orchestrator` or called with an explicit context path, the prompt MAY include:
901
+
902
+ ```
903
+ JOB_NAME: <job-name>
904
+ CONTEXT_PATH: .metaproject/jobs/<job-name>/ai/context.md
905
+ ```
906
+
907
+ If provided and the file exists, read the context document **before** running scope detection.
908
+ Use it to understand:
909
+ - Intentionally chosen libraries and patterns (do not flag as issues)
910
+ - Architectural decisions already agreed upon
911
+ - Acceptance criteria to drive the Stage 1 spec compliance gate
912
+
913
+ If absent, proceed normally — context is optional and non-blocking.
914
+
915
+ ---
916
+
917
+ ## Red Flags
918
+
919
+ | Rationalization | Why it is wrong |
920
+ |----------------|-----------------|
921
+ | "I'll just run all reviewers for safety" | Over-reviews waste time; auto-detect for relevant scope |
922
+ | "Spec compliance can wait until after quality review" | Stage 1 gate exists because unimplemented requirements invalidate quality work |
923
+ | "I'll deduplicate findings manually in my head" | Always normalize to [F-NNN] format before consolidation to avoid losing findings |
924
+ | "Minor findings from one reviewer cancel out the major from another" | Each finding stands independently; severity is per-finding, not averaged |
925
+ | "No flags means no reviewers" | No flags → run auto-detection; never produce an empty review |
926
+ | "User named a module so I'll use diff mode" | Named module/component/store → path mode; diff mode is only for branch changes |
927
+ | "Path mode should only show lines I'd flag in diff mode" | Path mode reviews the entire file — all findings apply, not just added lines |