@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,163 @@
1
+ ---
2
+ description: "Error handling standards: Result pattern, explicit typed errors, no silent failures, no throw-everywhere anti-pattern. Use when implementing functions that can fail, calling external APIs, or handling async operations."
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Error Handling
7
+
8
+ ## Purpose
9
+ Prevent silent failures, unhandled promise rejections, and throw-everywhere anti-patterns. Enforce the Result pattern for recoverable errors and explicit error types for domain failures.
10
+
11
+ ## When To Apply
12
+ Apply whenever writing code that interacts with external systems, parses user input, performs I/O, or executes operations that can fail.
13
+
14
+ ---
15
+
16
+ ## Core Principle: Errors Are Values
17
+
18
+ Recoverable errors are data, not exceptions. Use the **Result pattern** to make failure explicit in the type signature:
19
+
20
+ ```typescript
21
+ type Result<T, E = Error> =
22
+ | { ok: true; value: T }
23
+ | { ok: false; error: E };
24
+
25
+ function ok<T>(value: T): Result<T, never> {
26
+ return { ok: true, value };
27
+ }
28
+ function err<E>(error: E): Result<never, E> {
29
+ return { ok: false, error };
30
+ }
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Rules
36
+
37
+ ### Rule 1: Result Pattern for Recoverable Errors
38
+ Any function that performs I/O, calls an external API, or parses external data MUST return `Result<T, E>` instead of throwing.
39
+
40
+ ```typescript
41
+ // BAD — caller has no idea this can fail from the type alone
42
+ async function fetchUser(id: string): Promise<User> {
43
+ const res = await http.get(`/users/${id}`);
44
+ return res.data; // throws if 404
45
+ }
46
+
47
+ // GOOD — failure is part of the contract
48
+ async function fetchUser(id: string): Promise<Result<User, NotFoundError | NetworkError>> {
49
+ const res = await http.get(`/users/${id}`).catch(e => null);
50
+ if (!res) return err(new NetworkError('fetch failed'));
51
+ if (res.status === 404) return err(new NotFoundError(id));
52
+ return ok(res.data);
53
+ }
54
+ ```
55
+
56
+ ### Rule 2: Typed Domain Errors
57
+ Do not throw or return generic `Error`. Create typed error classes per domain:
58
+
59
+ ```typescript
60
+ // BAD
61
+ throw new Error('user not found');
62
+
63
+ // GOOD
64
+ export class NotFoundError extends Error {
65
+ readonly code = 'NOT_FOUND';
66
+ constructor(public readonly resource: string, public readonly id: string) {
67
+ super(`${resource} with id "${id}" not found`);
68
+ }
69
+ }
70
+ ```
71
+
72
+ Common typed errors to define per domain:
73
+ - `NotFoundError(resource, id)`
74
+ - `ValidationError(field, message)`
75
+ - `UnauthorizedError(action)`
76
+ - `ConflictError(resource, detail)`
77
+ - `ExternalServiceError(service, cause)`
78
+
79
+ ### Rule 3: No Silent Failures
80
+ Never swallow errors without action. Every `catch` block must either:
81
+ - Re-throw (or return `err(...)`)
82
+ - Log with full context AND take fallback action
83
+ - Explicitly mark the result as degraded
84
+
85
+ ```typescript
86
+ // BAD — silent failure
87
+ try {
88
+ await sendNotification(user);
89
+ } catch (_) {}
90
+
91
+ // GOOD — explicit, logged, handled
92
+ try {
93
+ await sendNotification(user);
94
+ } catch (e) {
95
+ logger.warn('notification failed', { userId: user.id, error: e });
96
+ // explicit decision: continue without notification
97
+ }
98
+ ```
99
+
100
+ ### Rule 4: No Unhandled Promise Rejections
101
+ Every `async` call chain must end with error handling. `Promise.all` rejections must be caught. Fire-and-forget patterns must use `.catch(logger.error)`.
102
+
103
+ ```typescript
104
+ // BAD
105
+ Promise.all([fetchA(), fetchB()]); // unhandled rejection if either fails
106
+
107
+ // GOOD
108
+ const results = await Promise.allSettled([fetchA(), fetchB()]);
109
+ const failures = results.filter(r => r.status === 'rejected');
110
+ if (failures.length > 0) { /* handle */ }
111
+ ```
112
+
113
+ ### Rule 5: Propagate, Don't Wrap Blindly
114
+ When catching and re-throwing, preserve the original error as `cause`:
115
+
116
+ ```typescript
117
+ // BAD — original stack trace lost
118
+ catch (e) { throw new Error('database failed'); }
119
+
120
+ // GOOD — chain preserved
121
+ catch (e) { throw new DatabaseError('write failed', { cause: e }); }
122
+ ```
123
+
124
+ ### Rule 6: No Assertions in Production Code
125
+ `assert(condition, msg)` that throws in production is an anti-pattern for recoverable errors. Use guard clauses that return `Result` or throw typed errors.
126
+
127
+ ---
128
+
129
+ ## Error Boundary Hierarchy
130
+
131
+ ```
132
+ External boundary (API, DB, filesystem)
133
+ └─ Return Result<T, DomainError> ← convert to typed error here
134
+ └─ Domain / use-case layer
135
+ └─ Return Result<T, E> up the stack
136
+ └─ Controller / handler
137
+ └─ Map to HTTP status / user message here
138
+ ```
139
+
140
+ **Only the outermost layer (controller/handler) maps errors to HTTP responses or user messages.** Business logic never formats error messages for the UI.
141
+
142
+ ---
143
+
144
+ ## Iron Laws
145
+
146
+ **IRON LAW 1: A `catch (_) {}` block is forbidden. Every caught exception must be logged or returned as Result.**
147
+ **IRON LAW 2: Generic `throw new Error('message')` in domain code is forbidden. Always use typed error classes.**
148
+ **IRON LAW 3: Any function that can fail due to external conditions MUST reflect that in its return type.**
149
+
150
+ ---
151
+
152
+ ## Red Flags — Stop and re-read this rule if you are thinking:
153
+
154
+ | Rationalization | Why it's wrong |
155
+ |---|---|
156
+ | "I'll just throw here, the caller will handle it" | The caller often doesn't handle it — unhandled rejections crash processes silently |
157
+ | "The error is unlikely, I'll skip the error case" | Unlikely errors are exactly the ones that cause production incidents |
158
+ | "I'll add proper error handling in a follow-up" | Error handling added after-the-fact misses edge cases that were obvious during initial implementation |
159
+ | "Using Result makes the code verbose" | Verbosity here is intentional: it forces the caller to acknowledge that failure is possible |
160
+ | "I'll wrap everything in a try/catch at the top" | Top-level catch loses all type information and context — handle errors close to their source |
161
+ | "I can just check if the value is null after" | Null is not an error type — it conveys nothing about why the operation failed |
162
+
163
+ **IRON LAW: SILENCE IS NOT A VALID ERROR STRATEGY. EVERY FAILURE PATH MUST BE OBSERVABLE.**
@@ -0,0 +1,99 @@
1
+ ---
2
+ type: rule
3
+ id: execution-metrics
4
+ priority: reference
5
+ generated_by: keryx
6
+ ---
7
+
8
+ # Execution Metrics (opt-in efficiency report)
9
+
10
+ A uniform, honest end-of-run report so different runs of the same skill can be
11
+ compared. Observational only — it never changes the task.
12
+
13
+ ## When it applies
14
+
15
+ ONLY when a skill is run **directly by a user** (not dispatched as a subagent by
16
+ an orchestrator) — this includes when the user runs an orchestrator itself.
17
+
18
+ At the START of such a run, ask exactly one yes/no question and wait:
19
+
20
+ > Collect execution statistics for this run? (yes / no)
21
+
22
+ - Skip the question if the user already answered it (in the prompt or a prior
23
+ turn), or if you are a dispatched subagent (never ask; never emit the report —
24
+ the top-level orchestrator owns it).
25
+ - If **no** → proceed normally, add nothing.
26
+ - If **yes** → do the task as usual, then append the `## Execution Metrics`
27
+ section (below) as the LAST thing in your final response.
28
+
29
+ Do NOT alter, slow, or reshape the main task to gather metrics. If gathering a
30
+ metric would require extra work, mark it `unknown` instead.
31
+
32
+ ## Persistence (artifact-producing skills)
33
+
34
+ Skills that create artifacts (flow-*, autodoc-*, job-*, docpack-*, documenters,
35
+ gdwiki enrichment, or anything that writes files) MUST also save the report:
36
+
37
+ - Flows → `<flow-dir>/metrics/run-<ISO-timestamp>.md`
38
+ - Otherwise → `.metaproject/data/<primary-module>/metrics/run-<ISO-timestamp>.md`
39
+
40
+ Create the directory. Use a filesystem-safe timestamp (colons → `-`). Print the
41
+ saved path under the table. This lets the post-commit hook and future runs find
42
+ past reports.
43
+
44
+ ## Honesty rules (do not fabricate)
45
+
46
+ - Never invent an exact value. If a metric is not exposed by the CLI/runtime,
47
+ write `unknown` or `estimated` and name the source in the `Source` column.
48
+ - If the CLI/runtime exposes real usage/tokens/cost/duration, use those exact
49
+ numbers and mark `Source = cli`.
50
+ - Tokens/cost: exact ONLY if the runtime surfaces them. Otherwise `estimated`
51
+ with a one-line basis (e.g. "≈ files_read × avg size"), or `unknown`. Never a
52
+ precise-looking guess.
53
+ - Counts you can observe from your own tool calls (shell commands, files
54
+ read/modified, subagents) are `counted`; git-derived numbers are `git`.
55
+
56
+ ## `## Execution Metrics` section (required — emit even if many values are `unknown`)
57
+
58
+ | Metric | Value | Source | Notes |
59
+ |---|---:|---|---|
60
+ | run_mode | user-direct / orchestrator | self | how this skill was invoked |
61
+ | skill | ... | self | skill name + version |
62
+ | model_used | ... | self/cli | model id if known |
63
+ | started_at | ... | system/self | ISO timestamp if known |
64
+ | finished_at | ... | system/self | ISO timestamp if known |
65
+ | wall_time_minutes | ... | measured/estimated | total elapsed time |
66
+ | total_tool_calls | ... | counted | number of shell/tool calls made |
67
+ | shell_commands_run | ... | counted | count only terminal/shell commands |
68
+ | files_read | ... | counted/estimated | unique files inspected |
69
+ | files_modified | ... | counted | unique files changed |
70
+ | lines_changed | ... | git | added + removed (`git diff --stat`) if available |
71
+ | tests_or_checks_run | ... | counted | list commands separately below |
72
+ | tests_or_checks_passed | ... | counted | pass/fail/unknown |
73
+ | subagents_used | ... | counted | 0 if none |
74
+ | subagent_names | ... | counted | comma-separated or none |
75
+ | tokens_total | ... | cli/unknown/estimated | exact only if runtime exposes it |
76
+ | tokens_input | ... | cli/unknown/estimated | exact only if runtime exposes it |
77
+ | tokens_output | ... | cli/unknown/estimated | exact only if runtime exposes it |
78
+ | tokens_per_subagent | ... | cli/unknown/estimated | map subagent -> tokens if available |
79
+ | context_sources_used | ... | counted | e.g. AGENTS, CLAUDE, keryx index, wiki, graph |
80
+ | keryx_used | yes/no | observed | whether keryx commands/files were used |
81
+ | keryx_commands_run | ... | counted | exact commands if any |
82
+ | graph_used | yes/no | observed | gdgraph / graphify / keryx graph usage |
83
+ | wiki_used | yes/no | observed | .metaproject/wiki or keryx wiki usage |
84
+ | health_used | yes/no | observed | keryx health usage |
85
+ | artifacts_written | ... | counted | files/pages this run created or updated |
86
+ | blockers_or_retries | ... | counted | failed commands, retries, missing deps |
87
+ | final_status | done / partial / blocked | self | final outcome |
88
+
89
+ After the table, add:
90
+
91
+ 1. **Commands Run** — every command actually executed (verbatim, in order).
92
+ 2. **Artifacts Changed** — every file created/modified (paths).
93
+ 3. **Comparison Notes** — 3–5 bullets on what likely affected speed / quality /
94
+ amount of context (e.g. graph freshness, batch size, model tier, cache).
95
+ 4. **Metric Reliability** — which metrics are exact (`counted`/`git`/`cli`),
96
+ which are `estimated` (and why), which are `unknown` (and why unavailable).
97
+
98
+ The `## Execution Metrics` section is MANDATORY when stats were opted in, even if
99
+ several values are `unknown`.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: "Frontend delivery guidelines for TypeScript, React, MobX, Ant Design, and Tailwind CSS."
3
+ alwaysApply: false
4
+ globs:
5
+ - "src/**/*.ts"
6
+ - "src/**/*.tsx"
7
+ ---
8
+
9
+ # Frontend Assistant Guidelines
10
+
11
+ ## Purpose
12
+ Produce clean, maintainable, production-ready frontend code aligned with project architecture.
13
+
14
+ ## When To Apply
15
+ Apply when implementing features in the frontend project (TypeScript/React/MobX/Ant Design/Tailwind CSS).
16
+
17
+ ## Stack
18
+ - TypeScript
19
+ - React
20
+ - MobX
21
+ - Ant Design
22
+ - Tailwind CSS
23
+ - Axios
24
+
25
+ ## Core Principles
26
+ - Keep scope minimal and pragmatic.
27
+ - Follow DRY and KISS.
28
+ - Prefer explicit typing.
29
+ - Keep business logic in stores/services, not in view components.
30
+
31
+ ## Technical Rules
32
+ - Use strict TypeScript types; avoid `any`.
33
+ - Follow `core/mobx-store-template.mdc` for MobX store patterns.
34
+ - Use Ant Design for components and Tailwind for layout/utilities.
35
+ - Avoid unnecessary third-party dependencies.
36
+
37
+ ## Output Contract
38
+ - Final solutions must be Markdown.
39
+ - Code must be in fenced code blocks with language labels.
40
+ - Response language must match user query language.
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: "Git safety rules for protected paths and controlled apply-changes flow."
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Git Commit Rules
7
+
8
+ ## Purpose
9
+ Prevent accidental commits and enforce controlled publishing flow.
10
+
11
+ ## When To Apply
12
+ Apply before any git operation: commit, branch creation, or PR creation. Always loaded alongside commit-message-formatting.mdc.
13
+
14
+ ## Protected Paths
15
+ - `.cursor/`: never commit.
16
+ - `<DOCS_ROOT>/`: do not commit by default unless explicitly approved by the user.
17
+ - `.metaproject/jobs/` (or `$GDMETAPRO_JOBS_ROOT`): do not commit by default unless explicitly approved by the user. Job documentation — never force-delete; contains orchestrator run artifacts.
18
+
19
+ ## Mandatory Behavior
20
+ 1. Ensure protected paths are covered in `.gitignore`.
21
+ 2. After rule/doc updates, ask user whether to apply changes.
22
+ 3. If approved: create branch from `main`, commit, and open PR to `main`.
23
+ 4. If declined: do not create branch/commit/PR.
24
+
25
+ ## Commit Message Rules
26
+ Follow `core/commit-message-formatting.mdc`.
27
+
28
+ ## Red Flags — Stop and re-read this rule if you are thinking:
29
+
30
+ | Rationalization | Why it's wrong |
31
+ |---|---|
32
+ | "This is a quick fix, I'll commit directly to main" | Branch protection rules exist precisely for quick fixes that turn into incidents |
33
+ | "The protected path isn't really sensitive here, I'll include it" | Protected paths are protected unconditionally — context does not create exceptions |
34
+ | "The user said to commit everything, so I'll skip the .gitignore check" | User instructions override workflow steps, not safety invariants |
35
+ | "I'll ask about the PR later — let me commit first to save the work" | Committing before confirming intent conflates saving work with publishing it |
36
+
37
+ **IRON LAW: NEVER COMMIT TO A PROTECTED PATH OR BRANCH WITHOUT EXPLICIT USER APPROVAL, REGARDLESS OF HOW URGENT THE CHANGE APPEARS.**
@@ -0,0 +1,198 @@
1
+ ---
2
+ description: >
3
+ Dispatch and return contracts for gproject subagents. Extends
4
+ subagent-context-construction.md with gproject-specific fields.
5
+ Loaded by: gproject-orchestrator, all gproject-* subagents.
6
+ globs: skills/gproject-*/**
7
+ alwaysApply: false
8
+ ---
9
+
10
+ # gproject Subagent Contracts
11
+
12
+ ## Extends
13
+
14
+ This rule extends `rules/core/subagent-context-construction.md` and
15
+ `rules/core/subagent-status-protocol.md`. All base rules apply.
16
+ gproject adds domain-specific fields.
17
+
18
+ ---
19
+
20
+ ## Language Rule
21
+
22
+ All gproject subagents MUST respond in the same language the user used in their
23
+ original request. If the user wrote in Russian — respond in Russian. If in English — in English.
24
+ This applies to artifact content, summaries, questions, and all user-facing output.
25
+ The decisions registry keys (D_mode, D_frontend, etc.) remain in English regardless of language.
26
+
27
+ ---
28
+
29
+ ## Dispatch Contract (Orchestrator → Subagent)
30
+
31
+ Every dispatch from gproject-orchestrator MUST include:
32
+
33
+ ```yaml
34
+ # Required (from base protocol)
35
+ description: "<phase>: <task>"
36
+ subagent_type: "general"
37
+ prompt: "<structured prompt — see template below>"
38
+
39
+ # gproject-specific (inside prompt)
40
+ phase: "<phase number and name>"
41
+ mode: "new_project | task_in_project"
42
+ user_language: "<language of the original user request>"
43
+ input_artifacts: [<ONLY files this subagent needs>]
44
+ decisions_so_far: <ONLY decisions relevant to this phase>
45
+ constraints: [<from previous phases>]
46
+ output_contract:
47
+ artifact_path: "<where to write full output>"
48
+ summary_max_tokens: 150
49
+ decisions_format: "key: value"
50
+ ```
51
+
52
+ ### Minimality Principle (Enhanced)
53
+
54
+ Base rule says: "Subagents must not infer context from conversation history."
55
+ gproject strengthens this:
56
+
57
+ 1. **Artifact minimality**: subagent receives ONLY artifacts listed in
58
+ `input_artifacts` — never all artifacts in the job directory
59
+ 2. **Decision minimality**: subagent receives ONLY decisions relevant to
60
+ its phase — not the full decisions.md
61
+ 3. **No cross-phase leakage**: Phase 4 agent cannot see Phase 0 raw data
62
+ unless explicitly passed (which it shouldn't be — use Phase 1 summary instead)
63
+
64
+ ### What each phase receives:
65
+
66
+ | Phase | Input Artifacts | Decisions Subset |
67
+ |-------|----------------|-----------------|
68
+ | 0: Discovery | user input, uploaded docs, repo path | none (first phase) |
69
+ | 1: Problem | discovery-brief.md | D_mode, D_domain, D_audience, D_scale |
70
+ | 2: Stack | problem-statement.md | D_core_problems, D_goals, D_non_goals |
71
+ | 3: Patterns | stack-decision.md, problem-statement.md | D_level, D_frontend..D_infra |
72
+ | 4: PRD | problem-statement.md, architecture.md, tech-bestpractices.md | ALL decisions |
73
+ | 5: Review | ALL artifacts, decisions.md | ALL decisions |
74
+ | 6: Planning | prd.md, architecture.md | ALL decisions |
75
+
76
+ ---
77
+
78
+ ## Return Contract (Subagent → Orchestrator)
79
+
80
+ Every subagent response MUST begin with STATUS prefix (per base protocol)
81
+ and include gproject-specific fields:
82
+
83
+ ### STATUS: DONE
84
+
85
+ ```yaml
86
+ STATUS: DONE
87
+ summary: |
88
+ <3-5 sentences. What was produced, key decisions made, confidence level.>
89
+ <Max 150 tokens.>
90
+ new_decisions:
91
+ D_<name>: "<value>"
92
+ artifact_path: ".metaproject/jobs/<job>/artifacts/<name>.md"
93
+ next_phase_needs:
94
+ - "<hint for orchestrator about what next phase will need>"
95
+ ```
96
+
97
+ ### STATUS: DONE_WITH_CONCERNS
98
+
99
+ ```yaml
100
+ STATUS: DONE_WITH_CONCERNS
101
+ summary: |
102
+ <3-5 sentences. Same as DONE but includes concern summary.>
103
+ new_decisions:
104
+ D_<name>: "<value>"
105
+ concerns:
106
+ - severity: "high | medium"
107
+ description: "<what's wrong>"
108
+ suggestion: "<how to address>"
109
+ artifact_path: ".metaproject/jobs/<job>/artifacts/<name>.md"
110
+ ```
111
+
112
+ ### STATUS: NEEDS_CONTEXT
113
+
114
+ ```yaml
115
+ STATUS: NEEDS_CONTEXT
116
+ questions:
117
+ - id: "Q1"
118
+ text: "<clear question>"
119
+ options:
120
+ A: "<option — most common / recommended>"
121
+ B: "<option>"
122
+ C: "<option>"
123
+ D: "<option — 'not sure' or 'other' is acceptable>"
124
+ why: "<1 sentence: why this matters for this phase>"
125
+ can_be_resolved_by_agent: false | "<agent name if yes>"
126
+ - id: "Q2"
127
+ ...
128
+ partial_artifact_path: ".metaproject/jobs/<job>/artifacts/<name>.partial.md"
129
+ # Subagent MAY save partial work for resume
130
+ ```
131
+
132
+ ### STATUS: BLOCKED
133
+
134
+ ```yaml
135
+ STATUS: BLOCKED
136
+ blocker: "<clear description of what's blocking>"
137
+ required_to_unblock: "<what the orchestrator or user must provide>"
138
+ rollback_suggestion: "<if applicable, which phase to go back to>"
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Orchestrator Context Budget
144
+
145
+ The orchestrator MUST stay within these limits:
146
+
147
+ | Item | Max Tokens | Notes |
148
+ |------|-----------|-------|
149
+ | state.json | 200 | Pipeline state only |
150
+ | decisions.md (in memory) | 500 | Compact: ID + value only |
151
+ | Phase summaries (all) | 800 | Max 120 per phase |
152
+ | Current dispatch overhead | 400 | Template + routing logic |
153
+ | **Total** | **~1900** | If exceeded, compress decisions |
154
+
155
+ ### Compression triggers:
156
+ - decisions.md > 800 tokens → create decisions-compact.md (ID: value only, no rationale)
157
+ - phase_summaries total > 800 → keep only last 3 phases in memory, rest on disk
158
+
159
+ ---
160
+
161
+ ## NEEDS_CONTEXT Resolution Protocol
162
+
163
+ When a subagent returns NEEDS_CONTEXT:
164
+
165
+ ```
166
+ 1. Parse questions array
167
+ 2. For each question:
168
+ IF can_be_resolved_by_agent is truthy:
169
+ → Dispatch named agent with the question as task
170
+ → Collect answer
171
+ → Add to answers dict
172
+ ELSE:
173
+ → Add to user_questions list
174
+
175
+ 3. IF user_questions is not empty:
176
+ → Present to user as questionnaire
177
+ → Format: numbered questions with A/B/C/D options
178
+ → Collect answers
179
+
180
+ 4. Compose context supplement:
181
+ {
182
+ "answers": {
183
+ "Q1": {"choice": "B", "detail": "<if user added detail>"},
184
+ "Q2": {"choice": "A"}
185
+ },
186
+ "agent_research": {
187
+ "Q3": "<findings from dispatched agent>"
188
+ }
189
+ }
190
+
191
+ 5. Re-dispatch original subagent with:
192
+ - Original task + input_artifacts
193
+ - PLUS: context_supplement (above)
194
+ - PLUS: partial_artifact_path (if subagent saved partial work)
195
+
196
+ 6. Max 2 NEEDS_CONTEXT loops per phase
197
+ → After 2, escalate to user with full context
198
+ ```
@@ -0,0 +1,149 @@
1
+ ---
2
+ description: "Documentation mandate for all implementing agents: spec document at start, change report at end. Use when any agent is about to perform multi-step code implementation, feature development, or orchestrated task execution."
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Implementation Documentation Mandate
7
+
8
+ ## Purpose
9
+ Every non-trivial implementation job must produce two documents: a **spec** at the start (what will be done and why) and a **change report** at the end (what was done, what changed, test results). This makes AI-generated work auditable, resumable, and understandable to humans without reading the code.
10
+
11
+ ## When To Apply
12
+ Apply to any agent that:
13
+ - Implements more than one file change
14
+ - Runs for more than one phase / step
15
+ - Involves tests, review, or PR creation
16
+
17
+ Applies to: `job-orchestrator`, `feature-dev`, `task-implementer` (for multi-task jobs), any custom orchestration.
18
+ Does NOT apply to: single-file quick fixes, standalone read-only analysis, ad-hoc one-liners.
19
+
20
+ ---
21
+
22
+ ## Document 1: Implementation Spec (create BEFORE writing any code)
23
+
24
+ **Purpose:** Documents what the agent is about to do so the user can verify the plan and future agents can understand the intent.
25
+
26
+ **Must include:**
27
+ ```markdown
28
+ # Implementation Spec — <feature/issue name>
29
+ Date: <ISO date>
30
+ Agent: <skill name + version>
31
+
32
+ ## What
33
+ <2-3 sentence description of what will be implemented>
34
+
35
+ ## Why
36
+ <reason: issue link, user request, business value>
37
+
38
+ ## Scope
39
+ **In scope:**
40
+ - <item>
41
+
42
+ **Out of scope:**
43
+ - <item>
44
+
45
+ ## Acceptance Criteria
46
+ - [ ] <testable criterion 1>
47
+ - [ ] <testable criterion 2>
48
+
49
+ ## Approach
50
+ <brief description of implementation approach: files to change, key design decisions>
51
+
52
+ ## Test Strategy
53
+ <how tests will be written: framework, which scenarios will be covered>
54
+ ```
55
+
56
+ **Storage:**
57
+ - In `job-orchestrator` jobs: saved via `job-documenter` to `.metaproject/jobs/<job-name>/man/spec.md`
58
+ - In `feature-dev`: saved to `<project_root>/.feature-spec.md` (gitignored) or printed and confirmed by user
59
+ - In any agent: at minimum, the spec is presented to the user and confirmed before code is written
60
+
61
+ **Timing:** Spec is created after requirements are gathered but BEFORE any branch is created or code is written.
62
+
63
+ ---
64
+
65
+ ## Document 2: Change Report (create AFTER all work is complete)
66
+
67
+ **Purpose:** Auditable record of what the agent actually did — for the user, for review, and for the changelog.
68
+
69
+ **Must include:**
70
+ ```markdown
71
+ # Change Report — <feature/issue name>
72
+ Date: <ISO date>
73
+ Agent: <skill name + version>
74
+ Branch: <branch name>
75
+ PR: <PR URL or "not created">
76
+
77
+ ## Summary
78
+ <2-3 sentence summary of what was implemented>
79
+
80
+ ## Files Changed
81
+ | File | Action | Description |
82
+ |------|--------|-------------|
83
+ | src/services/UserService.ts | created | New user validation service |
84
+ | src/services/UserService.test.ts | created | 8 tests, all passing |
85
+ | src/components/Form.tsx | modified | Added validation UI |
86
+
87
+ ## Tests
88
+ - Tests written: <N>
89
+ - Tests passing: <N>
90
+ - Tests failing: 0
91
+ - Frameworks: <vitest/jest/etc>
92
+
93
+ ## Verification Gate
94
+ - Lint: <pass / N errors>
95
+ - Type-check: <pass / N errors>
96
+ - Tests: <pass / N failed>
97
+
98
+ ## Acceptance Criteria Met
99
+ - [x] <criterion 1> — verified by <test name>
100
+ - [x] <criterion 2> — verified by <test name>
101
+ - [ ] <criterion 3> — NOT met (reason)
102
+
103
+ ## Commits
104
+ - <hash> <message>
105
+
106
+ ## Notes
107
+ <anything unexpected, deferred, or worth knowing>
108
+ ```
109
+
110
+ **Storage:**
111
+ - In `job-orchestrator` jobs: saved via `job-documenter` to `.metaproject/jobs/<job-name>/man/change-report.md`
112
+ - In `feature-dev`: appended to PR description + printed to user
113
+ - In any agent: at minimum, printed as the final message
114
+
115
+ **Timing:** Created as the very last step before reporting done to the user or orchestrator.
116
+
117
+ ---
118
+
119
+ ## Agent Compliance Checklist
120
+
121
+ Before marking any implementation task as complete, verify:
122
+
123
+ - [ ] Spec was created and confirmed before code was written
124
+ - [ ] tests-creator ran before task-implementer (TDD pipeline)
125
+ - [ ] code-verifier ran after implementation (gate: PASS or PASS_WITH_WARNINGS)
126
+ - [ ] Change report was produced at the end
127
+ - [ ] All acceptance criteria are checked off (or explicitly noted as not met)
128
+
129
+ ---
130
+
131
+ ## Iron Laws
132
+
133
+ **IRON LAW 1: NO implementation starts without a confirmed spec. Code written without a spec has no verifiable definition of done.**
134
+ **IRON LAW 2: NO implementation is complete without a change report. "It works" is not auditable.**
135
+ **IRON LAW 3: The change report must reference actual test results from code-verifier — not self-assessment.**
136
+
137
+ ---
138
+
139
+ ## Red Flags — Stop and re-read this rule if you are thinking:
140
+
141
+ | Rationalization | Why it's wrong |
142
+ |---|---|
143
+ | "The task is simple, a spec is overkill" | Simple tasks that skip specs are where scope creep silently happens |
144
+ | "I'll document it after the PR is merged" | Post-merge docs are never written — and are useless for PR review |
145
+ | "The user confirmed verbally, no need to write it down" | Verbal confirmation is invisible to reviewers, future agents, and the changelog |
146
+ | "The code is self-documenting, a change report adds nothing" | The change report is for the user and the audit trail, not for the code reader |
147
+ | "I'll skip the spec to save time" | The spec takes 2 minutes and saves hours of "wait, what was this supposed to do?" |
148
+
149
+ **IRON LAW: AN UNDOCUMENTED IMPLEMENTATION IS AN UNVERIFIABLE IMPLEMENTATION.**