@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,735 @@
1
+ # Feature Analyzer — Extended Documentation
2
+
3
+ > This file contains detailed supplementary documentation for `feature-analyzer`.
4
+ > For the core workflow, guard clause, and step-by-step checklist, see `SKILL.md`.
5
+
6
+ ---
7
+
8
+ ## User-Specified Analysis Focus — Detailed
9
+
10
+ When user specifies a focus area (e.g., "analyze everything related to variables in pipelines"):
11
+
12
+ ### Focus Keywords Priority System
13
+
14
+ **Priority Boost Rules:**
15
+ - Files matching focus keywords → **Boost to P0** (even if normally P1/P2)
16
+ - Files referencing focus entities → **+1 priority level**
17
+ - Files in relevant directories → **+1 priority level**
18
+
19
+ **Example:** Focus = "variables in pipelines"
20
+ ```
21
+ Files containing "variable" in path or content:
22
+ - src/pipelines/variable-resolver.ts → P0 (boosted from P1)
23
+ - src/models/pipeline-variable.dto.ts → P0 (already P0)
24
+ - src/components/variable-input.tsx → P0 (boosted from P2)
25
+
26
+ Files in pipelines directory:
27
+ - src/pipelines/pipeline-runner.ts → P1 (context, +1 priority)
28
+ ```
29
+
30
+ ### Search Strategy for Focus Areas
31
+
32
+ **Step 1: Keyword Extraction**
33
+ Extract key terms from user request:
34
+ - Main concept: "variables"
35
+ - Context: "pipelines"
36
+ - Action: "analyze"
37
+
38
+ **Step 2: Multi-Scope Search**
39
+ ```bash
40
+ # Search in changed files first
41
+ git diff --name-only | xargs grep -l "variable" 2>/dev/null
42
+
43
+ # Search in broader codebase for context
44
+ grep -r "variable" --include="*.ts" --include="*.tsx" src/pipelines/ | head -20
45
+
46
+ # Search related terms
47
+ grep -ri "var\|param\|arg\|input" --include="*.ts" src/pipelines/ | head -20
48
+ ```
49
+
50
+ **Step 3: Relationship Mapping**
51
+ Identify related components:
52
+ - What uses variables? → PipelineRunner, PipelineBuilder
53
+ - What defines variables? → VariableService, VariableDTO
54
+ - Where are variables stored? → VariableStore, PipelineContext
55
+
56
+ **Step 4: Cross-Reference Analysis**
57
+ Check target repository for:
58
+ - Files importing Variable-related types
59
+ - Components using pipeline variables
60
+ - Tests covering variable functionality
61
+
62
+ ### Focus-Based File Prioritization Algorithm
63
+
64
+ ```
65
+ Standard Priority + Focus Boost = Final Priority
66
+
67
+ For each changed file:
68
+ 1. Assign base priority (P0/P1/P2)
69
+ 2. IF file matches focus keywords → Boost to P0
70
+ 3. IF file references focus entities → +1 level
71
+ 4. IF file in focus directory → +1 level
72
+ 5. IF file is dependency of focus files → Keep base priority
73
+ 6. ELSE → Standard priority
74
+
75
+ Select top 7 files by final priority
76
+ ```
77
+
78
+ ### Focus-Based Selection with Examples
79
+
80
+ **Step 1: Boost Priorities Based on Focus**
81
+ ```
82
+ For each changed file:
83
+ 1. Assign base priority (P0/P1/P2)
84
+ 2. IF file matches focus keywords → Boost to P0
85
+ 3. IF file in focus directory → +1 level
86
+ 4. IF file references focus entities → +1 level
87
+ 5. Final priority = MIN(P0, base + boosts)
88
+ ```
89
+
90
+ **Step 2: Search Broader Context**
91
+ ```bash
92
+ # Search focus keywords in entire codebase
93
+ grep -r "focus_keyword" --include="*.ts" src/ | head -30
94
+
95
+ # Find all files in focus directory
96
+ find src/focus_directory -type f -name "*.ts" -o -name "*.tsx"
97
+
98
+ # Identify focus entity definitions
99
+ grep -l "class FocusEntity\|interface FocusEntity" --include="*.ts" src/
100
+ ```
101
+
102
+ **Step 3: Map Relationships**
103
+ Identify related components that use/interact with focus entities:
104
+ - What imports focus entities? → Consumers
105
+ - What defines focus entities? → Definitions
106
+ - What modifies focus entities? → Mutators
107
+
108
+ **Step 4: Selection with Focus**
109
+ 1. Select ALL focus-matching P0 files (even if >5)
110
+ 2. If < 5 focus files, add non-focus P0 by standard rules
111
+ 3. Add focus-matching P1 files (up to 3)
112
+ 4. Include 1-2 context files (files that use focus entities)
113
+
114
+ **Example result:** Focus = "variables in pipelines"
115
+ ```
116
+ Selected files:
117
+ ✅ P0: src/pipelines/variable-resolver.ts (focus match)
118
+ ✅ P0: src/models/pipeline-variable.dto.ts (focus match)
119
+ ✅ P1: src/pipelines/pipeline-runner.ts (context - uses variables)
120
+ ✅ P1: src/services/variable-service.ts (focus match)
121
+ ✅ P0: src/pipelines/pipeline-builder.ts (context - creates pipelines)
122
+ ```
123
+
124
+ **Skip non-focus files** unless needed for context.
125
+
126
+ ---
127
+
128
+ ## Mode B: Feature Formalization (Current State Analysis)
129
+
130
+ When user does NOT provide base-branch, **formalize existing functionality** instead of analyzing changes.
131
+
132
+ ### What is Feature Formalization?
133
+
134
+ **Purpose**: Create comprehensive specification of existing functionality as it works RIGHT NOW.
135
+
136
+ **Difference from Changes Analysis**:
137
+ - **Changes Analysis**: "What changed from version A to version B?"
138
+ - **Feature Formalization**: "How does this functionality work in the current codebase?"
139
+
140
+ ### Formalization Checklist
141
+
142
+ For each analyzed component, document:
143
+
144
+ ```
145
+ COMPONENT FORMALIZATION TEMPLATE:
146
+
147
+ 1. PURPOSE
148
+ - What business problem does this solve?
149
+ - Who are the users?
150
+ - When is it used?
151
+
152
+ 2. API CONTRACT (if applicable)
153
+ - Input parameters
154
+ - Return types
155
+ - Error responses
156
+ - Authentication/authorization requirements
157
+
158
+ 3. BUSINESS LOGIC
159
+ - Core algorithms
160
+ - Validation rules
161
+ - Business constraints
162
+ - Decision trees
163
+
164
+ 4. STATE MANAGEMENT
165
+ - What state is maintained?
166
+ - Where is it stored?
167
+ - How is it updated?
168
+ - Lifecycle of state
169
+
170
+ 5. DATA FLOW
171
+ - Input sources
172
+ - Processing steps
173
+ - Output destinations
174
+ - Side effects
175
+
176
+ 6. INTEGRATION POINTS
177
+ - External services called
178
+ - Events published/consumed
179
+ - Database interactions
180
+ - File system operations
181
+
182
+ 7. ERROR HANDLING
183
+ - Expected error scenarios
184
+ - Recovery mechanisms
185
+ - Fallback behavior
186
+
187
+ 8. EDGE CASES
188
+ - Boundary conditions
189
+ - Empty/null handling
190
+ - Concurrency issues
191
+ - Performance constraints
192
+
193
+ 9. TESTING
194
+ - Test coverage
195
+ - Critical test scenarios
196
+ - Manual testing steps
197
+
198
+ 10. USAGE EXAMPLES
199
+ - Code examples
200
+ - Common patterns
201
+ - Anti-patterns to avoid
202
+ ```
203
+
204
+ ### Search Strategy for Mode B
205
+
206
+ When no base-branch provided, search ENTIRE codebase:
207
+
208
+ ```bash
209
+ # 1. Find all files related to focus keywords
210
+ grep -r "focus_keyword" --include="*.ts" --include="*.tsx" src/ | head -50
211
+
212
+ # 2. Find files in relevant directories
213
+ find src/path -type f \( -name "*.ts" -o -name "*.tsx" \) | head -30
214
+
215
+ # 3. Find entity definitions
216
+ grep -l "class Focus\|interface Focus\|type Focus" --include="*.ts" src/
217
+
218
+ # 4. Find consumers (what uses these entities)
219
+ grep -l "import.*Focus\|from.*focus" --include="*.ts" src/
220
+
221
+ # 5. Find tests related to focus
222
+ grep -r "focus_keyword" --include="*.spec.ts" --include="*.test.ts" src/
223
+ ```
224
+
225
+ ### Output for Mode B
226
+
227
+ Generate **Feature Specification Document** instead of Change Analysis:
228
+
229
+ ```
230
+ <DOCS_ROOT>/analysis/<feature>-current-state-<date>/
231
+ ├── README.md
232
+ ├── specification/
233
+ │ ├── en/feature-specification.md
234
+ │ ├── ru/feature-specification.md
235
+ │ └── ai/feature-specification.md
236
+ ├── architecture/
237
+ │ ├── data-flow.md
238
+ │ ├── component-diagram.md
239
+ │ └── api-contracts.md
240
+ ├── usage/
241
+ │ ├── examples.md
242
+ │ └── patterns.md
243
+ └── tests/
244
+ └── test-coverage.md
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Timeouts and Limits
250
+
251
+ **Analysis must be time-boxed to prevent excessive duration.**
252
+
253
+ ### Default Timeouts
254
+
255
+ | Phase | Max Duration | Action on Timeout |
256
+ |-------|-------------|-------------------|
257
+ | GitHub MCP verification | 30 seconds | Ask user to restart or skip |
258
+ | Git history analysis | 2 minutes | Proceed with limited history |
259
+ | Single file reading | 30 seconds per file | Skip and mark as "partial" |
260
+ | Cross-repo dependency search | 3 minutes | Provide partial results |
261
+ | Documentation generation | 5 minutes | Generate minimal report |
262
+ | **Total analysis** | **30 minutes** | Force intermediate review |
263
+
264
+ ### Timeout Handling Strategy
265
+
266
+ **When approaching timeout:**
267
+ 1. Notify user: "Analysis approaching 30-minute limit"
268
+ 2. Show current progress and what remains
269
+ 3. Offer options:
270
+ - **Continue**: Extend timeout by 15 minutes
271
+ - **Split**: Break into multiple smaller analyses
272
+ - **Partial**: Generate report with current findings
273
+ - **Prioritize**: Focus only on P0 files
274
+
275
+ ### File Count Limits
276
+
277
+ **Automatic scope reduction when limits exceeded:**
278
+
279
+ | Total Changed Files | Action |
280
+ |-------------------|---------|
281
+ | 1-10 files | Analyze all P0, selected P1 |
282
+ | 11-30 files | Analyze P0 only (up to 10) |
283
+ | 31-50 files | Top 7 P0 files only |
284
+ | 50+ files | **STOP** — ask user to narrow scope |
285
+
286
+ **When 50+ files detected:**
287
+ ```
288
+ ⚠️ LARGE CHANGESET DETECTED
289
+
290
+ Found [N] changed files. This is too large for effective analysis.
291
+
292
+ Options:
293
+ 1. Analyze specific directory: [suggest paths]
294
+ 2. Analyze specific file types: [API files only]
295
+ 3. Split by commits: analyze first [N] commits
296
+ 4. Manual selection: user specifies which files
297
+
298
+ Recommended: Option [suggested]
299
+ ```
300
+
301
+ ### Progress Monitoring
302
+
303
+ **Every 10 minutes, provide status update:**
304
+ ```
305
+ ⏱️ Time elapsed: [X] minutes
306
+ 📊 Progress:
307
+ - Phase: [current phase]
308
+ - Files analyzed: [N]/[total]
309
+ - P0: [N] complete
310
+ - P1: [N] complete
311
+ ⏰ Estimated remaining: [X] minutes
312
+ ```
313
+
314
+ ---
315
+
316
+ ## Cache and Existing Reports Check (Step 0.1)
317
+
318
+ **Before starting analysis, check for existing reports to avoid duplication.**
319
+
320
+ ### Cache Lookup
321
+
322
+ ```bash
323
+ # Check if analysis already exists for this branch
324
+ git_branch="$(git rev-parse --abbrev-ref HEAD)"
325
+ git_sha="$(git rev-parse HEAD)"
326
+
327
+ # Look for recent analysis (within last 7 days)
328
+ find <DOCS_ROOT>/analysis/ -name "*.md" -mtime -7 | grep "${git_branch}"
329
+ ```
330
+
331
+ ### Existing Report Detection
332
+
333
+ **If recent analysis found, ask user:**
334
+
335
+ ```
336
+ 🔍 EXISTING ANALYSIS DETECTED
337
+
338
+ Found existing analysis for branch [branch-name]:
339
+ - Date: [creation date]
340
+ - Path: [path/to/analysis]
341
+ - Coverage: [N files analyzed]
342
+ - Completeness: [full/partial]
343
+
344
+ Options:
345
+ 1. ⏩ Use existing (skip new analysis)
346
+ 2. 🔄 Refresh (update with latest changes)
347
+ 3. 📊 Compare (show diff between existing and current)
348
+ 4. 🆕 New analysis (ignore existing, start fresh)
349
+ 5. 🗑️ Archive old & create new
350
+
351
+ Recommended: [suggested option based on age and changes]
352
+ ```
353
+
354
+ ### Cache Invalidation Rules
355
+
356
+ **Always create new analysis when:**
357
+ - [ ] Branch has new commits since last analysis
358
+ - [ ] BASE_SHA changed (rebased branch)
359
+ - [ ] User explicitly requests fresh analysis
360
+ - [ ] Existing analysis older than 7 days
361
+ - [ ] Existing analysis marked as "partial" or "incomplete"
362
+
363
+ **Can reuse existing when:**
364
+ - [x] Same commit SHA
365
+ - [x] Same BASE_SHA
366
+ - [x] Analysis complete and recent (< 7 days)
367
+ - [x] User confirms no significant changes
368
+
369
+ ### Incremental Analysis
370
+
371
+ **If refreshing existing analysis:**
372
+
373
+ 1. Load previous analysis metadata
374
+ 2. Identify new commits since last analysis: `git log ${LAST_SHA}..HEAD`
375
+ 3. Analyze only new/changed files
376
+ 4. Merge findings with previous report
377
+ 5. Update timestamps and version
378
+
379
+ ```
380
+ 🔄 INCREMENTAL UPDATE MODE
381
+
382
+ Previous analysis: [date]
383
+ New commits since then: [N]
384
+ Files changed in new commits: [N]
385
+
386
+ Analyzing only new changes...
387
+ ```
388
+
389
+ ### Cache Storage
390
+
391
+ **Metadata file:** `<DOCS_ROOT>/analysis/.cache/index.json`
392
+
393
+ ```json
394
+ {
395
+ "analyses": [
396
+ {
397
+ "branch": "feature-name",
398
+ "sha": "abc123",
399
+ "base_sha": "def456",
400
+ "path": "feature-name-2024-01-15",
401
+ "created_at": "2024-01-15T10:00:00Z",
402
+ "updated_at": "2024-01-15T10:00:00Z",
403
+ "status": "complete",
404
+ "files_analyzed": 12,
405
+ "coverage": "full"
406
+ }
407
+ ]
408
+ }
409
+ ```
410
+
411
+ ---
412
+
413
+ ## Analysis Mode Decision Tree (Detailed)
414
+
415
+ ```
416
+ User Request: "Analyze variables in pipelines"
417
+
418
+ ├─→ User provides base-branch (e.g., "from main")
419
+ │ └─→ Mode A: Changes Analysis
420
+ │ └─→ Analyze diff between main..current-branch
421
+ │ └─→ Focus on what CHANGED regarding variables
422
+
423
+ └─→ User does NOT provide base-branch
424
+ └─→ Mode B: Current State Analysis
425
+ └─→ Analyze entire codebase as-is
426
+ └─→ Focus on what EXISTS regarding variables
427
+ └─→ Formalize functionality, document patterns
428
+ ```
429
+
430
+ ### Example Context Gathering Conversation
431
+
432
+ ```
433
+ User: "Analyze everything related to variables in pipelines"
434
+
435
+ Agent: "I'll help you analyze variables in pipelines. First, I need context:
436
+
437
+ SOURCE Repository (where changes exist):
438
+ - Local path: ?"
439
+
440
+ User: "/Users/.../<PROJECT>"
441
+
442
+ Agent: "✓ Source: /Users/.../<PROJECT>
443
+
444
+ TARGET Repository (where to implement):
445
+ - Local path: ?"
446
+
447
+ User: "/Users/.../<PROJECT>"
448
+
449
+ Agent: "✓ Target: /Users/.../<PROJECT>
450
+
451
+ Branch to analyze:
452
+ - Branch name: ?"
453
+
454
+ User: "feature/pipeline-variables"
455
+
456
+ Agent: "✓ Branch: feature/pipeline-variables
457
+
458
+ **CONFIRMATION:**
459
+ Analyze 'feature/pipeline-variables' with focus on 'variables in pipelines'?
460
+ - Source: /Users/.../<PROJECT>
461
+ - Target: /Users/.../<PROJECT>
462
+ - Focus: variables in pipelines
463
+
464
+ Start analysis? [Y/n]"
465
+
466
+ User: "Y"
467
+
468
+ Agent: "✓ Starting analysis..."
469
+ ```
470
+
471
+ ---
472
+
473
+ ## Step 3: BASE_SHA Calculation Algorithm (Full)
474
+
475
+ **The base branch MUST be determined from the last branching point (merge-base), NOT from the current HEAD of the parent branch.**
476
+
477
+ This ensures you analyze only the changes made in the feature branch, not changes that occurred in the parent branch after the feature was branched.
478
+
479
+ **Why this matters:**
480
+ - If you compare against `origin/main` HEAD, you'll see unrelated changes from other merged PRs
481
+ - You MUST find the exact commit where the feature branch diverged
482
+ - Use `git merge-base` to find this point
483
+
484
+ ### Calculate BASE_SHA
485
+
486
+ **ALGORITHM — Find the last branching point:**
487
+
488
+ ```bash
489
+ BRANCH="$(git rev-parse --abbrev-ref HEAD)"
490
+ UPSTREAM_REF="$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || true)"
491
+
492
+ # Step 1: Determine parent branch candidate
493
+ PARENT=""
494
+ if git rev-parse --verify -q "origin/main" >/dev/null; then
495
+ PARENT="origin/main"
496
+ elif git rev-parse --verify -q "origin/master" >/dev/null; then
497
+ PARENT="origin/master"
498
+ elif git rev-parse --verify -q "main" >/dev/null; then
499
+ PARENT="main"
500
+ elif git rev-parse --verify -q "master" >/dev/null; then
501
+ PARENT="master"
502
+ elif [ -n "$UPSTREAM_REF" ] && [ "$UPSTREAM_REF" != "$BRANCH" ] && [ "$UPSTREAM_REF" != "origin/$BRANCH" ]; then
503
+ PARENT="@{upstream}"
504
+ else
505
+ echo "Cannot determine parent ref" >&2
506
+ exit 1
507
+ fi
508
+
509
+ # Step 2: CRITICAL — Find the actual branching point (merge-base)
510
+ # This gives you the commit where feature branch diverged from parent
511
+ BASE_SHA="$(git merge-base HEAD "$PARENT")"
512
+ ```
513
+
514
+ **Verification:**
515
+ ```bash
516
+ echo "Feature branch: $BRANCH"
517
+ echo "Parent branch: $PARENT"
518
+ echo "Branching point (BASE_SHA): $BASE_SHA"
519
+ echo "Commits in feature branch:"
520
+ git log --oneline "${BASE_SHA}..HEAD"
521
+ ```
522
+
523
+ **Result:** `BASE_SHA` is the exact commit where your feature branch started.
524
+
525
+ ---
526
+
527
+ ## Step 10: Gherkin Output Format (Full)
528
+
529
+ The AI-readable format in `report/ai/report.md` and `plans/ai/implementation-plan.md` uses Gherkin-style scenarios.
530
+
531
+ **Purpose**: Enable other AI agents to parse analysis results programmatically.
532
+
533
+ ### 1. Feature Declaration
534
+ ```gherkin
535
+ Feature: [Concise Feature Name]
536
+ As a [type of user]
537
+ I want [goal]
538
+ So that [benefit]
539
+
540
+ Background:
541
+ Given source repository is "[owner/repo]"
542
+ And source branch is "[branch-name]"
543
+ And target repository is "[owner/repo]"
544
+ And target branch is "[branch-name]"
545
+ And analysis date is "YYYY-MM-DD"
546
+ And analysis version is "[version]"
547
+ ```
548
+
549
+ ### 2. Metadata Scenario (Required)
550
+ ```gherkin
551
+ Scenario: Analysis Metadata
552
+ Given the analysis scope
553
+ Then the following metadata is captured:
554
+ | Field | Value |
555
+ | BASE_SHA | [commit-hash] |
556
+ | Parent Branch | [origin/main] |
557
+ | Files Analyzed | [N] |
558
+ | P0 Files | [N] |
559
+ | P1 Files | [N] |
560
+ | Complexity Score | [N] |
561
+ | Risk Level | [Low/Medium/High] |
562
+ ```
563
+
564
+ ### 3. API Contract Scenarios (One per changed endpoint)
565
+ ```gherkin
566
+ Scenario: API Contract - [Endpoint Name]
567
+ Given the endpoint "[METHOD /path/to/resource]"
568
+ And the endpoint purpose is "[business purpose]"
569
+ When comparing contracts between source and target
570
+ Then the request changes are:
571
+ | Field | Type | Required | Description |
572
+ | [field] | [type] | [Y/N] | [desc] |
573
+ And the response changes are:
574
+ | Field | Type | Required | Description |
575
+ | [field] | [type] | [Y/N] | [desc] |
576
+ And breaking changes are "[Y/N]"
577
+ And backward compatibility is "[Y/N]"
578
+ Examples:
579
+ | Version | Change Type |
580
+ | old | [before state] |
581
+ | new | [after state] |
582
+ ```
583
+
584
+ ### 4. Business Logic Scenarios (One per P0 file)
585
+ ```gherkin
586
+ Scenario: Business Logic - [File Name]
587
+ Given the file "[path/to/file.ts]"
588
+ And the file purpose is "[purpose description]"
589
+ When analyzing the implementation
590
+ Then the following functions/methods are present:
591
+ | Name | Purpose | Input | Output |
592
+ | [name] | [purpose] | [input] | [output] |
593
+ And the key logic includes:
594
+ """
595
+ [code snippet with comments]
596
+ """
597
+ And the business rules are:
598
+ 1. [rule 1]
599
+ 2. [rule 2]
600
+ And the edge cases handled are:
601
+ | Case | Handling |
602
+ | [case] | [how handled] |
603
+ ```
604
+
605
+ ### 5. State Management Scenarios (if applicable)
606
+ ```gherkin
607
+ Scenario: State Management - [Store Name]
608
+ Given the MobX store "[StoreName]"
609
+ And the store manages "[what state]"
610
+ Then the observables are:
611
+ | Name | Type | Initial Value |
612
+ | [name] | [type] | [value] |
613
+ And the actions are:
614
+ | Name | Purpose | Async |
615
+ | [name] | [purpose] | [Y/N] |
616
+ And the computed values are:
617
+ | Name | Dependencies | Purpose |
618
+ | [name] | [deps] | [purpose] |
619
+ ```
620
+
621
+ ### 6. Cross-Repository Impact Scenarios
622
+ ```gherkin
623
+ Scenario: Cross-Repository Impact - [Component/Service]
624
+ Given the target component "[path/to/component.tsx]"
625
+ And it depends on source API "[endpoint]"
626
+ When the API changes are applied
627
+ Then the following changes are required:
628
+ | Location | Change Type | Description |
629
+ | [file] | [modify/add/remove] | [desc] |
630
+ And the migration steps are:
631
+ 1. [step 1]
632
+ 2. [step 2]
633
+ And the risk level is "[Low/Medium/High]"
634
+ ```
635
+
636
+ ### 7. Implementation Plan (in plans/ai/)
637
+ ```gherkin
638
+ Feature: Implementation Plan for [Feature Name]
639
+ Background:
640
+ Given analysis from "[path/to/analysis]"
641
+ And target repository is "[owner/repo]"
642
+
643
+ Scenario: Phase 1 - Setup and Dependencies
644
+ Given the current state of target repository
645
+ Then install/update the following dependencies:
646
+ | Package | Version | Purpose |
647
+ | [pkg] | [ver] | [purpose] |
648
+ And configure the following:
649
+ | Config | Value |
650
+ | [key] | [value] |
651
+
652
+ Scenario: Phase 2 - API Layer Implementation
653
+ Given the API contract changes
654
+ Then implement the following files:
655
+ | File | Purpose | Key Methods |
656
+ | [path] | [purpose] | [methods] |
657
+ And update DTOs:
658
+ | DTO | Changes |
659
+ | [name] | [changes] |
660
+
661
+ Scenario: Phase 3 - Business Logic Implementation
662
+ Given the business requirements
663
+ Then implement:
664
+ """
665
+ [pseudo-code or code structure]
666
+ """
667
+ And handle edge cases:
668
+ | Case | Implementation |
669
+ | [case] | [solution] |
670
+
671
+ Scenario: Phase 4 - UI Integration
672
+ Given the UI requirements
673
+ Then update components:
674
+ | Component | Changes |
675
+ | [name] | [desc] |
676
+
677
+ Scenario: Phase 5 - Testing
678
+ Given the implementation
679
+ Then write tests for:
680
+ | Type | Coverage |
681
+ | Unit | [what to test] |
682
+ | Integration | [scenarios] |
683
+ And verify:
684
+ | Check | Expected |
685
+ | [check] | [result] |
686
+
687
+ Scenario: Verification and Rollout
688
+ Given all phases complete
689
+ Then verify:
690
+ | Check | Command/Method |
691
+ | Build | npm run build |
692
+ | Tests | npm test |
693
+ | Lint | npm run lint |
694
+ And deploy to:
695
+ | Environment | Steps |
696
+ | [env] | [steps] |
697
+ ```
698
+
699
+ ### Gherkin Syntax Rules:
700
+ - Use **Given** for preconditions and context
701
+ - Use **When** for actions or analysis steps
702
+ - Use **Then** for expected outcomes and validations
703
+ - Use **And/But** to continue previous statement
704
+ - Use **Examples** for tabular data variations
705
+ - Use `"""` for multi-line text (code snippets)
706
+ - Use `|` for tables with headers
707
+ - Keep scenarios focused and atomic (one concept per scenario)
708
+ - Use descriptive names: "API Contract - User Creation Endpoint" not "Scenario 1"
709
+
710
+ ---
711
+
712
+ ## Step 13: Full Metrics and Complexity Score
713
+
714
+ Track and report in `metrics/analysis-metrics.md`:
715
+
716
+ ```markdown
717
+ ## Analysis Metrics
718
+
719
+ - **Duration**: [X minutes]
720
+ - **Files Analyzed**: [N total] (P0: [N], P1: [N], P2: [N])
721
+ - **Lines of Code Changed**: [N]
722
+ - **Cross-Repo Dependencies**: [N files affected]
723
+ - **API Endpoints Changed**: [N]
724
+ - **DTOs Modified**: [N]
725
+ - **Breaking Changes**: [Y/N, count]
726
+ - **Test Coverage**: [% or N/A]
727
+ - **Risk Level**: [Low/Medium/High]
728
+ - **Estimated Effort**: [X hours/days]
729
+
730
+ ## Complexity Score
731
+ Calculate: (P0_files × 3) + (P1_files × 2) + (P2_files × 1) + (breaking_changes × 5)
732
+ - 0-10: Low complexity
733
+ - 11-25: Medium complexity
734
+ - 26+: High complexity
735
+ ```