openlore 2.0.0

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 (634) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -0
  3. package/dist/api/analyze.d.ts +17 -0
  4. package/dist/api/analyze.d.ts.map +1 -0
  5. package/dist/api/analyze.js +143 -0
  6. package/dist/api/analyze.js.map +1 -0
  7. package/dist/api/audit.d.ts +10 -0
  8. package/dist/api/audit.d.ts.map +1 -0
  9. package/dist/api/audit.js +117 -0
  10. package/dist/api/audit.js.map +1 -0
  11. package/dist/api/decisions.d.ts +55 -0
  12. package/dist/api/decisions.d.ts.map +1 -0
  13. package/dist/api/decisions.js +157 -0
  14. package/dist/api/decisions.js.map +1 -0
  15. package/dist/api/drift.d.ts +21 -0
  16. package/dist/api/drift.d.ts.map +1 -0
  17. package/dist/api/drift.js +152 -0
  18. package/dist/api/drift.js.map +1 -0
  19. package/dist/api/generate.d.ts +18 -0
  20. package/dist/api/generate.d.ts.map +1 -0
  21. package/dist/api/generate.js +259 -0
  22. package/dist/api/generate.js.map +1 -0
  23. package/dist/api/index.d.ts +41 -0
  24. package/dist/api/index.d.ts.map +1 -0
  25. package/dist/api/index.js +34 -0
  26. package/dist/api/index.js.map +1 -0
  27. package/dist/api/init.d.ts +18 -0
  28. package/dist/api/init.d.ts.map +1 -0
  29. package/dist/api/init.js +83 -0
  30. package/dist/api/init.js.map +1 -0
  31. package/dist/api/run.d.ts +19 -0
  32. package/dist/api/run.d.ts.map +1 -0
  33. package/dist/api/run.js +312 -0
  34. package/dist/api/run.js.map +1 -0
  35. package/dist/api/specs.d.ts +49 -0
  36. package/dist/api/specs.d.ts.map +1 -0
  37. package/dist/api/specs.js +137 -0
  38. package/dist/api/specs.js.map +1 -0
  39. package/dist/api/types.d.ts +201 -0
  40. package/dist/api/types.d.ts.map +1 -0
  41. package/dist/api/types.js +9 -0
  42. package/dist/api/types.js.map +1 -0
  43. package/dist/api/verify.d.ts +20 -0
  44. package/dist/api/verify.d.ts.map +1 -0
  45. package/dist/api/verify.js +117 -0
  46. package/dist/api/verify.js.map +1 -0
  47. package/dist/cli/commands/analyze.d.ts +30 -0
  48. package/dist/cli/commands/analyze.d.ts.map +1 -0
  49. package/dist/cli/commands/analyze.js +683 -0
  50. package/dist/cli/commands/analyze.js.map +1 -0
  51. package/dist/cli/commands/audit.d.ts +9 -0
  52. package/dist/cli/commands/audit.d.ts.map +1 -0
  53. package/dist/cli/commands/audit.js +98 -0
  54. package/dist/cli/commands/audit.js.map +1 -0
  55. package/dist/cli/commands/decisions.d.ts +16 -0
  56. package/dist/cli/commands/decisions.d.ts.map +1 -0
  57. package/dist/cli/commands/decisions.js +864 -0
  58. package/dist/cli/commands/decisions.js.map +1 -0
  59. package/dist/cli/commands/digest.d.ts +9 -0
  60. package/dist/cli/commands/digest.d.ts.map +1 -0
  61. package/dist/cli/commands/digest.js +61 -0
  62. package/dist/cli/commands/digest.js.map +1 -0
  63. package/dist/cli/commands/doctor.d.ts +9 -0
  64. package/dist/cli/commands/doctor.d.ts.map +1 -0
  65. package/dist/cli/commands/doctor.js +398 -0
  66. package/dist/cli/commands/doctor.js.map +1 -0
  67. package/dist/cli/commands/drift.d.ts +9 -0
  68. package/dist/cli/commands/drift.d.ts.map +1 -0
  69. package/dist/cli/commands/drift.js +550 -0
  70. package/dist/cli/commands/drift.js.map +1 -0
  71. package/dist/cli/commands/generate.d.ts +9 -0
  72. package/dist/cli/commands/generate.d.ts.map +1 -0
  73. package/dist/cli/commands/generate.js +565 -0
  74. package/dist/cli/commands/generate.js.map +1 -0
  75. package/dist/cli/commands/init.d.ts +9 -0
  76. package/dist/cli/commands/init.d.ts.map +1 -0
  77. package/dist/cli/commands/init.js +173 -0
  78. package/dist/cli/commands/init.js.map +1 -0
  79. package/dist/cli/commands/mcp.d.ts +2235 -0
  80. package/dist/cli/commands/mcp.d.ts.map +1 -0
  81. package/dist/cli/commands/mcp.js +1384 -0
  82. package/dist/cli/commands/mcp.js.map +1 -0
  83. package/dist/cli/commands/refresh-stories.d.ts +10 -0
  84. package/dist/cli/commands/refresh-stories.d.ts.map +1 -0
  85. package/dist/cli/commands/refresh-stories.js +314 -0
  86. package/dist/cli/commands/refresh-stories.js.map +1 -0
  87. package/dist/cli/commands/run.d.ts +9 -0
  88. package/dist/cli/commands/run.d.ts.map +1 -0
  89. package/dist/cli/commands/run.js +459 -0
  90. package/dist/cli/commands/run.js.map +1 -0
  91. package/dist/cli/commands/setup.d.ts +19 -0
  92. package/dist/cli/commands/setup.d.ts.map +1 -0
  93. package/dist/cli/commands/setup.js +355 -0
  94. package/dist/cli/commands/setup.js.map +1 -0
  95. package/dist/cli/commands/test.d.ts +22 -0
  96. package/dist/cli/commands/test.d.ts.map +1 -0
  97. package/dist/cli/commands/test.js +180 -0
  98. package/dist/cli/commands/test.js.map +1 -0
  99. package/dist/cli/commands/verify.d.ts +9 -0
  100. package/dist/cli/commands/verify.d.ts.map +1 -0
  101. package/dist/cli/commands/verify.js +383 -0
  102. package/dist/cli/commands/verify.js.map +1 -0
  103. package/dist/cli/commands/view.d.ts +13 -0
  104. package/dist/cli/commands/view.d.ts.map +1 -0
  105. package/dist/cli/commands/view.js +547 -0
  106. package/dist/cli/commands/view.js.map +1 -0
  107. package/dist/cli/index.d.ts +9 -0
  108. package/dist/cli/index.d.ts.map +1 -0
  109. package/dist/cli/index.js +118 -0
  110. package/dist/cli/index.js.map +1 -0
  111. package/dist/cli/tui-approval.d.ts +11 -0
  112. package/dist/cli/tui-approval.d.ts.map +1 -0
  113. package/dist/cli/tui-approval.js +129 -0
  114. package/dist/cli/tui-approval.js.map +1 -0
  115. package/dist/constants.d.ts +314 -0
  116. package/dist/constants.d.ts.map +1 -0
  117. package/dist/constants.js +382 -0
  118. package/dist/constants.js.map +1 -0
  119. package/dist/core/analyzer/ai-config-generator.d.ts +54 -0
  120. package/dist/core/analyzer/ai-config-generator.d.ts.map +1 -0
  121. package/dist/core/analyzer/ai-config-generator.js +98 -0
  122. package/dist/core/analyzer/ai-config-generator.js.map +1 -0
  123. package/dist/core/analyzer/architecture-writer.d.ts +67 -0
  124. package/dist/core/analyzer/architecture-writer.d.ts.map +1 -0
  125. package/dist/core/analyzer/architecture-writer.js +209 -0
  126. package/dist/core/analyzer/architecture-writer.js.map +1 -0
  127. package/dist/core/analyzer/artifact-generator.d.ts +261 -0
  128. package/dist/core/analyzer/artifact-generator.d.ts.map +1 -0
  129. package/dist/core/analyzer/artifact-generator.js +909 -0
  130. package/dist/core/analyzer/artifact-generator.js.map +1 -0
  131. package/dist/core/analyzer/ast-chunker.d.ts +24 -0
  132. package/dist/core/analyzer/ast-chunker.d.ts.map +1 -0
  133. package/dist/core/analyzer/ast-chunker.js +198 -0
  134. package/dist/core/analyzer/ast-chunker.js.map +1 -0
  135. package/dist/core/analyzer/call-graph.d.ts +162 -0
  136. package/dist/core/analyzer/call-graph.d.ts.map +1 -0
  137. package/dist/core/analyzer/call-graph.js +2040 -0
  138. package/dist/core/analyzer/call-graph.js.map +1 -0
  139. package/dist/core/analyzer/code-shaper.d.ts +33 -0
  140. package/dist/core/analyzer/code-shaper.d.ts.map +1 -0
  141. package/dist/core/analyzer/code-shaper.js +154 -0
  142. package/dist/core/analyzer/code-shaper.js.map +1 -0
  143. package/dist/core/analyzer/codebase-digest.d.ts +40 -0
  144. package/dist/core/analyzer/codebase-digest.d.ts.map +1 -0
  145. package/dist/core/analyzer/codebase-digest.js +195 -0
  146. package/dist/core/analyzer/codebase-digest.js.map +1 -0
  147. package/dist/core/analyzer/cpp-header-resolver.d.ts +30 -0
  148. package/dist/core/analyzer/cpp-header-resolver.d.ts.map +1 -0
  149. package/dist/core/analyzer/cpp-header-resolver.js +71 -0
  150. package/dist/core/analyzer/cpp-header-resolver.js.map +1 -0
  151. package/dist/core/analyzer/dependency-graph.d.ts +230 -0
  152. package/dist/core/analyzer/dependency-graph.d.ts.map +1 -0
  153. package/dist/core/analyzer/dependency-graph.js +752 -0
  154. package/dist/core/analyzer/dependency-graph.js.map +1 -0
  155. package/dist/core/analyzer/duplicate-detector.d.ts +52 -0
  156. package/dist/core/analyzer/duplicate-detector.d.ts.map +1 -0
  157. package/dist/core/analyzer/duplicate-detector.js +289 -0
  158. package/dist/core/analyzer/duplicate-detector.js.map +1 -0
  159. package/dist/core/analyzer/embedding-service.d.ts +56 -0
  160. package/dist/core/analyzer/embedding-service.d.ts.map +1 -0
  161. package/dist/core/analyzer/embedding-service.js +118 -0
  162. package/dist/core/analyzer/embedding-service.js.map +1 -0
  163. package/dist/core/analyzer/env-extractor.d.ts +33 -0
  164. package/dist/core/analyzer/env-extractor.d.ts.map +1 -0
  165. package/dist/core/analyzer/env-extractor.js +196 -0
  166. package/dist/core/analyzer/env-extractor.js.map +1 -0
  167. package/dist/core/analyzer/external-packages.d.ts +20 -0
  168. package/dist/core/analyzer/external-packages.d.ts.map +1 -0
  169. package/dist/core/analyzer/external-packages.js +175 -0
  170. package/dist/core/analyzer/external-packages.js.map +1 -0
  171. package/dist/core/analyzer/file-walker.d.ts +78 -0
  172. package/dist/core/analyzer/file-walker.d.ts.map +1 -0
  173. package/dist/core/analyzer/file-walker.js +532 -0
  174. package/dist/core/analyzer/file-walker.js.map +1 -0
  175. package/dist/core/analyzer/function-registry-trie.d.ts +21 -0
  176. package/dist/core/analyzer/function-registry-trie.d.ts.map +1 -0
  177. package/dist/core/analyzer/function-registry-trie.js +39 -0
  178. package/dist/core/analyzer/function-registry-trie.js.map +1 -0
  179. package/dist/core/analyzer/http-route-parser.d.ts +152 -0
  180. package/dist/core/analyzer/http-route-parser.d.ts.map +1 -0
  181. package/dist/core/analyzer/http-route-parser.js +971 -0
  182. package/dist/core/analyzer/http-route-parser.js.map +1 -0
  183. package/dist/core/analyzer/import-parser.d.ts +100 -0
  184. package/dist/core/analyzer/import-parser.d.ts.map +1 -0
  185. package/dist/core/analyzer/import-parser.js +952 -0
  186. package/dist/core/analyzer/import-parser.js.map +1 -0
  187. package/dist/core/analyzer/import-resolver-bridge.d.ts +25 -0
  188. package/dist/core/analyzer/import-resolver-bridge.d.ts.map +1 -0
  189. package/dist/core/analyzer/import-resolver-bridge.js +99 -0
  190. package/dist/core/analyzer/import-resolver-bridge.js.map +1 -0
  191. package/dist/core/analyzer/index.d.ts +10 -0
  192. package/dist/core/analyzer/index.d.ts.map +1 -0
  193. package/dist/core/analyzer/index.js +10 -0
  194. package/dist/core/analyzer/index.js.map +1 -0
  195. package/dist/core/analyzer/middleware-extractor.d.ts +29 -0
  196. package/dist/core/analyzer/middleware-extractor.d.ts.map +1 -0
  197. package/dist/core/analyzer/middleware-extractor.js +195 -0
  198. package/dist/core/analyzer/middleware-extractor.js.map +1 -0
  199. package/dist/core/analyzer/refactor-analyzer.d.ts +83 -0
  200. package/dist/core/analyzer/refactor-analyzer.d.ts.map +1 -0
  201. package/dist/core/analyzer/refactor-analyzer.js +351 -0
  202. package/dist/core/analyzer/refactor-analyzer.js.map +1 -0
  203. package/dist/core/analyzer/repository-mapper.d.ts +150 -0
  204. package/dist/core/analyzer/repository-mapper.d.ts.map +1 -0
  205. package/dist/core/analyzer/repository-mapper.js +740 -0
  206. package/dist/core/analyzer/repository-mapper.js.map +1 -0
  207. package/dist/core/analyzer/schema-extractor.d.ts +41 -0
  208. package/dist/core/analyzer/schema-extractor.d.ts.map +1 -0
  209. package/dist/core/analyzer/schema-extractor.js +229 -0
  210. package/dist/core/analyzer/schema-extractor.js.map +1 -0
  211. package/dist/core/analyzer/signature-extractor.d.ts +31 -0
  212. package/dist/core/analyzer/signature-extractor.d.ts.map +1 -0
  213. package/dist/core/analyzer/signature-extractor.js +675 -0
  214. package/dist/core/analyzer/signature-extractor.js.map +1 -0
  215. package/dist/core/analyzer/significance-scorer.d.ts +79 -0
  216. package/dist/core/analyzer/significance-scorer.d.ts.map +1 -0
  217. package/dist/core/analyzer/significance-scorer.js +407 -0
  218. package/dist/core/analyzer/significance-scorer.js.map +1 -0
  219. package/dist/core/analyzer/spec-snapshot-generator.d.ts +17 -0
  220. package/dist/core/analyzer/spec-snapshot-generator.d.ts.map +1 -0
  221. package/dist/core/analyzer/spec-snapshot-generator.js +201 -0
  222. package/dist/core/analyzer/spec-snapshot-generator.js.map +1 -0
  223. package/dist/core/analyzer/spec-vector-index.d.ts +68 -0
  224. package/dist/core/analyzer/spec-vector-index.d.ts.map +1 -0
  225. package/dist/core/analyzer/spec-vector-index.js +340 -0
  226. package/dist/core/analyzer/spec-vector-index.js.map +1 -0
  227. package/dist/core/analyzer/subgraph-extractor.d.ts +51 -0
  228. package/dist/core/analyzer/subgraph-extractor.d.ts.map +1 -0
  229. package/dist/core/analyzer/subgraph-extractor.js +147 -0
  230. package/dist/core/analyzer/subgraph-extractor.js.map +1 -0
  231. package/dist/core/analyzer/type-inference-engine.d.ts +23 -0
  232. package/dist/core/analyzer/type-inference-engine.d.ts.map +1 -0
  233. package/dist/core/analyzer/type-inference-engine.js +130 -0
  234. package/dist/core/analyzer/type-inference-engine.js.map +1 -0
  235. package/dist/core/analyzer/ui-component-extractor.d.ts +43 -0
  236. package/dist/core/analyzer/ui-component-extractor.d.ts.map +1 -0
  237. package/dist/core/analyzer/ui-component-extractor.js +245 -0
  238. package/dist/core/analyzer/ui-component-extractor.js.map +1 -0
  239. package/dist/core/analyzer/unified-search.d.ts +116 -0
  240. package/dist/core/analyzer/unified-search.d.ts.map +1 -0
  241. package/dist/core/analyzer/unified-search.js +231 -0
  242. package/dist/core/analyzer/unified-search.js.map +1 -0
  243. package/dist/core/analyzer/vector-index.d.ts +92 -0
  244. package/dist/core/analyzer/vector-index.d.ts.map +1 -0
  245. package/dist/core/analyzer/vector-index.js +451 -0
  246. package/dist/core/analyzer/vector-index.js.map +1 -0
  247. package/dist/core/decisions/consolidator.d.ts +14 -0
  248. package/dist/core/decisions/consolidator.d.ts.map +1 -0
  249. package/dist/core/decisions/consolidator.js +169 -0
  250. package/dist/core/decisions/consolidator.js.map +1 -0
  251. package/dist/core/decisions/extractor.d.ts +26 -0
  252. package/dist/core/decisions/extractor.d.ts.map +1 -0
  253. package/dist/core/decisions/extractor.js +156 -0
  254. package/dist/core/decisions/extractor.js.map +1 -0
  255. package/dist/core/decisions/index.d.ts +19 -0
  256. package/dist/core/decisions/index.d.ts.map +1 -0
  257. package/dist/core/decisions/index.js +16 -0
  258. package/dist/core/decisions/index.js.map +1 -0
  259. package/dist/core/decisions/store.d.ts +36 -0
  260. package/dist/core/decisions/store.d.ts.map +1 -0
  261. package/dist/core/decisions/store.js +109 -0
  262. package/dist/core/decisions/store.js.map +1 -0
  263. package/dist/core/decisions/syncer.d.ts +27 -0
  264. package/dist/core/decisions/syncer.d.ts.map +1 -0
  265. package/dist/core/decisions/syncer.js +214 -0
  266. package/dist/core/decisions/syncer.js.map +1 -0
  267. package/dist/core/decisions/verifier.d.ts +20 -0
  268. package/dist/core/decisions/verifier.d.ts.map +1 -0
  269. package/dist/core/decisions/verifier.js +115 -0
  270. package/dist/core/decisions/verifier.js.map +1 -0
  271. package/dist/core/digest/digest-generator.d.ts +29 -0
  272. package/dist/core/digest/digest-generator.d.ts.map +1 -0
  273. package/dist/core/digest/digest-generator.js +181 -0
  274. package/dist/core/digest/digest-generator.js.map +1 -0
  275. package/dist/core/drift/drift-detector.d.ts +102 -0
  276. package/dist/core/drift/drift-detector.d.ts.map +1 -0
  277. package/dist/core/drift/drift-detector.js +598 -0
  278. package/dist/core/drift/drift-detector.js.map +1 -0
  279. package/dist/core/drift/git-diff.d.ts +60 -0
  280. package/dist/core/drift/git-diff.d.ts.map +1 -0
  281. package/dist/core/drift/git-diff.js +383 -0
  282. package/dist/core/drift/git-diff.js.map +1 -0
  283. package/dist/core/drift/index.d.ts +12 -0
  284. package/dist/core/drift/index.d.ts.map +1 -0
  285. package/dist/core/drift/index.js +9 -0
  286. package/dist/core/drift/index.js.map +1 -0
  287. package/dist/core/drift/spec-mapper.d.ts +73 -0
  288. package/dist/core/drift/spec-mapper.d.ts.map +1 -0
  289. package/dist/core/drift/spec-mapper.js +353 -0
  290. package/dist/core/drift/spec-mapper.js.map +1 -0
  291. package/dist/core/drift/test-suggester.d.ts +18 -0
  292. package/dist/core/drift/test-suggester.d.ts.map +1 -0
  293. package/dist/core/drift/test-suggester.js +107 -0
  294. package/dist/core/drift/test-suggester.js.map +1 -0
  295. package/dist/core/generator/adr-generator.d.ts +32 -0
  296. package/dist/core/generator/adr-generator.d.ts.map +1 -0
  297. package/dist/core/generator/adr-generator.js +192 -0
  298. package/dist/core/generator/adr-generator.js.map +1 -0
  299. package/dist/core/generator/index.d.ts +9 -0
  300. package/dist/core/generator/index.d.ts.map +1 -0
  301. package/dist/core/generator/index.js +12 -0
  302. package/dist/core/generator/index.js.map +1 -0
  303. package/dist/core/generator/mapping-generator.d.ts +54 -0
  304. package/dist/core/generator/mapping-generator.d.ts.map +1 -0
  305. package/dist/core/generator/mapping-generator.js +240 -0
  306. package/dist/core/generator/mapping-generator.js.map +1 -0
  307. package/dist/core/generator/openspec-compat.d.ts +160 -0
  308. package/dist/core/generator/openspec-compat.d.ts.map +1 -0
  309. package/dist/core/generator/openspec-compat.js +524 -0
  310. package/dist/core/generator/openspec-compat.js.map +1 -0
  311. package/dist/core/generator/openspec-format-generator.d.ts +131 -0
  312. package/dist/core/generator/openspec-format-generator.d.ts.map +1 -0
  313. package/dist/core/generator/openspec-format-generator.js +963 -0
  314. package/dist/core/generator/openspec-format-generator.js.map +1 -0
  315. package/dist/core/generator/openspec-writer.d.ts +130 -0
  316. package/dist/core/generator/openspec-writer.d.ts.map +1 -0
  317. package/dist/core/generator/openspec-writer.js +404 -0
  318. package/dist/core/generator/openspec-writer.js.map +1 -0
  319. package/dist/core/generator/prompts.d.ts +35 -0
  320. package/dist/core/generator/prompts.d.ts.map +1 -0
  321. package/dist/core/generator/prompts.js +212 -0
  322. package/dist/core/generator/prompts.js.map +1 -0
  323. package/dist/core/generator/rag-manifest-generator.d.ts +37 -0
  324. package/dist/core/generator/rag-manifest-generator.d.ts.map +1 -0
  325. package/dist/core/generator/rag-manifest-generator.js +134 -0
  326. package/dist/core/generator/rag-manifest-generator.js.map +1 -0
  327. package/dist/core/generator/schemas.d.ts +365 -0
  328. package/dist/core/generator/schemas.d.ts.map +1 -0
  329. package/dist/core/generator/schemas.js +190 -0
  330. package/dist/core/generator/schemas.js.map +1 -0
  331. package/dist/core/generator/spec-pipeline.d.ts +123 -0
  332. package/dist/core/generator/spec-pipeline.d.ts.map +1 -0
  333. package/dist/core/generator/spec-pipeline.js +699 -0
  334. package/dist/core/generator/spec-pipeline.js.map +1 -0
  335. package/dist/core/generator/stages/stage1-survey.d.ts +19 -0
  336. package/dist/core/generator/stages/stage1-survey.d.ts.map +1 -0
  337. package/dist/core/generator/stages/stage1-survey.js +171 -0
  338. package/dist/core/generator/stages/stage1-survey.js.map +1 -0
  339. package/dist/core/generator/stages/stage2-entities.d.ts +11 -0
  340. package/dist/core/generator/stages/stage2-entities.d.ts.map +1 -0
  341. package/dist/core/generator/stages/stage2-entities.js +74 -0
  342. package/dist/core/generator/stages/stage2-entities.js.map +1 -0
  343. package/dist/core/generator/stages/stage3-services.d.ts +11 -0
  344. package/dist/core/generator/stages/stage3-services.d.ts.map +1 -0
  345. package/dist/core/generator/stages/stage3-services.js +85 -0
  346. package/dist/core/generator/stages/stage3-services.js.map +1 -0
  347. package/dist/core/generator/stages/stage4-api.d.ts +11 -0
  348. package/dist/core/generator/stages/stage4-api.d.ts.map +1 -0
  349. package/dist/core/generator/stages/stage4-api.js +72 -0
  350. package/dist/core/generator/stages/stage4-api.js.map +1 -0
  351. package/dist/core/generator/stages/stage5-architecture.d.ts +11 -0
  352. package/dist/core/generator/stages/stage5-architecture.d.ts.map +1 -0
  353. package/dist/core/generator/stages/stage5-architecture.js +75 -0
  354. package/dist/core/generator/stages/stage5-architecture.js.map +1 -0
  355. package/dist/core/generator/stages/stage6-adr.d.ts +8 -0
  356. package/dist/core/generator/stages/stage6-adr.d.ts.map +1 -0
  357. package/dist/core/generator/stages/stage6-adr.js +47 -0
  358. package/dist/core/generator/stages/stage6-adr.js.map +1 -0
  359. package/dist/core/services/chat-agent.d.ts +50 -0
  360. package/dist/core/services/chat-agent.d.ts.map +1 -0
  361. package/dist/core/services/chat-agent.js +369 -0
  362. package/dist/core/services/chat-agent.js.map +1 -0
  363. package/dist/core/services/chat-tools.d.ts +32 -0
  364. package/dist/core/services/chat-tools.d.ts.map +1 -0
  365. package/dist/core/services/chat-tools.js +494 -0
  366. package/dist/core/services/chat-tools.js.map +1 -0
  367. package/dist/core/services/config-manager.d.ts +61 -0
  368. package/dist/core/services/config-manager.d.ts.map +1 -0
  369. package/dist/core/services/config-manager.js +149 -0
  370. package/dist/core/services/config-manager.js.map +1 -0
  371. package/dist/core/services/edge-store.d.ts +57 -0
  372. package/dist/core/services/edge-store.d.ts.map +1 -0
  373. package/dist/core/services/edge-store.js +419 -0
  374. package/dist/core/services/edge-store.js.map +1 -0
  375. package/dist/core/services/gitignore-manager.d.ts +29 -0
  376. package/dist/core/services/gitignore-manager.d.ts.map +1 -0
  377. package/dist/core/services/gitignore-manager.js +95 -0
  378. package/dist/core/services/gitignore-manager.js.map +1 -0
  379. package/dist/core/services/index.d.ts +8 -0
  380. package/dist/core/services/index.d.ts.map +1 -0
  381. package/dist/core/services/index.js +8 -0
  382. package/dist/core/services/index.js.map +1 -0
  383. package/dist/core/services/llm-service.d.ts +379 -0
  384. package/dist/core/services/llm-service.d.ts.map +1 -0
  385. package/dist/core/services/llm-service.js +1553 -0
  386. package/dist/core/services/llm-service.js.map +1 -0
  387. package/dist/core/services/mcp-handlers/analysis.d.ts +127 -0
  388. package/dist/core/services/mcp-handlers/analysis.d.ts.map +1 -0
  389. package/dist/core/services/mcp-handlers/analysis.js +1185 -0
  390. package/dist/core/services/mcp-handlers/analysis.js.map +1 -0
  391. package/dist/core/services/mcp-handlers/change.d.ts +14 -0
  392. package/dist/core/services/mcp-handlers/change.d.ts.map +1 -0
  393. package/dist/core/services/mcp-handlers/change.js +416 -0
  394. package/dist/core/services/mcp-handlers/change.js.map +1 -0
  395. package/dist/core/services/mcp-handlers/decisions.d.ts +16 -0
  396. package/dist/core/services/mcp-handlers/decisions.d.ts.map +1 -0
  397. package/dist/core/services/mcp-handlers/decisions.js +239 -0
  398. package/dist/core/services/mcp-handlers/decisions.js.map +1 -0
  399. package/dist/core/services/mcp-handlers/graph.d.ts +94 -0
  400. package/dist/core/services/mcp-handlers/graph.d.ts.map +1 -0
  401. package/dist/core/services/mcp-handlers/graph.js +693 -0
  402. package/dist/core/services/mcp-handlers/graph.js.map +1 -0
  403. package/dist/core/services/mcp-handlers/orient.d.ts +17 -0
  404. package/dist/core/services/mcp-handlers/orient.d.ts.map +1 -0
  405. package/dist/core/services/mcp-handlers/orient.js +357 -0
  406. package/dist/core/services/mcp-handlers/orient.js.map +1 -0
  407. package/dist/core/services/mcp-handlers/semantic.d.ts +66 -0
  408. package/dist/core/services/mcp-handlers/semantic.d.ts.map +1 -0
  409. package/dist/core/services/mcp-handlers/semantic.js +432 -0
  410. package/dist/core/services/mcp-handlers/semantic.js.map +1 -0
  411. package/dist/core/services/mcp-handlers/utils.d.ts +85 -0
  412. package/dist/core/services/mcp-handlers/utils.d.ts.map +1 -0
  413. package/dist/core/services/mcp-handlers/utils.js +262 -0
  414. package/dist/core/services/mcp-handlers/utils.js.map +1 -0
  415. package/dist/core/services/mcp-watcher.d.ts +41 -0
  416. package/dist/core/services/mcp-watcher.d.ts.map +1 -0
  417. package/dist/core/services/mcp-watcher.js +254 -0
  418. package/dist/core/services/mcp-watcher.js.map +1 -0
  419. package/dist/core/services/project-detector.d.ts +32 -0
  420. package/dist/core/services/project-detector.d.ts.map +1 -0
  421. package/dist/core/services/project-detector.js +100 -0
  422. package/dist/core/services/project-detector.js.map +1 -0
  423. package/dist/core/test-generator/coverage-analyzer.d.ts +27 -0
  424. package/dist/core/test-generator/coverage-analyzer.d.ts.map +1 -0
  425. package/dist/core/test-generator/coverage-analyzer.js +285 -0
  426. package/dist/core/test-generator/coverage-analyzer.js.map +1 -0
  427. package/dist/core/test-generator/framework-detector.d.ts +17 -0
  428. package/dist/core/test-generator/framework-detector.d.ts.map +1 -0
  429. package/dist/core/test-generator/framework-detector.js +65 -0
  430. package/dist/core/test-generator/framework-detector.js.map +1 -0
  431. package/dist/core/test-generator/index.d.ts +14 -0
  432. package/dist/core/test-generator/index.d.ts.map +1 -0
  433. package/dist/core/test-generator/index.js +11 -0
  434. package/dist/core/test-generator/index.js.map +1 -0
  435. package/dist/core/test-generator/renderers/catch2.d.ts +8 -0
  436. package/dist/core/test-generator/renderers/catch2.d.ts.map +1 -0
  437. package/dist/core/test-generator/renderers/catch2.js +47 -0
  438. package/dist/core/test-generator/renderers/catch2.js.map +1 -0
  439. package/dist/core/test-generator/renderers/gtest.d.ts +8 -0
  440. package/dist/core/test-generator/renderers/gtest.d.ts.map +1 -0
  441. package/dist/core/test-generator/renderers/gtest.js +45 -0
  442. package/dist/core/test-generator/renderers/gtest.js.map +1 -0
  443. package/dist/core/test-generator/renderers/index.d.ts +20 -0
  444. package/dist/core/test-generator/renderers/index.d.ts.map +1 -0
  445. package/dist/core/test-generator/renderers/index.js +35 -0
  446. package/dist/core/test-generator/renderers/index.js.map +1 -0
  447. package/dist/core/test-generator/renderers/playwright.d.ts +8 -0
  448. package/dist/core/test-generator/renderers/playwright.d.ts.map +1 -0
  449. package/dist/core/test-generator/renderers/playwright.js +44 -0
  450. package/dist/core/test-generator/renderers/playwright.js.map +1 -0
  451. package/dist/core/test-generator/renderers/pytest.d.ts +8 -0
  452. package/dist/core/test-generator/renderers/pytest.d.ts.map +1 -0
  453. package/dist/core/test-generator/renderers/pytest.js +44 -0
  454. package/dist/core/test-generator/renderers/pytest.js.map +1 -0
  455. package/dist/core/test-generator/renderers/shared.d.ts +21 -0
  456. package/dist/core/test-generator/renderers/shared.d.ts.map +1 -0
  457. package/dist/core/test-generator/renderers/shared.js +56 -0
  458. package/dist/core/test-generator/renderers/shared.js.map +1 -0
  459. package/dist/core/test-generator/renderers/vitest.d.ts +8 -0
  460. package/dist/core/test-generator/renderers/vitest.d.ts.map +1 -0
  461. package/dist/core/test-generator/renderers/vitest.js +52 -0
  462. package/dist/core/test-generator/renderers/vitest.js.map +1 -0
  463. package/dist/core/test-generator/scenario-parser.d.ts +33 -0
  464. package/dist/core/test-generator/scenario-parser.d.ts.map +1 -0
  465. package/dist/core/test-generator/scenario-parser.js +244 -0
  466. package/dist/core/test-generator/scenario-parser.js.map +1 -0
  467. package/dist/core/test-generator/test-generator.d.ts +30 -0
  468. package/dist/core/test-generator/test-generator.d.ts.map +1 -0
  469. package/dist/core/test-generator/test-generator.js +174 -0
  470. package/dist/core/test-generator/test-generator.js.map +1 -0
  471. package/dist/core/test-generator/test-writer.d.ts +25 -0
  472. package/dist/core/test-generator/test-writer.d.ts.map +1 -0
  473. package/dist/core/test-generator/test-writer.js +128 -0
  474. package/dist/core/test-generator/test-writer.js.map +1 -0
  475. package/dist/core/test-generator/then-matchers.d.ts +35 -0
  476. package/dist/core/test-generator/then-matchers.d.ts.map +1 -0
  477. package/dist/core/test-generator/then-matchers.js +211 -0
  478. package/dist/core/test-generator/then-matchers.js.map +1 -0
  479. package/dist/core/verifier/index.d.ts +5 -0
  480. package/dist/core/verifier/index.d.ts.map +1 -0
  481. package/dist/core/verifier/index.js +5 -0
  482. package/dist/core/verifier/index.js.map +1 -0
  483. package/dist/core/verifier/verification-engine.d.ts +293 -0
  484. package/dist/core/verifier/verification-engine.d.ts.map +1 -0
  485. package/dist/core/verifier/verification-engine.js +919 -0
  486. package/dist/core/verifier/verification-engine.js.map +1 -0
  487. package/dist/types/index.d.ts +368 -0
  488. package/dist/types/index.d.ts.map +1 -0
  489. package/dist/types/index.js +5 -0
  490. package/dist/types/index.js.map +1 -0
  491. package/dist/types/pipeline.d.ts +167 -0
  492. package/dist/types/pipeline.d.ts.map +1 -0
  493. package/dist/types/pipeline.js +5 -0
  494. package/dist/types/pipeline.js.map +1 -0
  495. package/dist/types/test-generator.d.ts +103 -0
  496. package/dist/types/test-generator.d.ts.map +1 -0
  497. package/dist/types/test-generator.js +17 -0
  498. package/dist/types/test-generator.js.map +1 -0
  499. package/dist/utils/command-helpers.d.ts +68 -0
  500. package/dist/utils/command-helpers.d.ts.map +1 -0
  501. package/dist/utils/command-helpers.js +150 -0
  502. package/dist/utils/command-helpers.js.map +1 -0
  503. package/dist/utils/errors.d.ts +51 -0
  504. package/dist/utils/errors.d.ts.map +1 -0
  505. package/dist/utils/errors.js +129 -0
  506. package/dist/utils/errors.js.map +1 -0
  507. package/dist/utils/logger.d.ts +149 -0
  508. package/dist/utils/logger.d.ts.map +1 -0
  509. package/dist/utils/logger.js +342 -0
  510. package/dist/utils/logger.js.map +1 -0
  511. package/dist/utils/misc.d.ts +10 -0
  512. package/dist/utils/misc.d.ts.map +1 -0
  513. package/dist/utils/misc.js +21 -0
  514. package/dist/utils/misc.js.map +1 -0
  515. package/dist/utils/progress.d.ts +142 -0
  516. package/dist/utils/progress.d.ts.map +1 -0
  517. package/dist/utils/progress.js +283 -0
  518. package/dist/utils/progress.js.map +1 -0
  519. package/dist/utils/prompts.d.ts +53 -0
  520. package/dist/utils/prompts.d.ts.map +1 -0
  521. package/dist/utils/prompts.js +199 -0
  522. package/dist/utils/prompts.js.map +1 -0
  523. package/dist/utils/shutdown.d.ts +89 -0
  524. package/dist/utils/shutdown.d.ts.map +1 -0
  525. package/dist/utils/shutdown.js +238 -0
  526. package/dist/utils/shutdown.js.map +1 -0
  527. package/examples/bmad/README.md +113 -0
  528. package/examples/bmad/agents/architect.md +226 -0
  529. package/examples/bmad/agents/dev-brownfield.md +69 -0
  530. package/examples/bmad/setup/architect.customize.yaml +14 -0
  531. package/examples/bmad/tasks/implement-story.md +254 -0
  532. package/examples/bmad/tasks/onboarding.md +169 -0
  533. package/examples/bmad/tasks/refactor.md +178 -0
  534. package/examples/bmad/tasks/sprint-planning.md +168 -0
  535. package/examples/bmad/templates/story.md +108 -0
  536. package/examples/cline-workflows/openlore-analyze-codebase.md +101 -0
  537. package/examples/cline-workflows/openlore-check-spec-drift.md +102 -0
  538. package/examples/cline-workflows/openlore-execute-refactor.md +212 -0
  539. package/examples/cline-workflows/openlore-implement-feature.md +266 -0
  540. package/examples/cline-workflows/openlore-plan-refactor.md +279 -0
  541. package/examples/cline-workflows/openlore-refactor-codebase.md +16 -0
  542. package/examples/cline-workflows/openlore-write-tests.md +177 -0
  543. package/examples/drift-demo/openspec/config.yaml +14 -0
  544. package/examples/drift-demo/openspec/specs/architecture/spec.md +30 -0
  545. package/examples/drift-demo/openspec/specs/auth/spec.md +71 -0
  546. package/examples/drift-demo/openspec/specs/database/spec.md +33 -0
  547. package/examples/drift-demo/openspec/specs/overview/spec.md +20 -0
  548. package/examples/drift-demo/openspec/specs/projects/spec.md +55 -0
  549. package/examples/drift-demo/openspec/specs/tasks/spec.md +78 -0
  550. package/examples/drift-demo/package.json +21 -0
  551. package/examples/drift-demo/src/auth/auth-middleware.ts +30 -0
  552. package/examples/drift-demo/src/auth/auth-routes.ts +29 -0
  553. package/examples/drift-demo/src/auth/auth-service.ts +45 -0
  554. package/examples/drift-demo/src/database/connection.ts +27 -0
  555. package/examples/drift-demo/src/index.ts +16 -0
  556. package/examples/drift-demo/src/projects/project-model.ts +15 -0
  557. package/examples/drift-demo/src/projects/project-service.ts +34 -0
  558. package/examples/drift-demo/src/tasks/task-model.ts +37 -0
  559. package/examples/drift-demo/src/tasks/task-routes.ts +53 -0
  560. package/examples/drift-demo/src/tasks/task-service.ts +60 -0
  561. package/examples/drift-demo/src/utils/validation.ts +11 -0
  562. package/examples/drift-demo/tests/auth.test.ts +4 -0
  563. package/examples/drift-demo/tests/tasks.test.ts +4 -0
  564. package/examples/drift-demo/tsconfig.json +10 -0
  565. package/examples/drift-test/run-drift-test.sh +1087 -0
  566. package/examples/gsd/README.md +119 -0
  567. package/examples/gsd/commands/gsd/openlore-drift.md +111 -0
  568. package/examples/gsd/commands/gsd/openlore-orient.md +191 -0
  569. package/examples/mistral-vibe/README.md +101 -0
  570. package/examples/mistral-vibe/antipatterns-template.md +18 -0
  571. package/examples/mistral-vibe/skills/openlore-analyze-codebase/SKILL.md +124 -0
  572. package/examples/mistral-vibe/skills/openlore-brainstorm/SKILL.md +379 -0
  573. package/examples/mistral-vibe/skills/openlore-debug/SKILL.md +330 -0
  574. package/examples/mistral-vibe/skills/openlore-execute-refactor/SKILL.md +291 -0
  575. package/examples/mistral-vibe/skills/openlore-generate/SKILL.md +245 -0
  576. package/examples/mistral-vibe/skills/openlore-implement-story/SKILL.md +326 -0
  577. package/examples/mistral-vibe/skills/openlore-plan-refactor/SKILL.md +365 -0
  578. package/examples/mistral-vibe/skills/openlore-review-changes/SKILL.md +128 -0
  579. package/examples/mistral-vibe/skills/openlore-write-tests/SKILL.md +261 -0
  580. package/examples/opencode/agent-guard.ts +170 -0
  581. package/examples/opencode/plugins/anti-laziness.ts +202 -0
  582. package/examples/opencode/plugins/lib/openlore-context-injector-helpers.ts +116 -0
  583. package/examples/opencode/plugins/lib/openlore-decision-extractor-helpers.ts +65 -0
  584. package/examples/opencode/plugins/openlore-context-injector.test.ts +211 -0
  585. package/examples/opencode/plugins/openlore-context-injector.ts +165 -0
  586. package/examples/opencode/plugins/openlore-decision-extractor.test.ts +131 -0
  587. package/examples/opencode/plugins/openlore-decision-extractor.ts +322 -0
  588. package/examples/opencode/plugins/openlore-enforcer.ts +227 -0
  589. package/examples/opencode/prompts/sisyphus-sdd.md +150 -0
  590. package/examples/opencode-skills/openlore-analyze-codebase/SKILL.md +101 -0
  591. package/examples/opencode-skills/openlore-brainstorm/SKILL.md +354 -0
  592. package/examples/opencode-skills/openlore-debug/SKILL.md +291 -0
  593. package/examples/opencode-skills/openlore-execute-refactor/SKILL.md +241 -0
  594. package/examples/opencode-skills/openlore-generate/SKILL.md +236 -0
  595. package/examples/opencode-skills/openlore-implement-story/SKILL.md +251 -0
  596. package/examples/opencode-skills/openlore-plan-refactor/SKILL.md +298 -0
  597. package/examples/opencode-skills/openlore-review-changes/SKILL.md +134 -0
  598. package/examples/opencode-skills/openlore-write-tests/SKILL.md +230 -0
  599. package/examples/openspec-analysis/README.md +59 -0
  600. package/examples/openspec-analysis/SUMMARY.md +72 -0
  601. package/examples/openspec-analysis/config.json +16 -0
  602. package/examples/openspec-analysis/dependencies.mermaid +35 -0
  603. package/examples/openspec-analysis/dependency-graph.json +12116 -0
  604. package/examples/openspec-analysis/llm-context.json +119 -0
  605. package/examples/openspec-analysis/repo-structure.json +871 -0
  606. package/examples/openspec-cli/README.md +67 -0
  607. package/examples/openspec-cli/openspec/config.yaml +26 -0
  608. package/examples/openspec-cli/openspec/specs/architecture/spec.md +178 -0
  609. package/examples/openspec-cli/openspec/specs/artifact-graph/spec.md +143 -0
  610. package/examples/openspec-cli/openspec/specs/cli/spec.md +138 -0
  611. package/examples/openspec-cli/openspec/specs/overview/spec.md +60 -0
  612. package/examples/openspec-cli/openspec/specs/parsing/spec.md +123 -0
  613. package/examples/openspec-cli/openspec/specs/validation/spec.md +108 -0
  614. package/examples/spec-kit/README.md +104 -0
  615. package/examples/spec-kit/commands/drift.md +87 -0
  616. package/examples/spec-kit/commands/orient.md +138 -0
  617. package/examples/spec-kit/extension.yml +54 -0
  618. package/package.json +125 -0
  619. package/src/viewer/InteractiveGraphViewer.jsx +1600 -0
  620. package/src/viewer/app/index.html +17 -0
  621. package/src/viewer/app/main.jsx +13 -0
  622. package/src/viewer/components/ArchitectureView.jsx +177 -0
  623. package/src/viewer/components/ChatPanel.jsx +450 -0
  624. package/src/viewer/components/ClassGraph.jsx +782 -0
  625. package/src/viewer/components/ClusterGraph.jsx +469 -0
  626. package/src/viewer/components/FilterBar.jsx +179 -0
  627. package/src/viewer/components/FlatGraph.jsx +282 -0
  628. package/src/viewer/components/MicroComponents.jsx +85 -0
  629. package/src/viewer/hooks/usePanZoom.js +79 -0
  630. package/src/viewer/utils/constants.js +64 -0
  631. package/src/viewer/utils/graph-helpers.js +303 -0
  632. package/src/viewer/utils/graph-helpers.test.ts +39 -0
  633. package/src/viewer/utils/themes.js +206 -0
  634. package/stubs/tree-sitter-cli-stub/package.json +6 -0
@@ -0,0 +1,168 @@
1
+ # Task: Sprint Planning
2
+
3
+ **Purpose**: Validate a sprint candidate before committing to it.
4
+ Detects conflicts, blocked stories, and ordering constraints using structural analysis.
5
+
6
+ **Who runs this**: Scrum Master Agent or Architect Agent, during sprint planning.
7
+ **When**: Before the sprint is locked — after stories are written, before they're assigned.
8
+
9
+ **Output**: sprint risk report + recommended story order + blocking issues list.
10
+
11
+ ---
12
+
13
+ ## Prerequisites
14
+
15
+ - Onboarding completed (`bmad/tasks/onboarding.md`)
16
+ - All sprint candidate stories have a `risk_context` section
17
+ - If `risk_context` is missing on any story, run `annotate_story` on it first (not manually)
18
+
19
+ ---
20
+
21
+ ## Step 1 — Refresh the structural analysis
22
+
23
+ If the last `analyze_codebase` run was more than 24 hours ago, or if code changed since then:
24
+
25
+ ```xml
26
+ <use_mcp_tool>
27
+ <server_name>openlore</server_name>
28
+ <tool_name>analyze_codebase</tool_name>
29
+ <arguments>{"directory": "$PROJECT_ROOT", "force": false}</arguments>
30
+ </use_mcp_tool>
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Step 2 — Collect risk data per story
36
+
37
+ For each story in the sprint candidate list:
38
+
39
+ **If `risk_context` is already populated** (normal case — architect did their job):
40
+ Read it directly from the story file. No MCP call needed.
41
+
42
+ **If `risk_context` is absent**, run `annotate_story` now:
43
+
44
+ ```xml
45
+ <use_mcp_tool>
46
+ <server_name>openlore</server_name>
47
+ <tool_name>annotate_story</tool_name>
48
+ <arguments>{
49
+ "directory": "$PROJECT_ROOT",
50
+ "storyFilePath": "$STORY_FILE_PATH",
51
+ "description": "$STORY_TITLE — $PRIMARY_AC"
52
+ }</arguments>
53
+ </use_mcp_tool>
54
+ ```
55
+
56
+ Collect from each story's `risk_context`:
57
+ - `Domains` → which spec domains are touched
58
+ - `Max risk score` + level
59
+ - `Blocking refactors` → any listed
60
+ - `Functions in scope` → for conflict detection
61
+
62
+ **Also verify story quality:**
63
+ - `## Won't Do` section must be present with at least 1 item
64
+ - Every AC must be testable (specific observable outcome, not a vague quality)
65
+
66
+ Flag non-compliant stories:
67
+ > "⚠️ Story S-NN is missing `## Won't Do` / has vague ACs — return to author before sprint lock."
68
+
69
+ ---
70
+
71
+ ## Step 3 — Build the sprint risk matrix
72
+
73
+ | Story | Domains | Risk | Blocking Refactors | Status |
74
+ |---|---|---|---|---|
75
+ | S-01 Add retry | payment | 🔴 82 | `processPayment` | ⛔ blocked |
76
+ | S-02 Email validation | auth | 🟢 18 | none | ✅ ready |
77
+ | S-03 Rate limiting | api | 🟡 45 | none | ⚠️ caution |
78
+
79
+ **Status rules:**
80
+ - ⛔ **blocked**: max risk ≥ 70 and no refactor story scheduled before it
81
+ - ⚠️ **caution**: max risk 40–69, or story touches a critical hub
82
+ - ✅ **ready**: max risk < 40 and no hub involvement
83
+
84
+ ---
85
+
86
+ ## Step 4 — Detect function conflicts
87
+
88
+ Find stories whose `functions in scope` overlap.
89
+
90
+ Get the full hub list to cross-reference:
91
+
92
+ ```xml
93
+ <use_mcp_tool>
94
+ <server_name>openlore</server_name>
95
+ <tool_name>get_critical_hubs</tool_name>
96
+ <arguments>{"directory": "$PROJECT_ROOT", "limit": 15}</arguments>
97
+ </use_mcp_tool>
98
+ ```
99
+
100
+ For each hub that appears in two or more stories' function scope:
101
+
102
+ > "⚠️ Stories S-01 and S-04 both touch `processPayment` (fan-in: 12).
103
+ > Parallel risk: merge conflicts and silent regressions.
104
+ > Recommend: sequence them, or assign to the same developer."
105
+
106
+ ---
107
+
108
+ ## Step 5 — Check spec coverage gaps
109
+
110
+ ```xml
111
+ <use_mcp_tool>
112
+ <server_name>openlore</server_name>
113
+ <tool_name>check_spec_drift</tool_name>
114
+ <arguments>{"directory": "$PROJECT_ROOT"}</arguments>
115
+ </use_mcp_tool>
116
+ ```
117
+
118
+ For any `uncovered` files already present:
119
+ > "Stories touching these files cannot use `check_spec_drift` as a completion gate.
120
+ > Add a `openlore generate` task to the sprint."
121
+
122
+ ---
123
+
124
+ ## Step 6 — Determine story ordering
125
+
126
+ **Rules:**
127
+ 1. Refactor stories before the stories they unblock
128
+ 2. Stories touching the same hub: sequence, do not parallelise
129
+ 3. Low-risk stories can be parallelised freely
130
+ 4. `openlore generate` after any story that adds new source files
131
+
132
+ ---
133
+
134
+ ## Step 7 — Sprint readiness verdict
135
+
136
+ | Criterion | Status |
137
+ |---|---|
138
+ | No ⛔ stories without prior refactor scheduled | ✅ / ⛔ |
139
+ | No parallel stories on the same hub | ✅ / ⚠️ |
140
+ | All stories have `risk_context` | ✅ / ⛔ |
141
+ | All stories have `## Won't Do` and testable ACs | ✅ / ⚠️ |
142
+ | Spec coverage adequate for drift detection | ✅ / ⚠️ |
143
+
144
+ **If any ⛔ remain: do not lock the sprint.** Resolve blockers first.
145
+
146
+ ---
147
+
148
+ ## Output
149
+
150
+ Write the sprint plan to `.openlore/sprints/sprint-{N}.md`:
151
+
152
+ ```markdown
153
+ # Sprint {N} — Risk Report
154
+
155
+ Generated: {date}
156
+
157
+ ## Risk Matrix
158
+ {table from Step 3}
159
+
160
+ ## Conflicts
161
+ {list from Step 4}
162
+
163
+ ## Recommended Order
164
+ {from Step 6}
165
+
166
+ ## Readiness
167
+ {verdict from Step 7}
168
+ ```
@@ -0,0 +1,108 @@
1
+ # Story {ID}: {Title}
2
+
3
+ **Type**: feature | technical-debt | bug | spike
4
+ **Epic**: {epic name}
5
+ **Status**: Draft | Ready | In Progress | Review | Done
6
+
7
+ ---
8
+
9
+ ## User Story
10
+
11
+ As a **{role}**,
12
+ I want **{capability}**,
13
+ so that **{benefit}**.
14
+
15
+ ---
16
+
17
+ ## Acceptance Criteria
18
+
19
+ > Each criterion must be testable: describe a specific observable outcome, not a vague quality.
20
+ > ✗ "The UX should be responsive" — not a criterion
21
+ > ✓ "Submitting the form with an empty email field shows a validation error" — testable
22
+
23
+ - [ ] AC1: {criterion}
24
+ - [ ] AC2: {criterion}
25
+ - [ ] AC3: {criterion}
26
+
27
+ ---
28
+
29
+ ## Won't Do
30
+
31
+ > What this story explicitly does NOT cover. Minimum 1 item.
32
+ > Prevents scope creep and removes ambiguity for the Dev Agent.
33
+
34
+ - {out-of-scope item}
35
+
36
+ ---
37
+
38
+ ## Risk Context
39
+
40
+ > Pre-filled by the Architect Agent using openlore.
41
+ > Dev Agent reads this — does NOT rediscover it at implementation time.
42
+
43
+ - **Domains in scope**: {e.g. auth, api}
44
+ - **Max risk score**: {0–100} {🟢 low | 🟡 medium | 🟠 high | 🔴 critical}
45
+ - **Functions in scope**: {function1 (file), function2 (file)}
46
+ - **Blocking refactors**: {none | "Refactor X first — Story {ID}"}
47
+ - **Parallel risk**: {none | "Conflicts with Story {ID} on function X"}
48
+ - **Insertion points**: {function (strategy, score)}
49
+ - **Spec domains linked**: {domain1/spec.md, domain2/spec.md}
50
+
51
+ ### Structural Notes
52
+
53
+ {Any architectural constraints, patterns to follow, anti-patterns to avoid.
54
+ Filled by Architect Agent based on get_architecture_overview output.}
55
+
56
+ ---
57
+
58
+ ## Technical Constraints
59
+
60
+ - {constraint 1}
61
+ - {constraint 2}
62
+
63
+ ---
64
+
65
+ ## Tasks
66
+
67
+ > Filled by Dev Agent during implementation.
68
+
69
+ - [ ] {task 1}
70
+ - [ ] {task 2}
71
+ - [ ] Add/update tests
72
+ - [ ] Run `check_spec_drift` — confirm clean
73
+
74
+ ---
75
+
76
+ ## Dev Agent Record
77
+
78
+ > Filled by Dev Agent on completion.
79
+
80
+ ### Implementation Summary
81
+
82
+ - **Insertion point used**: {function} in {file}
83
+ - **Files changed**: {list}
84
+ - **Tests added**: {N}
85
+ - **Spec drift**: ✅ clean | ⚠️ {details}
86
+
87
+ ### Risk Notes
88
+
89
+ | Function | Actual Risk Score | Delta vs Estimate |
90
+ |---|---|---|
91
+ | | | |
92
+
93
+ ### Scope Notes
94
+
95
+ {Were any functions touched outside the planned scope? Why?}
96
+
97
+ ---
98
+
99
+ ## Dependencies
100
+
101
+ - **Blocked by**: {Story ID — reason} | none
102
+ - **Blocks**: {Story ID} | none
103
+
104
+ ---
105
+
106
+ ## Story Points
107
+
108
+ {estimate} — basis: {risk level, insertion complexity, test surface}
@@ -0,0 +1,101 @@
1
+ # openlore: Analyze Codebase
2
+
3
+ Run a full static analysis of a project using openlore and summarise the results:
4
+ architecture, call graph, top refactoring issues, and duplicate code — no LLM required.
5
+
6
+ ## Step 1: Get the project directory
7
+
8
+ Ask the user which project to analyse, or confirm we should use the current workspace root.
9
+
10
+ <ask_followup_question>
11
+ <question>Which project directory should I analyse?</question>
12
+ <options>["Current workspace root", "Enter a different path"]</options>
13
+ </ask_followup_question>
14
+
15
+ ## Step 2: Run static analysis
16
+
17
+ Call analyze_codebase on the chosen directory.
18
+
19
+ <use_mcp_tool>
20
+ <server_name>openlore</server_name>
21
+ <tool_name>analyze_codebase</tool_name>
22
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
23
+ </use_mcp_tool>
24
+
25
+ ## Step 3: Get the architecture overview
26
+
27
+ Retrieve the high-level architecture map: clusters, cross-cluster dependencies,
28
+ entry points, and critical hub functions. This is the fastest way to orient
29
+ yourself before diving into details.
30
+
31
+ <use_mcp_tool>
32
+ <server_name>openlore</server_name>
33
+ <tool_name>get_architecture_overview</tool_name>
34
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
35
+ </use_mcp_tool>
36
+
37
+ Present a concise summary:
38
+ - Total files, clusters, edges, cycles, and layer violations
39
+ - Top 3 clusters sorted by file count, with their role (entry_layer / orchestrator /
40
+ hub_heavy / internal) and which clusters they depend on
41
+ - Global entry points (the public-facing roots of the codebase)
42
+ - Critical hub functions (high fan-in — touch with care)
43
+
44
+ ## Step 4: Summarise the refactor report
45
+
46
+ Present a concise summary:
47
+ - Project type and detected frameworks
48
+ - File count, function count, internal call count
49
+ - Top 5 refactoring issues (function name, file, issue type, priority score)
50
+ - Detected domains
51
+
52
+ ## Step 5: Show the call graph
53
+
54
+ Retrieve hub functions, entry points, and any layer violations.
55
+
56
+ <use_mcp_tool>
57
+ <server_name>openlore</server_name>
58
+ <tool_name>get_call_graph</tool_name>
59
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
60
+ </use_mcp_tool>
61
+
62
+ Highlight any hub functions (fanIn ≥ 8) or layer violations detected.
63
+
64
+ ## Step 6: Show duplicate code report
65
+
66
+ Retrieve the duplicate function analysis (Types 1–3, pure static analysis).
67
+
68
+ <use_mcp_tool>
69
+ <server_name>openlore</server_name>
70
+ <tool_name>get_duplicate_report</tool_name>
71
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
72
+ </use_mcp_tool>
73
+
74
+ Present a concise summary:
75
+ - Overall duplication ratio (e.g. "12% of functions are duplicated")
76
+ - Top 3 clone groups sorted by impact (instances × line count):
77
+ - Clone type (exact / structural / near) and similarity score
78
+ - List of instances (file + function name + line range)
79
+ - If no duplicates found, note this as a positive signal
80
+
81
+ ## Step 7: Suggest next steps
82
+
83
+ Based on the analysis, guide the user through the natural next steps in order:
84
+ 1. Call `get_minimal_context` on the highest-priority function — returns callers, callees, body, and test coverage in one call (~300 tokens). Use instead of `get_subgraph` + `get_signatures` separately.
85
+ 2. Call `get_cluster` on any function to see its full community (tightly coupled neighbors across directories).
86
+ 3. Call `detect_changes` to rank recently changed functions by blast radius — spot riskiest commits before reviewing.
87
+ 3. Call `suggest_insertion_points` with a brief feature description to find where new
88
+ logic should land — useful before starting any new work on this codebase
89
+ 4. If significant duplication was found, suggest consolidating clone groups before refactoring
90
+ 5. Suggest running `/openlore-plan-refactor` once the user has enough context to act,
91
+ then `/openlore-execute-refactor` to apply the plan
92
+ 6. If the project has OpenSpec specs:
93
+ - Call `list_spec_domains` to discover available spec domains
94
+ - Call `search_specs` to find requirements by intent — this enables spec-first reasoning
95
+ (question → requirements → linked source files) rather than code-first exploration
96
+ - Suggest `/openlore-implement-feature` for any new feature work
97
+ (integrates specs + insertion points + adversarial self-check + drift check)
98
+ - To enable `search_specs`, run `openlore analyze --embed` or `openlore analyze --reindex-specs`
99
+ (requires the embedding server)
100
+ 7. If `.claude/antipatterns.md` exists, mention that it is checked automatically
101
+ by `/openlore-implement-feature` during the adversarial self-check step
@@ -0,0 +1,102 @@
1
+ # openlore: Check Spec Drift
2
+
3
+ Detect code changes that are not reflected in the project's OpenSpec specifications.
4
+ Runs in static mode — no LLM required, no quota consumed.
5
+
6
+ **Prerequisites**: `openlore init` and `openlore generate` must have been run at least once
7
+ in the target project.
8
+
9
+ ## Step 1: Get the project directory
10
+
11
+ Ask the user which project to check, or confirm the current workspace root.
12
+
13
+ <ask_followup_question>
14
+ <question>Which project directory should I check for spec drift?</question>
15
+ <options>["Current workspace root", "Enter a different path"]</options>
16
+ </ask_followup_question>
17
+
18
+ ## Step 2: Run drift detection
19
+
20
+ <use_mcp_tool>
21
+ <server_name>openlore</server_name>
22
+ <tool_name>check_spec_drift</tool_name>
23
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
24
+ </use_mcp_tool>
25
+
26
+ If the result contains `{ "error": "..." }`, stop and tell the user what is missing
27
+ (not a git repo / no config / no specs) with the exact remediation command to run.
28
+
29
+ ## Step 3: Present the results
30
+
31
+ ### No drift
32
+
33
+ If `hasDrift` is false and `issues` is empty:
34
+
35
+ > ✅ **No spec drift detected.** All changed files are covered by up-to-date specs.
36
+
37
+ Show `baseRef` and `totalChangedFiles` for context.
38
+
39
+ ### Drift found
40
+
41
+ Present a summary line first:
42
+
43
+ ```
44
+ Drift detected on $totalChangedFiles changed file(s) vs $baseRef
45
+ Gaps: $gaps · Stale: $stale · Uncovered: $uncovered · Orphaned: $orphanedSpecs
46
+ ```
47
+
48
+ Then a table of issues, sorted by severity (error first):
49
+
50
+ | Severity | Kind | File | Domain | Spec | Lines changed |
51
+ |---|---|---|---|---|---|
52
+ | ⛔ error | gap | src/auth/login.ts | auth | specs/auth/spec.md | +45/-12 |
53
+ | ⚠️ warning | uncovered | src/billing/invoice.ts | — | — | +120/-0 |
54
+
55
+ For each issue, show the `suggestion` field on the next line in italic.
56
+
57
+ ## Step 4: Recommend actions
58
+
59
+ Based on the issue kinds found, guide the user:
60
+
61
+ ### gap (spec exists but is outdated)
62
+ > The spec for **$domain** covers `$filePath` but wasn't updated when the code changed.
63
+ > Run `openlore generate --domains $domain` to regenerate it, or edit the spec manually
64
+ > if the change is minor.
65
+
66
+ ### stale (spec references deleted/moved code)
67
+ > The **$domain** spec references code that no longer exists. Either the file was deleted
68
+ > or its structure changed significantly. Run `openlore generate --domains $domain` to
69
+ > rebuild the spec from the current state of the code.
70
+
71
+ ### uncovered (new file with no spec)
72
+ > `$filePath` has no matching spec. If this file introduces new domain logic, run
73
+ > `openlore generate` so that openlore can infer a spec from it. If it is a utility
74
+ > or test helper, it may not need a spec.
75
+
76
+ ### orphaned-spec (spec references non-existent files)
77
+ > A spec references files that no longer exist. The spec may need to be deleted or its
78
+ > `source-files` header updated. Review the spec at `$specPath` manually.
79
+
80
+ ## Step 5: Offer to drill down
81
+
82
+ If there are `gap` or `stale` issues, offer to show the signatures of the affected files
83
+ so the user can see exactly what changed in the public API:
84
+
85
+ <use_mcp_tool>
86
+ <server_name>openlore</server_name>
87
+ <tool_name>get_signatures</tool_name>
88
+ <arguments>{"directory": "$DIRECTORY", "filePattern": "$AFFECTED_FILE"}</arguments>
89
+ </use_mcp_tool>
90
+
91
+ ## Step 6: Suggest next steps
92
+
93
+ Present the following options and let the user choose:
94
+
95
+ 1. **Regenerate specs for affected domains** — run `openlore generate --domains <list>`
96
+ (fastest fix for `gap` and `stale` issues)
97
+ 2. **Review and edit specs manually** — appropriate for minor changes where the
98
+ existing spec is mostly correct
99
+ 3. **Install the pre-commit hook** — run `openlore drift --install-hook` so drift is
100
+ caught automatically before every commit
101
+ 4. **Run `/openlore-plan-refactor` then `/openlore-execute-refactor`** — if the drift
102
+ reveals structural issues in the changed files
@@ -0,0 +1,212 @@
1
+ # openlore: Execute Refactor
2
+
3
+ Apply the refactoring plan produced by `/openlore-plan-refactor`. This workflow
4
+ reads `.openlore/refactor-plan.md` at the start and re-reads it before each
5
+ change to stay on track — especially important with small or limited models.
6
+
7
+ **Prerequisites**: run `/openlore-plan-refactor` first and confirm the plan.
8
+
9
+ ## Step 1: Read the plan
10
+
11
+ Read `.openlore/refactor-plan.md` from the project directory.
12
+
13
+ If the file does not exist, stop immediately:
14
+ > "No refactor plan found at `.openlore/refactor-plan.md`. Please run
15
+ > `/openlore-plan-refactor` first to generate a plan."
16
+
17
+ Extract and display a summary:
18
+ - Target function, file, and line range
19
+ - Strategy and risk score
20
+ - Number of changes planned
21
+ - Test command
22
+ - Acceptance criteria
23
+
24
+ Ask the user to confirm before proceeding.
25
+
26
+ ## Step 2: Establish a green baseline
27
+
28
+ Confirm the test suite is passing. Use the test command from the plan.
29
+
30
+ **If tests are already failing, stop and tell the user.** Do not proceed with
31
+ refactoring on a red baseline — the failures must be fixed first or the user
32
+ must explicitly acknowledge them.
33
+
34
+ If a coverage tool is available, run it on the target file and compare against
35
+ the coverage baseline in the plan.
36
+
37
+ | Coverage on files to touch | Recommendation |
38
+ |---|---|
39
+ | ≥ 70% lines | Safe to refactor — proceed |
40
+ | 40–69% lines | Caution — write characterisation tests for the affected functions before starting |
41
+ | < 40% lines | **Stop.** Strongly recommend writing tests first. Refactoring untested code hides regressions. |
42
+ | 0% (no tests at all) | **Block.** Do not refactor. Propose writing a minimal test harness first, then restart the workflow. |
43
+
44
+ If coverage is below 40%, tell the user:
45
+ > "Coverage on the target file is X%. Refactoring without test coverage risks
46
+ > introducing silent regressions. I recommend writing tests for the affected
47
+ > functions before proceeding. Would you like me to suggest test cases based on
48
+ > the function signatures, or do you want to proceed at your own risk?"
49
+
50
+ Only continue past this point with explicit user confirmation.
51
+
52
+ **Large file warning**: If the target function spans more than 300 lines:
53
+ > "This function is X lines long. Small models (< 13B parameters) may lose
54
+ > code when editing files of this size in a single pass. Recommended approach:
55
+ > apply Change 1 from the plan (smallest extraction) first to reduce the target
56
+ > below 200 lines before the main refactor."
57
+
58
+ ## Step 3: Set the restore point
59
+
60
+ Verify the working tree is clean, then note the restore point:
61
+
62
+ ```bash
63
+ git status # must show: nothing to commit, working tree clean
64
+ git log --oneline -1 # note this commit hash — your restore point
65
+ ```
66
+
67
+ If there are uncommitted changes, stop and ask the user to commit or stash them
68
+ first. A clean tree guarantees that `git checkout HEAD -- <file>` will fully
69
+ restore any file to its pre-edit state.
70
+
71
+ Fill in the `Restore point` section of `.openlore/refactor-plan.md` with the
72
+ current commit hash.
73
+
74
+ ## Step 4: Apply changes (one at a time)
75
+
76
+ Before applying the first change, record the refactoring decision:
77
+
78
+ ```xml
79
+ <use_mcp_tool>
80
+ <server_name>openlore</server_name>
81
+ <tool_name>record_decision</tool_name>
82
+ <arguments>{
83
+ "directory": "$DIRECTORY",
84
+ "title": "Refactor $TARGET_FUNCTION via $STRATEGY",
85
+ "rationale": "$PRIMARY_REASON from the plan's Why section",
86
+ "consequences": "Callers unchanged; complexity distributed across extracted helpers",
87
+ "affectedFiles": ["$TARGET_FILE"]
88
+ }</arguments>
89
+ </use_mcp_tool>
90
+ ```
91
+
92
+ Also call `record_decision` for any unexpected architectural choice that emerges mid-refactor (new module boundary discovered, shared interface change required, dependency introduced).
93
+
94
+ **Before each change**, re-read `.openlore/refactor-plan.md` to confirm:
95
+ - Which change you are on
96
+ - Exactly what to extract, where to put it, and which call sites to update
97
+
98
+ **Editing tool rule**: Always prefer a targeted edit tool (`replace_in_file`,
99
+ `str_replace_based_edit`, `apply_diff`, or equivalent) over a full-file
100
+ rewrite tool (`write_to_file`). Only use `write_to_file` if the file is under
101
+ 100 lines in total. If a change seems to require `write_to_file` on a larger
102
+ file, stop and split it into smaller targeted edits instead.
103
+
104
+ **Model capability note**: If using a small model (Mistral Small, Phi, Gemma,
105
+ or any model under 13B parameters), enforce an additional constraint: each edit
106
+ must touch a contiguous block of at most 50 lines. If the intended change
107
+ exceeds this, split it into multiple smaller extractions and apply them one
108
+ by one.
109
+
110
+ For each change in the plan:
111
+
112
+ 1. **Read the source file** around the lines to extract (do not rely on memory).
113
+
114
+ 2. **Apply the edit**:
115
+ - Extract or move the identified block
116
+ - Place it in the target file and target class specified in the plan
117
+ - If the target file is new, create it with only the extracted code
118
+ - Update all call sites listed in the plan
119
+
120
+ 3. **Verify the diff** before running tests:
121
+ ```bash
122
+ git diff --stat # only the expected files should appear
123
+ git diff # scan deleted lines (-) and confirm each removal is
124
+ # intentional — moved to a new function or file,
125
+ # not silently dropped.
126
+ # If deleted lines >> added lines with no new file
127
+ # created, code was likely lost — abort immediately.
128
+ ```
129
+
130
+ 4. **Run the test suite** (use the command from the plan). If any test fails,
131
+ restore the file right away:
132
+ ```bash
133
+ git checkout HEAD -- <file>
134
+ ```
135
+ Do NOT accumulate broken state before restoring.
136
+
137
+ 5. **Mark the change as done** in `.openlore/refactor-plan.md` by appending
138
+ `✅` to the change heading, then proceed to the next one.
139
+
140
+ Repeat until all changes in the plan are marked ✅.
141
+
142
+ ## Step 5: Verify improvement
143
+
144
+ Re-analyse to confirm the priority score dropped for the refactored function.
145
+
146
+ <use_mcp_tool>
147
+ <server_name>openlore</server_name>
148
+ <tool_name>analyze_codebase</tool_name>
149
+ <arguments>{"directory": "$DIRECTORY", "force": true}</arguments>
150
+ </use_mcp_tool>
151
+
152
+ <use_mcp_tool>
153
+ <server_name>openlore</server_name>
154
+ <tool_name>get_refactor_report</tool_name>
155
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
156
+ </use_mcp_tool>
157
+
158
+ Check each acceptance criterion from the plan:
159
+ - Priority score dropped below the target
160
+ - Function is no longer in the top-5 list
161
+ - Full test suite passes
162
+
163
+ If not, investigate why and iterate (add a new change to the plan if needed).
164
+
165
+ Run the full test suite one final time to confirm the refactored state is clean.
166
+
167
+ ## Step 6 (optional — requires openlore generate to have been run)
168
+
169
+ **Important**: this step proposes irreversible changes (deletions, renames).
170
+ Do not apply anything without explicit user confirmation at each sub-step.
171
+
172
+ ### 6a. Dead code: orphan functions
173
+
174
+ Check for functions not covered by any spec requirement.
175
+
176
+ <use_mcp_tool>
177
+ <server_name>openlore</server_name>
178
+ <tool_name>get_mapping</tool_name>
179
+ <arguments>{"directory": "$DIRECTORY", "orphansOnly": true}</arguments>
180
+ </use_mcp_tool>
181
+
182
+ Present the orphan list (kind `function` or `class` only). For each one, check:
183
+ - Is it exported and potentially consumed by external code?
184
+ - Is it re-exported from an index file?
185
+ - Was it simply missed by the LLM in Stage 3?
186
+
187
+ Only after the user has reviewed and confirmed each entry, propose deletion or
188
+ a documentation comment marking it as intentionally uncovered.
189
+
190
+ **Do not delete anything without the user explicitly approving each function.**
191
+
192
+ ### 6b. Naming alignment: spec vocabulary vs actual names
193
+
194
+ Find functions whose names diverge from the business vocabulary in the spec.
195
+
196
+ <use_mcp_tool>
197
+ <server_name>openlore</server_name>
198
+ <tool_name>get_mapping</tool_name>
199
+ <arguments>{"directory": "$DIRECTORY"}</arguments>
200
+ </use_mcp_tool>
201
+
202
+ Build a table of mismatches (requirement name vs function name) and present it
203
+ to the user for review before touching any code:
204
+
205
+ | Current name | Proposed name | File | Confidence |
206
+ |---|---|---|---|
207
+
208
+ Only renames with `confidence: "llm"` should be proposed automatically.
209
+ Flag `confidence: "heuristic"` entries for manual verification first.
210
+
211
+ **Wait for explicit user approval of the full rename table before applying
212
+ any change. Apply renames one file at a time and run tests after each.**