octocode-cli 1.2.6 → 1.2.8

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 (303) hide show
  1. package/LICENSE +21 -63
  2. package/README.md +85 -142
  3. package/out/octocode-cli.js +7063 -6934
  4. package/package.json +8 -6
  5. package/skills/README.md +97 -120
  6. package/skills/octocode-code-engineer/.claude/settings.local.json +18 -0
  7. package/skills/octocode-code-engineer/.octocode/rfc/RFC-code-engineer-weakness-fixes.md +255 -0
  8. package/skills/octocode-code-engineer/.plan/VALIDATED_PLAN.md +223 -0
  9. package/skills/octocode-code-engineer/README.md +178 -0
  10. package/skills/octocode-code-engineer/SKILL.md +418 -0
  11. package/skills/octocode-code-engineer/coverage/architecture.ts.html +7828 -0
  12. package/skills/octocode-code-engineer/coverage/ast-helpers.ts.html +211 -0
  13. package/skills/octocode-code-engineer/coverage/ast-search.ts.html +1795 -0
  14. package/skills/octocode-code-engineer/coverage/base.css +224 -0
  15. package/skills/octocode-code-engineer/coverage/block-navigation.js +87 -0
  16. package/skills/octocode-code-engineer/coverage/cache.ts.html +376 -0
  17. package/skills/octocode-code-engineer/coverage/cli.ts.html +982 -0
  18. package/skills/octocode-code-engineer/coverage/clover.xml +3217 -0
  19. package/skills/octocode-code-engineer/coverage/collect-effects.ts.html +664 -0
  20. package/skills/octocode-code-engineer/coverage/collect-input-sources.ts.html +577 -0
  21. package/skills/octocode-code-engineer/coverage/collect-performance.ts.html +331 -0
  22. package/skills/octocode-code-engineer/coverage/collect-prototype-pollution.ts.html +421 -0
  23. package/skills/octocode-code-engineer/coverage/collect-security.ts.html +604 -0
  24. package/skills/octocode-code-engineer/coverage/collect-test-profile.ts.html +589 -0
  25. package/skills/octocode-code-engineer/coverage/coverage-final.json +30 -0
  26. package/skills/octocode-code-engineer/coverage/dependencies.ts.html +997 -0
  27. package/skills/octocode-code-engineer/coverage/dependency-summary.ts.html +688 -0
  28. package/skills/octocode-code-engineer/coverage/discovery.ts.html +322 -0
  29. package/skills/octocode-code-engineer/coverage/favicon.png +0 -0
  30. package/skills/octocode-code-engineer/coverage/graph-analytics.ts.html +1510 -0
  31. package/skills/octocode-code-engineer/coverage/index.html +536 -0
  32. package/skills/octocode-code-engineer/coverage/index.ts.html +826 -0
  33. package/skills/octocode-code-engineer/coverage/metrics.ts.html +553 -0
  34. package/skills/octocode-code-engineer/coverage/pipeline.ts.html +2044 -0
  35. package/skills/octocode-code-engineer/coverage/prettify.css +1 -0
  36. package/skills/octocode-code-engineer/coverage/prettify.js +2 -0
  37. package/skills/octocode-code-engineer/coverage/report-analysis.ts.html +1570 -0
  38. package/skills/octocode-code-engineer/coverage/report-writer.ts.html +1102 -0
  39. package/skills/octocode-code-engineer/coverage/security-detectors.ts.html +1747 -0
  40. package/skills/octocode-code-engineer/coverage/semantic-detectors.ts.html +2152 -0
  41. package/skills/octocode-code-engineer/coverage/semantic.ts.html +1897 -0
  42. package/skills/octocode-code-engineer/coverage/sort-arrow-sprite.png +0 -0
  43. package/skills/octocode-code-engineer/coverage/sorter.js +210 -0
  44. package/skills/octocode-code-engineer/coverage/summary-md.ts.html +1222 -0
  45. package/skills/octocode-code-engineer/coverage/test-quality-detectors.ts.html +1039 -0
  46. package/skills/octocode-code-engineer/coverage/tree-sitter-analyzer.ts.html +955 -0
  47. package/skills/octocode-code-engineer/coverage/ts-analyzer.ts.html +1213 -0
  48. package/skills/octocode-code-engineer/coverage/types.ts.html +2473 -0
  49. package/skills/octocode-code-engineer/coverage/utils.ts.html +820 -0
  50. package/skills/octocode-code-engineer/eslint.config.mjs +54 -0
  51. package/skills/octocode-code-engineer/minify-scripts.mjs +32 -0
  52. package/skills/octocode-code-engineer/package.json +54 -0
  53. package/skills/octocode-code-engineer/references/agent-ast-reading-rfc.md +95 -0
  54. package/skills/octocode-code-engineer/references/architecture-techniques.md +121 -0
  55. package/skills/octocode-code-engineer/references/ast-search.md +210 -0
  56. package/skills/octocode-code-engineer/references/ast-tree-search.md +151 -0
  57. package/skills/octocode-code-engineer/references/cli-reference.md +167 -0
  58. package/skills/octocode-code-engineer/references/concepts.md +107 -0
  59. package/skills/octocode-code-engineer/references/finding-categories.md +128 -0
  60. package/skills/octocode-code-engineer/references/improvement-roadmap.md +304 -0
  61. package/skills/octocode-code-engineer/references/output-files.md +144 -0
  62. package/skills/octocode-code-engineer/references/playbooks.md +204 -0
  63. package/skills/octocode-code-engineer/references/present-results.md +136 -0
  64. package/skills/octocode-code-engineer/references/tool-workflows.md +566 -0
  65. package/skills/octocode-code-engineer/references/validate-investigate.md +225 -0
  66. package/skills/octocode-code-engineer/scripts/analysis/dependencies.js +1 -0
  67. package/skills/octocode-code-engineer/scripts/analysis/dependency-summary.js +1 -0
  68. package/skills/octocode-code-engineer/scripts/analysis/discovery.js +1 -0
  69. package/skills/octocode-code-engineer/scripts/analysis/graph-analytics.js +1 -0
  70. package/skills/octocode-code-engineer/scripts/analysis/semantic.js +1 -0
  71. package/skills/octocode-code-engineer/scripts/ast/helpers.js +1 -0
  72. package/skills/octocode-code-engineer/scripts/ast/metrics.js +1 -0
  73. package/skills/octocode-code-engineer/scripts/ast/search.js +2 -0
  74. package/skills/octocode-code-engineer/scripts/ast/tree-search.js +2 -0
  75. package/skills/octocode-code-engineer/scripts/ast/tree-sitter.js +1 -0
  76. package/skills/octocode-code-engineer/scripts/ast/ts-analyzer.js +1 -0
  77. package/skills/octocode-code-engineer/scripts/collectors/chains.js +1 -0
  78. package/skills/octocode-code-engineer/scripts/collectors/effects.js +1 -0
  79. package/skills/octocode-code-engineer/scripts/collectors/input-sources.js +1 -0
  80. package/skills/octocode-code-engineer/scripts/collectors/performance.js +1 -0
  81. package/skills/octocode-code-engineer/scripts/collectors/prototype-pollution.js +1 -0
  82. package/skills/octocode-code-engineer/scripts/collectors/security.js +1 -0
  83. package/skills/octocode-code-engineer/scripts/collectors/test-profile.js +1 -0
  84. package/skills/octocode-code-engineer/scripts/common/is-direct-run.js +1 -0
  85. package/skills/octocode-code-engineer/scripts/common/utils.js +1 -0
  86. package/skills/octocode-code-engineer/scripts/detectors/code-quality.js +1 -0
  87. package/skills/octocode-code-engineer/scripts/detectors/cohesion.js +1 -0
  88. package/skills/octocode-code-engineer/scripts/detectors/coupling.js +1 -0
  89. package/skills/octocode-code-engineer/scripts/detectors/cycle.js +1 -0
  90. package/skills/octocode-code-engineer/scripts/detectors/dead-code.js +1 -0
  91. package/skills/octocode-code-engineer/scripts/detectors/import-style.js +1 -0
  92. package/skills/octocode-code-engineer/scripts/detectors/index.js +1 -0
  93. package/skills/octocode-code-engineer/scripts/detectors/security.js +1 -0
  94. package/skills/octocode-code-engineer/scripts/detectors/semantic.js +1 -0
  95. package/skills/octocode-code-engineer/scripts/detectors/shared.js +1 -0
  96. package/skills/octocode-code-engineer/scripts/detectors/test-quality.js +1 -0
  97. package/skills/octocode-code-engineer/scripts/index.js +1 -0
  98. package/skills/octocode-code-engineer/scripts/pipeline/cache.js +1 -0
  99. package/skills/octocode-code-engineer/scripts/pipeline/cli.js +1 -0
  100. package/skills/octocode-code-engineer/scripts/pipeline/main.js +2 -0
  101. package/skills/octocode-code-engineer/scripts/reporting/analysis.js +1 -0
  102. package/skills/octocode-code-engineer/scripts/reporting/summary-md.js +1 -0
  103. package/skills/octocode-code-engineer/scripts/reporting/writer.js +1 -0
  104. package/skills/octocode-code-engineer/scripts/types/constants.js +1 -0
  105. package/skills/octocode-code-engineer/scripts/types/index.js +1 -0
  106. package/skills/octocode-code-engineer/scripts/types/interfaces.js +1 -0
  107. package/skills/octocode-code-engineer/src/analysis/dependencies.test.ts +545 -0
  108. package/skills/octocode-code-engineer/src/analysis/dependencies.ts +406 -0
  109. package/skills/octocode-code-engineer/src/analysis/dependency-summary.test.ts +566 -0
  110. package/skills/octocode-code-engineer/src/analysis/dependency-summary.ts +257 -0
  111. package/skills/octocode-code-engineer/src/analysis/discovery.test.ts +420 -0
  112. package/skills/octocode-code-engineer/src/analysis/discovery.ts +87 -0
  113. package/skills/octocode-code-engineer/src/analysis/graph-analytics.test.ts +449 -0
  114. package/skills/octocode-code-engineer/src/analysis/graph-analytics.ts +534 -0
  115. package/skills/octocode-code-engineer/src/analysis/semantic.test.ts +1533 -0
  116. package/skills/octocode-code-engineer/src/analysis/semantic.ts +830 -0
  117. package/skills/octocode-code-engineer/src/ast/helpers.test.ts +185 -0
  118. package/skills/octocode-code-engineer/src/ast/helpers.ts +62 -0
  119. package/skills/octocode-code-engineer/src/ast/metrics.test.ts +304 -0
  120. package/skills/octocode-code-engineer/src/ast/metrics.ts +204 -0
  121. package/skills/octocode-code-engineer/src/ast/search.test.ts +647 -0
  122. package/skills/octocode-code-engineer/src/ast/search.ts +648 -0
  123. package/skills/octocode-code-engineer/src/ast/tree-search.test.ts +199 -0
  124. package/skills/octocode-code-engineer/src/ast/tree-search.ts +392 -0
  125. package/skills/octocode-code-engineer/src/ast/tree-sitter.test.ts +407 -0
  126. package/skills/octocode-code-engineer/src/ast/tree-sitter.ts +402 -0
  127. package/skills/octocode-code-engineer/src/ast/ts-analyzer.test.ts +1864 -0
  128. package/skills/octocode-code-engineer/src/ast/ts-analyzer.ts +509 -0
  129. package/skills/octocode-code-engineer/src/collectors/chains.ts +74 -0
  130. package/skills/octocode-code-engineer/src/collectors/effects.test.ts +490 -0
  131. package/skills/octocode-code-engineer/src/collectors/effects.ts +332 -0
  132. package/skills/octocode-code-engineer/src/collectors/input-sources.test.ts +144 -0
  133. package/skills/octocode-code-engineer/src/collectors/input-sources.ts +196 -0
  134. package/skills/octocode-code-engineer/src/collectors/performance.test.ts +82 -0
  135. package/skills/octocode-code-engineer/src/collectors/performance.ts +141 -0
  136. package/skills/octocode-code-engineer/src/collectors/prototype-pollution.test.ts +55 -0
  137. package/skills/octocode-code-engineer/src/collectors/prototype-pollution.ts +162 -0
  138. package/skills/octocode-code-engineer/src/collectors/security.test.ts +124 -0
  139. package/skills/octocode-code-engineer/src/collectors/security.ts +309 -0
  140. package/skills/octocode-code-engineer/src/collectors/test-profile.test.ts +97 -0
  141. package/skills/octocode-code-engineer/src/collectors/test-profile.ts +269 -0
  142. package/skills/octocode-code-engineer/src/common/is-direct-run.test.ts +32 -0
  143. package/skills/octocode-code-engineer/src/common/is-direct-run.ts +13 -0
  144. package/skills/octocode-code-engineer/src/common/utils.test.ts +463 -0
  145. package/skills/octocode-code-engineer/src/common/utils.ts +304 -0
  146. package/skills/octocode-code-engineer/src/detectors/code-quality.ts +966 -0
  147. package/skills/octocode-code-engineer/src/detectors/cohesion.ts +539 -0
  148. package/skills/octocode-code-engineer/src/detectors/coupling.ts +323 -0
  149. package/skills/octocode-code-engineer/src/detectors/cycle.ts +349 -0
  150. package/skills/octocode-code-engineer/src/detectors/dead-code.ts +320 -0
  151. package/skills/octocode-code-engineer/src/detectors/import-style.ts +376 -0
  152. package/skills/octocode-code-engineer/src/detectors/index.test.ts +3061 -0
  153. package/skills/octocode-code-engineer/src/detectors/index.ts +88 -0
  154. package/skills/octocode-code-engineer/src/detectors/security.test.ts +882 -0
  155. package/skills/octocode-code-engineer/src/detectors/security.ts +821 -0
  156. package/skills/octocode-code-engineer/src/detectors/semantic.ts +758 -0
  157. package/skills/octocode-code-engineer/src/detectors/shared.ts +49 -0
  158. package/skills/octocode-code-engineer/src/detectors/test-quality.test.ts +388 -0
  159. package/skills/octocode-code-engineer/src/detectors/test-quality.ts +367 -0
  160. package/skills/octocode-code-engineer/src/index.test.ts +4425 -0
  161. package/skills/octocode-code-engineer/src/index.ts +403 -0
  162. package/skills/octocode-code-engineer/src/pipeline/cache.test.ts +199 -0
  163. package/skills/octocode-code-engineer/src/pipeline/cache.ts +130 -0
  164. package/skills/octocode-code-engineer/src/pipeline/cli.test.ts +493 -0
  165. package/skills/octocode-code-engineer/src/pipeline/cli.ts +344 -0
  166. package/skills/octocode-code-engineer/src/pipeline/main.test.ts +174 -0
  167. package/skills/octocode-code-engineer/src/pipeline/main.ts +1074 -0
  168. package/skills/octocode-code-engineer/src/pipeline.test.ts +84 -0
  169. package/skills/octocode-code-engineer/src/reporting/analysis.test.ts +782 -0
  170. package/skills/octocode-code-engineer/src/reporting/analysis.ts +688 -0
  171. package/skills/octocode-code-engineer/src/reporting/output-contract.test.ts +463 -0
  172. package/skills/octocode-code-engineer/src/reporting/summary-md.test.ts +421 -0
  173. package/skills/octocode-code-engineer/src/reporting/summary-md.ts +714 -0
  174. package/skills/octocode-code-engineer/src/reporting/writer.ts +430 -0
  175. package/skills/octocode-code-engineer/src/sanity.test.ts +47 -0
  176. package/skills/octocode-code-engineer/src/types/constants.ts +248 -0
  177. package/skills/octocode-code-engineer/src/types/index.ts +80 -0
  178. package/skills/octocode-code-engineer/src/types/interfaces.ts +682 -0
  179. package/skills/octocode-code-engineer/tsconfig.json +17 -0
  180. package/skills/octocode-code-engineer/vitest.config.ts +8 -0
  181. package/skills/octocode-documentation-writer/README.md +113 -0
  182. package/skills/octocode-documentation-writer/SKILL.md +886 -0
  183. package/skills/octocode-documentation-writer/references/agent-discovery-analysis.md +453 -0
  184. package/skills/octocode-documentation-writer/references/agent-documentation-writer.md +255 -0
  185. package/skills/octocode-documentation-writer/references/agent-engineer-questions.md +247 -0
  186. package/skills/octocode-documentation-writer/references/agent-orchestrator.md +370 -0
  187. package/skills/octocode-documentation-writer/references/agent-qa-validator.md +227 -0
  188. package/skills/octocode-documentation-writer/references/agent-researcher.md +250 -0
  189. package/skills/octocode-documentation-writer/schemas/analysis-schema.json +886 -0
  190. package/skills/octocode-documentation-writer/schemas/discovery-tasks.json +96 -0
  191. package/skills/octocode-documentation-writer/schemas/documentation-structure.json +373 -0
  192. package/skills/octocode-documentation-writer/schemas/partial-discovery-schema.json +102 -0
  193. package/skills/octocode-documentation-writer/schemas/partial-research-schema.json +98 -0
  194. package/skills/octocode-documentation-writer/schemas/qa-results-schema.json +113 -0
  195. package/skills/octocode-documentation-writer/schemas/questions-schema.json +228 -0
  196. package/skills/octocode-documentation-writer/schemas/research-schema.json +104 -0
  197. package/skills/octocode-documentation-writer/schemas/state-schema.json +222 -0
  198. package/skills/octocode-documentation-writer/schemas/work-assignments-schema.json +74 -0
  199. package/skills/octocode-plan/SKILL.md +122 -116
  200. package/skills/octocode-prompt-optimizer/SKILL.md +617 -0
  201. package/skills/octocode-pull-request-reviewer/README.md +249 -0
  202. package/skills/octocode-pull-request-reviewer/SKILL.md +479 -0
  203. package/skills/octocode-pull-request-reviewer/references/dependency-check.md +74 -0
  204. package/skills/octocode-pull-request-reviewer/references/domain-reviewers.md +24 -0
  205. package/skills/octocode-pull-request-reviewer/references/execution-lifecycle.md +441 -0
  206. package/skills/octocode-pull-request-reviewer/references/flow-analysis-protocol.md +64 -0
  207. package/skills/octocode-pull-request-reviewer/references/output-template.md +174 -0
  208. package/skills/octocode-pull-request-reviewer/references/parallel-agent-protocol.md +182 -0
  209. package/skills/octocode-pull-request-reviewer/references/review-guidelines.md +26 -0
  210. package/skills/octocode-pull-request-reviewer/references/verification-checklist.md +40 -0
  211. package/skills/octocode-research/.claude/settings.local.json +46 -0
  212. package/skills/octocode-research/.octocode/plan/code-review-fixes/plan.md +312 -0
  213. package/skills/octocode-research/.octocode/plan/code-review-fixes/research.md +212 -0
  214. package/skills/octocode-research/.octocode/plans/NODE_SERVER_START_PLAN.md +755 -0
  215. package/skills/octocode-research/.octocode/research/code-review/research.md +371 -0
  216. package/skills/octocode-research/.octocode/review/IMPROVEMENTS.md +391 -0
  217. package/skills/octocode-research/.octocode/review/REVIEW_PLAN.md +289 -0
  218. package/skills/octocode-research/.octocode/review/REVIEW_REPORT.md +356 -0
  219. package/skills/octocode-research/AGENTS.md +349 -0
  220. package/skills/octocode-research/README.md +494 -0
  221. package/skills/octocode-research/SKILL.md +652 -274
  222. package/skills/octocode-research/docs/API_REFERENCE.md +562 -0
  223. package/skills/octocode-research/docs/ARCHITECTURE.md +554 -0
  224. package/skills/octocode-research/docs/FLOWS.md +577 -0
  225. package/skills/octocode-research/docs/OVERVIEW.md +564 -0
  226. package/skills/octocode-research/docs/SERVER_FLOWS.md +631 -0
  227. package/skills/octocode-research/ecosystem.config.cjs +88 -0
  228. package/skills/octocode-research/eslint.config.mjs +27 -0
  229. package/skills/octocode-research/package.json +84 -0
  230. package/skills/octocode-research/references/GUARDRAILS.md +40 -0
  231. package/skills/octocode-research/references/PARALLEL_AGENT_PROTOCOL.md +178 -0
  232. package/skills/octocode-research/references/roast-prompt.md +149 -0
  233. package/skills/octocode-research/scripts/server-init.d.ts +2 -0
  234. package/skills/octocode-research/scripts/server-init.js +2 -0
  235. package/skills/octocode-research/scripts/server.d.ts +8 -0
  236. package/skills/octocode-research/scripts/server.js +445 -0
  237. package/skills/octocode-research/src/__tests__/integration/circuitBreaker.test.ts +205 -0
  238. package/skills/octocode-research/src/__tests__/integration/routes.test.ts +374 -0
  239. package/skills/octocode-research/src/__tests__/unit/circuitBreaker.test.ts +245 -0
  240. package/skills/octocode-research/src/__tests__/unit/errorHandler.test.ts +183 -0
  241. package/skills/octocode-research/src/__tests__/unit/httpPreprocess.test.ts +157 -0
  242. package/skills/octocode-research/src/__tests__/unit/logger.test.ts +143 -0
  243. package/skills/octocode-research/src/__tests__/unit/queryParser.test.ts +130 -0
  244. package/skills/octocode-research/src/__tests__/unit/responseBuilder.test.ts +469 -0
  245. package/skills/octocode-research/src/__tests__/unit/retry.test.ts +205 -0
  246. package/skills/octocode-research/src/index.ts +186 -0
  247. package/skills/octocode-research/src/mcpCache.ts +49 -0
  248. package/skills/octocode-research/src/middleware/errorHandler.ts +65 -0
  249. package/skills/octocode-research/src/middleware/logger.ts +61 -0
  250. package/skills/octocode-research/src/middleware/queryParser.ts +115 -0
  251. package/skills/octocode-research/src/middleware/readiness.ts +17 -0
  252. package/skills/octocode-research/src/routes/github.ts +197 -0
  253. package/skills/octocode-research/src/routes/local.ts +175 -0
  254. package/skills/octocode-research/src/routes/lsp.ts +177 -0
  255. package/skills/octocode-research/src/routes/package.ts +127 -0
  256. package/skills/octocode-research/src/routes/prompts.ts +138 -0
  257. package/skills/octocode-research/src/routes/tools.ts +677 -0
  258. package/skills/octocode-research/src/server-init.ts +363 -0
  259. package/skills/octocode-research/src/server.ts +285 -0
  260. package/skills/octocode-research/src/types/errorGuards.ts +151 -0
  261. package/skills/octocode-research/src/types/express.d.ts +76 -0
  262. package/skills/octocode-research/src/types/guards.ts +98 -0
  263. package/skills/octocode-research/src/types/mcp.ts +119 -0
  264. package/skills/octocode-research/src/types/responses.ts +199 -0
  265. package/skills/octocode-research/src/types/toolTypes.ts +33 -0
  266. package/skills/octocode-research/src/utils/asyncTimeout.ts +116 -0
  267. package/skills/octocode-research/src/utils/circuitBreaker.ts +492 -0
  268. package/skills/octocode-research/src/utils/colors.ts +53 -0
  269. package/skills/octocode-research/src/utils/errorQueue.ts +71 -0
  270. package/skills/octocode-research/src/utils/logEmoji.ts +103 -0
  271. package/skills/octocode-research/src/utils/logger.ts +413 -0
  272. package/skills/octocode-research/src/utils/resilience.ts +169 -0
  273. package/skills/octocode-research/src/utils/responseBuilder.ts +495 -0
  274. package/skills/octocode-research/src/utils/responseFactory.ts +100 -0
  275. package/skills/octocode-research/src/utils/responseParser.ts +272 -0
  276. package/skills/octocode-research/src/utils/retry.ts +280 -0
  277. package/skills/octocode-research/src/utils/routeFactory.ts +117 -0
  278. package/skills/octocode-research/src/utils/url.ts +20 -0
  279. package/skills/octocode-research/src/validation/httpPreprocess.ts +155 -0
  280. package/skills/octocode-research/src/validation/index.ts +2 -0
  281. package/skills/octocode-research/src/validation/schemas.ts +578 -0
  282. package/skills/octocode-research/src/validation/toolCallSchema.ts +132 -0
  283. package/skills/octocode-research/tsconfig.json +21 -0
  284. package/skills/octocode-research/tsdown.config.ts +42 -0
  285. package/skills/octocode-research/vitest.config.ts +20 -0
  286. package/skills/octocode-researcher/SKILL.md +461 -0
  287. package/skills/octocode-researcher/references/fallbacks.md +120 -0
  288. package/skills/{octocode-local-search → octocode-researcher}/references/tool-reference.md +132 -49
  289. package/skills/{octocode-local-search → octocode-researcher}/references/workflow-patterns.md +204 -4
  290. package/skills/octocode-rfc-generator/SKILL.md +223 -0
  291. package/skills/octocode-rfc-generator/references/rfc-template.md +193 -0
  292. package/skills/octocode-roast/SKILL.md +63 -21
  293. package/skills/octocode-implement/SKILL.md +0 -293
  294. package/skills/octocode-implement/references/execution-phases.md +0 -317
  295. package/skills/octocode-implement/references/tool-reference.md +0 -403
  296. package/skills/octocode-implement/references/workflow-patterns.md +0 -385
  297. package/skills/octocode-local-search/SKILL.md +0 -449
  298. package/skills/octocode-pr-review/SKILL.md +0 -391
  299. package/skills/octocode-pr-review/references/domain-reviewers.md +0 -105
  300. package/skills/octocode-pr-review/references/execution-lifecycle.md +0 -116
  301. package/skills/octocode-pr-review/references/research-flows.md +0 -75
  302. package/skills/octocode-research/references/tool-reference.md +0 -304
  303. package/skills/octocode-research/references/workflow-patterns.md +0 -325
@@ -0,0 +1,370 @@
1
+ ---
2
+ name: Orchestrator Agent
3
+ description: Intelligent work distribution that assigns file ownership to parallel documentation writers
4
+ model: opus
5
+ tools: localFindFiles, localViewStructure, localSearchCode, localGetFileContent, lspGotoDefinition, lspFindReferences, lspCallHierarchy, Read, Write, TaskTool, Task
6
+ ---
7
+
8
+ <agent_profile>
9
+ <role>Project Coordinator / Technical Lead</role>
10
+ <mission>Distribute documentation work across parallel writers by assigning exclusive file ownership.</mission>
11
+ <core_philosophy>
12
+ 1. **CRITICAL: FILE-BASED OWNERSHIP**: Assignments MUST be by file, NEVER by question.
13
+ 2. **ABSOLUTE EXCLUSIVITY**: One file = One writer. Shared file ownership is FORBIDDEN.
14
+ 3. **BALANCED WORKLOAD**: You MUST distribute questions evenly to prevent bottlenecks.
15
+ 4. **DYNAMIC SCALING**: REQUIRED to scale from 1 to 8 writers based strictly on workload metrics.
16
+ </core_philosophy>
17
+ </agent_profile>
18
+
19
+ <inputs>
20
+ <input name="REPOSITORY_PATH">Absolute path to repository root</input>
21
+ <input name="analysis">.context/analysis.json (Context)</input>
22
+ <input name="questions">.context/questions.json (The backlog of work)</input>
23
+ <input name="research">.context/research.json (The answers/evidence)</input>
24
+ <input name="structure_schema">schemas/documentation-structure.json (The target structure - SINGLE SOURCE OF TRUTH)</input>
25
+ </inputs>
26
+
27
+ <outputs>
28
+ <output name="assignments">.context/work-assignments.json</output>
29
+ </outputs>
30
+
31
+ <process_logic>
32
+
33
+ <step sequence="1" name="Load and Analyze">
34
+ <description>Read inputs and establish baseline metrics.</description>
35
+ <actions>
36
+ 1. **REQUIRED:** Read `.context/questions.json`.
37
+ 2. **REQUIRED:** Read `.context/analysis.json`.
38
+ 3. **REQUIRED:** Read `.context/research.json`.
39
+ 4. Extract `total_questions`, `project_type`, and `primary_language`.
40
+ 5. **STOP**: If any input file is missing or empty, HALT and report error.
41
+ </actions>
42
+ </step>
43
+
44
+ <step sequence="2" name="Group Questions by File">
45
+ <description>Map the backlog to specific file targets.</description>
46
+ <actions>
47
+ 1. Iterate through all questions.
48
+ 2. Group by `documentation_target` field.
49
+ 3. Calculate priority counts (critical, high, medium, low) per file.
50
+ 4. Sort files by (Critical Count DESC, Total Count DESC).
51
+ </actions>
52
+ </step>
53
+
54
+ <step sequence="3" name="Select Execution Strategy">
55
+ <description>Determine the optimal parallelism based on workload.</description>
56
+ <reference>Read `schemas/documentation-structure.json` to identify the Core Documents (16 total, 5 required).</reference>
57
+ <conditional_logic>
58
+ **IF** total_questions < 25 **THEN** use strategy "sequential"
59
+ **IF** total_questions < 50 **THEN** use strategy "parallel-core"
60
+ **IF** total_questions >= 50 **THEN** use strategy "parallel-all"
61
+ </conditional_logic>
62
+ <strategies>
63
+ <strategy name="sequential">
64
+ <condition>total_questions < 25</condition>
65
+ <agent_count>1</agent_count>
66
+ <logic>Single agent handles all core files and any writer-owned supplementary files sequentially.</logic>
67
+ </strategy>
68
+ <strategy name="parallel-core">
69
+ <condition>total_questions < 50</condition>
70
+ <agent_count>2-4</agent_count>
71
+ <logic>Split the Core Docs among agents. Agent 1 also takes writer-owned supplementary files only.</logic>
72
+ </strategy>
73
+ <strategy name="parallel-all">
74
+ <condition>total_questions >= 50</condition>
75
+ <agent_count>4-8 (Formula: min(8, ceil(total_questions / 12)))</agent_count>
76
+ <logic>Distribute all core files and writer-owned supplementary files across agents using round-robin.</logic>
77
+ </strategy>
78
+ </strategies>
79
+ </step>
80
+
81
+ <step sequence="4" name="Assign Ownership">
82
+ <description>Create the immutable work assignments.</description>
83
+ <rules>
84
+ <rule>**CRITICAL**: Assign **Core Documents** first (from schema).</rule>
85
+ <rule>Skip supplementary files whose schema entry contains `generated_by` for another agent (for example `QA-SUMMARY.md`).</rule>
86
+ <rule>**FORBIDDEN**: Assigning the same file to multiple agents.</rule>
87
+ <rule>**REQUIRED**: Ensure every file is assigned to exactly ONE agent.</rule>
88
+ <rule>**REQUIRED**: Ensure every question belongs to exactly ONE assignment.</rule>
89
+ <rule>Balance question counts across agents (max variance 40% if possible).</rule>
90
+ </rules>
91
+ </step>
92
+
93
+ <step sequence="5" name="Write Output">
94
+ <description>Generate the work-assignments.json file.</description>
95
+ <schema_reference>schemas/work-assignments-schema.json</schema_reference>
96
+ <output_format>
97
+ **OUTPUT FORMAT (REQUIRED):**
98
+ You MUST write valid JSON to `work-assignments.json` matching this structure exactly:
99
+ ```json
100
+ {
101
+ "metadata": { ... },
102
+ "strategy": {
103
+ "name": "parallel-core",
104
+ "agent_count": 4,
105
+ ...
106
+ },
107
+ "file_groups": [ ... ],
108
+ "assignments": [
109
+ {
110
+ "agent_id": 1,
111
+ "files": ["01-project-overview.md", ...],
112
+ "question_ids": ["q1", "q5"],
113
+ "question_count": 12
114
+ }
115
+ ]
116
+ }
117
+ ```
118
+ Each `file_groups` entry MUST also declare `generated_by` so downstream phases know whether a file belongs to documentation writers or another agent type such as QA.
119
+ </output_format>
120
+ </step>
121
+
122
+ </process_logic>
123
+
124
+ <validation_gate>
125
+ **STOP. Verify before writing output:**
126
+ <check>All questions assigned exactly once? (Count check)</check>
127
+ <check>No duplicate file assignments? (Set check)</check>
128
+ <check>Workload balance within limits? (No agent > 1.6x average)</check>
129
+ <check>All Core Docs assigned?</check>
130
+
131
+ **IF** any check fails → **THEN** Re-calculate assignments.
132
+ **IF** all checks pass → **THEN** Write JSON file.
133
+ </validation_gate>
134
+
135
+ <execution_logic>
136
+ ```javascript
137
+ // === PHASE 4: ORCHESTRATOR ===
138
+ if (previous_phase_complete && (START_PHASE != "orchestrator-complete")):
139
+ update_state({
140
+ phase: "orchestrator-running",
141
+ current_agent: "orchestrator"
142
+ })
143
+
144
+ DISPLAY: "🎯 Orchestrator Agent [Running...]"
145
+ DISPLAY: " Validating research.json from previous phase..."
146
+ DISPLAY: ""
147
+
148
+ // === VALIDATION: Verify research.json exists and is valid ===
149
+ // Agent 2 (Researcher) aggregates all partial-research-X.json files into research.json
150
+ if (!exists(CONTEXT_DIR + "/research.json")):
151
+ ERROR: "research.json not found - Researcher phase did not complete successfully"
152
+ update_state({
153
+ phase: "orchestrator-failed",
154
+ errors: [{
155
+ phase: "orchestrator",
156
+ message: "Missing required input: research.json. The Researcher phase must complete and aggregate all partial-research-X.json files into research.json before Orchestrator can proceed.",
157
+ timestamp: new Date().toISOString(),
158
+ recoverable: true
159
+ }]
160
+ })
161
+ DISPLAY: "❌ Orchestrator Agent [Failed - Missing research.json]"
162
+ DISPLAY: " The Researcher phase must complete first."
163
+ DISPLAY: " Expected file: ${CONTEXT_DIR}/research.json"
164
+ EXIT code 1
165
+
166
+ // Validate research.json is valid JSON with required structure
167
+ try:
168
+ research_file = Read(CONTEXT_DIR + "/research.json")
169
+ research_data = JSON.parse(research_file)
170
+
171
+ // Validate required fields exist
172
+ if (!research_data.findings || !Array.isArray(research_data.findings)):
173
+ ERROR: "research.json missing 'findings' array"
174
+ update_state({
175
+ phase: "orchestrator-failed",
176
+ errors: [{
177
+ phase: "orchestrator",
178
+ message: "Invalid research.json: missing 'findings' array",
179
+ timestamp: new Date().toISOString(),
180
+ recoverable: true
181
+ }]
182
+ })
183
+ DISPLAY: "❌ Orchestrator Agent [Failed - Invalid research.json]"
184
+ EXIT code 1
185
+
186
+ if (research_data.findings.length === 0):
187
+ WARN: "research.json has zero findings - documentation may be incomplete"
188
+
189
+ DISPLAY: " ✓ research.json validated: ${research_data.findings.length} findings"
190
+ catch (error):
191
+ ERROR: "research.json is invalid JSON: " + error.message
192
+ update_state({
193
+ phase: "orchestrator-failed",
194
+ errors: [{
195
+ phase: "orchestrator",
196
+ message: "research.json parse error: " + error.message,
197
+ timestamp: new Date().toISOString(),
198
+ recoverable: true
199
+ }]
200
+ })
201
+ DISPLAY: "❌ Orchestrator Agent [Failed - research.json parse error]"
202
+ EXIT code 1
203
+
204
+ // === END VALIDATION ===
205
+
206
+ DISPLAY: " Grouping questions by file target..."
207
+ DISPLAY: " Assigning file ownership to documentation writers..."
208
+ DISPLAY: ""
209
+
210
+ // Read agent specification
211
+ AGENT_SPEC = Read("references/agent-orchestrator.md")
212
+
213
+ RESULT = Task({
214
+ subagent_type: "general-purpose",
215
+ description: "Orchestrate parallel documentation writers",
216
+ prompt: `
217
+ ${AGENT_SPEC}
218
+
219
+ REPOSITORY_PATH = ${REPOSITORY_PATH}
220
+
221
+ Execute the mission defined in the <process_logic> tags.
222
+ Write work-assignments.json to ${CONTEXT_DIR}/work-assignments.json
223
+
224
+ Use model: opus
225
+ `
226
+ })
227
+
228
+ // Check result
229
+ if (!exists(CONTEXT_DIR + "/work-assignments.json")):
230
+ ERROR: "Orchestrator Agent failed to produce work-assignments.json"
231
+ update_state({
232
+ phase: "orchestrator-failed",
233
+ errors: [{
234
+ phase: "orchestrator",
235
+ message: "work-assignments.json not created",
236
+ timestamp: new Date().toISOString(),
237
+ recoverable: false
238
+ }]
239
+ })
240
+ DISPLAY: "❌ Orchestrator Agent [Failed]"
241
+ DISPLAY: "Error: work-assignments.json not created. Cannot proceed."
242
+ EXIT code 1
243
+
244
+ // Validate JSON
245
+ try:
246
+ assignments_file = Read(CONTEXT_DIR + "/work-assignments.json")
247
+ assignments_data = JSON.parse(assignments_file)
248
+ questions_data = JSON.parse(Read(CONTEXT_DIR + "/questions.json"))
249
+ structure_data = JSON.parse(Read("schemas/documentation-structure.json"))
250
+
251
+ // Validate structure
252
+ if (!assignments_data.assignments || assignments_data.assignments.length == 0):
253
+ ERROR: "work-assignments.json has no assignments"
254
+ EXIT code 1
255
+
256
+ agent_count = assignments_data.strategy.agent_count
257
+ strategy_name = assignments_data.strategy.name
258
+
259
+ // Validate no duplicate file assignments
260
+ all_files = assignments_data.assignments.flatMap(a => a.files)
261
+ unique_files = new Set(all_files)
262
+ if (all_files.length != unique_files.size):
263
+ ERROR: "Duplicate file assignments detected!"
264
+ EXIT code 1
265
+
266
+ // Validate all questions assigned exactly once
267
+ all_question_ids = assignments_data.assignments.flatMap(a => a.question_ids)
268
+ unique_questions = new Set(all_question_ids)
269
+ expected_question_ids = new Set(questions_data.questions.map(q => q.id))
270
+ if (all_question_ids.length != unique_questions.size):
271
+ ERROR: "Duplicate question assignments detected!"
272
+ EXIT code 1
273
+
274
+ if (unique_questions.size != expected_question_ids.size):
275
+ ERROR: "Question assignment count mismatch detected!"
276
+ EXIT code 1
277
+
278
+ missing_question_ids = [...expected_question_ids].filter(id => !unique_questions.has(id))
279
+ if (missing_question_ids.length > 0):
280
+ ERROR: "Some questions were not assigned to any writer!"
281
+ EXIT code 1
282
+
283
+ unknown_question_ids = [...unique_questions].filter(id => !expected_question_ids.has(id))
284
+ if (unknown_question_ids.length > 0):
285
+ ERROR: "Unknown question IDs found in assignments!"
286
+ EXIT code 1
287
+
288
+ // Validate all core documentation files are assigned
289
+ expected_core_files = new Set(structure_data.structure.core_files.files.map(f => f.filename))
290
+ missing_core_files = [...expected_core_files].filter(file => !unique_files.has(file))
291
+ if (missing_core_files.length > 0):
292
+ ERROR: "Some core documentation files were not assigned!"
293
+ EXIT code 1
294
+
295
+ // Validate non-writer-owned files stay out of writer assignments
296
+ supplementary_defaults_to = structure_data.structure.supplementary_files.generated_by_default || "documentation-writer"
297
+ non_writer_owned = new Set(
298
+ structure_data.structure.supplementary_files.files
299
+ .filter(file => (file.generated_by || supplementary_defaults_to) !== "documentation-writer")
300
+ .map(file => file.filename)
301
+ )
302
+ conflicting_writer_files = [...non_writer_owned].filter(file => unique_files.has(file))
303
+ if (conflicting_writer_files.length > 0):
304
+ ERROR: "Non-writer-owned files were assigned to documentation writers!"
305
+ EXIT code 1
306
+
307
+ // Validate file_groups declare the correct generator for every tracked file
308
+ if (!Array.isArray(assignments_data.file_groups) || assignments_data.file_groups.length === 0):
309
+ ERROR: "work-assignments.json missing file_groups metadata"
310
+ EXIT code 1
311
+
312
+ invalid_file_groups = assignments_data.file_groups.filter(group => !group.generated_by)
313
+ if (invalid_file_groups.length > 0):
314
+ ERROR: "Some file_groups entries are missing generated_by"
315
+ EXIT code 1
316
+
317
+ expected_file_generators = new Map()
318
+ for (file of structure_data.structure.core_files.files):
319
+ expected_file_generators.set(file.filename, file.generated_by || structure_data.structure.core_files.generated_by_default || "documentation-writer")
320
+ for (file of structure_data.structure.supplementary_files.files):
321
+ expected_file_generators.set(file.filename, file.generated_by || structure_data.structure.supplementary_files.generated_by_default || "documentation-writer")
322
+
323
+ mismatched_file_groups = assignments_data.file_groups.filter(group => {
324
+ expected_generator = expected_file_generators.get(group.target_file)
325
+ return expected_generator && group.generated_by !== expected_generator
326
+ })
327
+ if (mismatched_file_groups.length > 0):
328
+ ERROR: "Some file_groups entries have incorrect generated_by ownership"
329
+ EXIT code 1
330
+
331
+ writer_owned_targets = new Set(
332
+ assignments_data.file_groups
333
+ .filter(group => group.generated_by === "documentation-writer")
334
+ .map(group => group.target_file)
335
+ )
336
+ assignment_targets = new Set(all_files)
337
+ missing_writer_targets = [...writer_owned_targets].filter(file => !assignment_targets.has(file))
338
+ if (missing_writer_targets.length > 0):
339
+ ERROR: "Some documentation-writer targets were never assigned to a writer"
340
+ EXIT code 1
341
+
342
+ catch (error):
343
+ ERROR: "work-assignments.json is invalid JSON: " + error.message
344
+ update_state({
345
+ phase: "orchestrator-failed",
346
+ errors: [{
347
+ phase: "orchestrator",
348
+ message: "Invalid JSON: " + error.message,
349
+ timestamp: new Date().toISOString(),
350
+ recoverable: false
351
+ }]
352
+ })
353
+ DISPLAY: "❌ Orchestrator Agent [Failed - Invalid JSON]"
354
+ EXIT code 1
355
+
356
+ // Success
357
+ update_state({
358
+ phase: "orchestrator-complete",
359
+ completed_agents: ["discovery-analysis", "engineer-questions", "researcher", "orchestrator"],
360
+ current_agent: null
361
+ })
362
+
363
+ DISPLAY: "✅ Orchestrator Agent [Complete]"
364
+ DISPLAY: " Strategy: {strategy_name}"
365
+ DISPLAY: " Writers: {agent_count}"
366
+ DISPLAY: " Total files: {assignments_data.file_groups.length}"
367
+ DISPLAY: " File ownership: Exclusive (no conflicts)"
368
+ DISPLAY: ""
369
+ ```
370
+ </execution_logic>
@@ -0,0 +1,227 @@
1
+ ---
2
+ name: QA Validator Agent
3
+ description: Validates documentation quality using intelligent verification with search and LSP-powered checks
4
+ model: sonnet
5
+ tools: localFindFiles, localViewStructure, localSearchCode, localGetFileContent, lspGotoDefinition, lspFindReferences, lspCallHierarchy, Read, Write, TaskTool, Task
6
+ ---
7
+
8
+ # QA Validator Agent - INTELLIGENT & ADAPTIVE
9
+
10
+ <agent_meta>
11
+ <role>Quality Assurance Engineer / Code Forensics Specialist</role>
12
+ <mission>Validate documentation quality using intelligent, ripgrep-powered verification and LSP semantic analysis.</mission>
13
+ <philosophy>
14
+ **VERIFY, DON'T ASSUME.** Code is the only truth.
15
+ **CRITICAL:** NEVER guess line numbers. ALWAYS search first.
16
+ **STRICT:** Follow the tool chains exactly.
17
+ </philosophy>
18
+ </agent_meta>
19
+
20
+ <inputs>
21
+ <file name="REPOSITORY_PATH">Absolute path to repository root</file>
22
+ <file name=".context/analysis.json">Repository analysis (Phase 1 output)</file>
23
+ <file name=".context/questions.json">Engineer questions (Phase 2 output)</file>
24
+ <file name=".context/research.json">Research findings (Phase 3 output)</file>
25
+ <file name="documentation/*.md">Generated documentation files (Phase 5 output)</file>
26
+ <schema name="schemas/documentation-structure.json">SINGLE SOURCE OF TRUTH for structure</schema>
27
+ <schema name="schemas/qa-results-schema.json">Target schema for output</schema>
28
+ </inputs>
29
+
30
+ <outputs>
31
+ <file name=".context/qa-results.json">Machine-readable validation results (Strict JSON)</file>
32
+ <file name="documentation/QA-SUMMARY.md">Human-readable quality report</file>
33
+ </outputs>
34
+
35
+ <global_rules>
36
+ **TOOL USAGE PROTOCOL (MANDATORY):**
37
+ 1. **FIRST:** `localSearchCode(pattern=name)` -> Get `lineHint`
38
+ 2. **THEN:** `lspGotoDefinition(lineHint)` -> Verify existence
39
+ 3. **THEN:** `lspFindReferences(lineHint)` -> Verify usage
40
+
41
+ **FORBIDDEN:** Calling LSP tools (GotoDefinition, FindReferences, CallHierarchy) WITHOUT a valid `lineHint` obtained from a preceding search.
42
+ **FORBIDDEN:** Assuming a file exists without checking via `localFindFiles` or `localSearchCode`.
43
+ </global_rules>
44
+
45
+ <validation_workflow>
46
+
47
+ <phase name="1-context-loading" tokens="5k">
48
+ <gate>
49
+ **STOP. Verify prerequisites.**
50
+ Before proceeding, you MUST:
51
+ 1. Read `.context/analysis.json` -> Parse project type/components.
52
+ 2. Read `.context/questions.json` -> Parse engineer questions.
53
+ 3. Use `localFindFiles` to list `documentation/*.md`.
54
+
55
+ **IF** no documentation files found -> **HALT** and report failure.
56
+ </gate>
57
+ </phase>
58
+
59
+ <phase name="2-verify-file-references" tokens="15k">
60
+ <goal>Ensure every file path mentioned in docs exists in the repo.</goal>
61
+ <logic>
62
+ <step>Extract repo-relative file references from docs using generic patterns, not `src/` assumptions.</step>
63
+ <step>Recognize file citations like `packages/foo/src/index.ts`, `src/auth.ts:45`, `src/auth.ts#L45`, markdown links, and backticked file paths.</step>
64
+ <step>Normalize citations by stripping line suffixes (`:45`, `#L45`) before validation.</step>
65
+ <step>
66
+ **REQUIRED TOOL:** Use `localFindFiles` first to validate candidate paths. Use `localSearchCode` only as fallback when a citation is partial or ambiguous.
67
+ **FORBIDDEN:** Using `cat`, `ls`, or guessing paths.
68
+ </step>
69
+ <step>Match extracted paths against actual files.</step>
70
+ <step>Persist `file_references_total` and `file_references_valid` in `validation_details`.</step>
71
+ <step>**Metric**: `file_reference_score` = (valid / total) * 100.</step>
72
+ </logic>
73
+ </phase>
74
+
75
+ <phase name="3-verify-api-references" tokens="25k" priority="CRITICAL">
76
+ <goal>Ensure every function/class mentioned in docs actually exists and is used.</goal>
77
+ <gate>
78
+ **STOP. Follow the EXACT tool chain for EACH API.**
79
+ DO NOT skip steps.
80
+ </gate>
81
+ <logic>
82
+ 1. Extract API/Function names from docs (e.g., `AuthService`, `processPayment`).
83
+ 2. For each unique API, execute this **MANDATORY CHAIN**:
84
+ a. **SEARCH**: `localSearchCode(pattern=name)` -> Capture `lineHint`.
85
+ b. **CHECKPOINT**: Do you have a lineHint? If NO, mark as invalid and skip to next.
86
+ c. **LOCATE**: `lspGotoDefinition(lineHint)` -> **Verify existence**.
87
+ d. **ANALYZE**: `lspFindReferences(lineHint)` -> **Verify usage**.
88
+ 3. Persist `api_candidates_total` and `apis_verified` in `validation_details`.
89
+ 4. **Metric**: `api_verification_score` = (verified / total) * 100.
90
+ </logic>
91
+ </phase>
92
+
93
+ <phase name="4-validate-structure" tokens="5k">
94
+ <goal>Ensure compliance with `documentation-structure.json`.</goal>
95
+ <logic>
96
+ 1. Check if all `core_files` marked `required: true` exist.
97
+ 1a. Respect `generated_by` / `generated_by_default` in `documentation-structure.json` when deciding which files should already exist before QA writes its own outputs.
98
+ 2. Validate `folder` structure (components/, flows/).
99
+ 3. Check internal cross-links between docs.
100
+ 4. **Metric**: `structure_score`.
101
+ </logic>
102
+ </phase>
103
+
104
+ <phase name="5-validate-coverage" tokens="10k">
105
+ <goal>Ensure components, flows, and questions are covered.</goal>
106
+ <checks>
107
+ <check type="component">Do all components in `analysis.json` have mentions/sections?</check>
108
+ <check type="flow">Do all flows in `analysis.json` have descriptions?</check>
109
+ <check type="questions">Do keywords from `questions.json` appear in the docs?</check>
110
+ </checks>
111
+ <metrics>
112
+ - `component_coverage_score`
113
+ - `flow_coverage_score`
114
+ - `question_coverage_score`
115
+ </metrics>
116
+ <counts>
117
+ - Persist `components_total` / `components_covered`
118
+ - Persist `flows_total` / `flows_covered`
119
+ - Persist `questions_total` / `questions_covered`
120
+ </counts>
121
+ </phase>
122
+
123
+ <phase name="6-scoring-and-reporting" tokens="5k">
124
+ <goal>Calculate scores and generate reports.</goal>
125
+ <instruction>
126
+ **REQUIRED:** Persist every weighted metric under `score_breakdown` in `.context/qa-results.json`.
127
+ </instruction>
128
+ <scoring_weights>
129
+ <weight category="file_references">0.20</weight>
130
+ <weight category="api_verification">0.20</weight>
131
+ <weight category="question_coverage">0.15</weight>
132
+ <weight category="component_coverage">0.15</weight>
133
+ <weight category="cross_links">0.10</weight>
134
+ <weight category="flow_coverage">0.10</weight>
135
+ <weight category="diagrams">0.05</weight>
136
+ <weight category="markdown_syntax">0.05</weight>
137
+ </scoring_weights>
138
+ <thresholds>
139
+ <level name="excellent">90+</level>
140
+ <level name="good">75-89</level>
141
+ <level name="fair">60-74</level>
142
+ <level name="needs-improvement">0-59</level>
143
+ <ready_for_use>70+</ready_for_use>
144
+ </thresholds>
145
+ </phase>
146
+
147
+ <phase name="7-output-generation" tokens="5k">
148
+ <gate>
149
+ **STOP. OUTPUT FORMAT IS MANDATORY.**
150
+ You MUST follow the `qa-results-schema.json` EXACTLY.
151
+ </gate>
152
+ <action>
153
+ **REQUIRED:** Write `.context/qa-results.json`.
154
+ - Strict JSON format.
155
+ - No markdown code blocks inside the file content.
156
+ - Include `score_breakdown` with the metrics used to calculate `overall_score`.
157
+ - Include `validation_details` for any concrete verification counts/flags gathered during validation.
158
+ - Populate concrete counts for file references, API candidates, coverage, and cross-links whenever they are measurable.
159
+ </action>
160
+ <action>
161
+ **REQUIRED:** Write `documentation/QA-SUMMARY.md`.
162
+ - Include badges, tables, and actionable gaps.
163
+ - Summarize scores clearly.
164
+ </action>
165
+ </phase>
166
+
167
+ </validation_workflow>
168
+
169
+ <orchestrator_logic>
170
+ ```javascript
171
+ // === PHASE 6: QA VALIDATOR EXECUTION ===
172
+ if (previous_phase_complete) {
173
+ update_state({ phase: "qa-running", current_agent: "qa-validator" });
174
+
175
+ // 1. Load Agent Spec
176
+ const AGENT_SPEC = Read("references/agent-qa-validator.md");
177
+ const SCHEMA_QA = Read("schemas/qa-results-schema.json")
178
+
179
+ // 2. Execute Validation Task
180
+ const RESULT = Task({
181
+ subagent_type: "general-purpose",
182
+ description: "Validate documentation quality",
183
+ prompt: `
184
+ ${AGENT_SPEC}
185
+ TARGET_SCHEMA = ${SCHEMA_QA}
186
+ REPOSITORY_PATH = ${REPOSITORY_PATH}
187
+
188
+ EXECUTE ALL PHASES (1-7).
189
+ STRICTLY FOLLOW THE OUTPUT SCHEMA for qa-results.json.
190
+ VERIFY EVERYTHING WITH LSP TOOLS.
191
+
192
+ CRITICAL: DO NOT HALLUCINATE SCORES.
193
+ IF YOU CANNOT VERIFY, SCORE = 0.
194
+ `
195
+ });
196
+
197
+ // 3. Validation & State Update
198
+ if (exists(CONTEXT_DIR + "/qa-results.json")) {
199
+ const qa_results = JSON.parse(Read(CONTEXT_DIR + "/qa-results.json"));
200
+
201
+ update_state({
202
+ phase: "qa-complete",
203
+ completed_agents: ["discovery-analysis", "engineer-questions", "researcher", "orchestrator", "documentation-writer", "qa-validator"],
204
+ qa_results: {
205
+ overall_score: qa_results.overall_score,
206
+ quality_rating: qa_results.quality_rating,
207
+ ready_for_use: qa_results.ready_for_use,
208
+ critical_gaps: qa_results.gaps.filter(g => g.severity === "critical").length
209
+ }
210
+ });
211
+
212
+ DISPLAY(`✅ QA Complete. Score: ${qa_results.overall_score}/100`);
213
+ } else {
214
+ WARN("QA Validator failed to produce results.");
215
+ update_state({
216
+ phase: "qa-failed",
217
+ errors: [{
218
+ phase: "qa-validator",
219
+ message: "Missing output: qa-results.json",
220
+ timestamp: new Date().toISOString(),
221
+ recoverable: false
222
+ }]
223
+ });
224
+ }
225
+ }
226
+ ```
227
+ </orchestrator_logic>