specweave 0.11.0 → 0.12.1

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 (652) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CLAUDE.md +131 -144
  3. package/README.md +48 -21
  4. package/dist/cli/commands/init.d.ts.map +1 -1
  5. package/dist/cli/commands/init.js +21 -70
  6. package/dist/cli/commands/init.js.map +1 -1
  7. package/dist/hooks/lib/git-diff-analyzer.d.ts +89 -0
  8. package/dist/hooks/lib/git-diff-analyzer.d.ts.map +1 -0
  9. package/dist/hooks/lib/git-diff-analyzer.js +226 -0
  10. package/dist/hooks/lib/git-diff-analyzer.js.map +1 -0
  11. package/dist/hooks/lib/prepare-reflection-context.d.ts +42 -0
  12. package/dist/hooks/lib/prepare-reflection-context.d.ts.map +1 -0
  13. package/dist/hooks/lib/prepare-reflection-context.js +123 -0
  14. package/dist/hooks/lib/prepare-reflection-context.js.map +1 -0
  15. package/dist/hooks/lib/reflection-config-loader.d.ts +45 -0
  16. package/dist/hooks/lib/reflection-config-loader.d.ts.map +1 -0
  17. package/dist/hooks/lib/reflection-config-loader.js +132 -0
  18. package/dist/hooks/lib/reflection-config-loader.js.map +1 -0
  19. package/dist/hooks/lib/reflection-parser.d.ts +33 -0
  20. package/dist/hooks/lib/reflection-parser.d.ts.map +1 -0
  21. package/dist/hooks/lib/reflection-parser.js +419 -0
  22. package/dist/hooks/lib/reflection-parser.js.map +1 -0
  23. package/dist/hooks/lib/reflection-prompt-builder.d.ts +56 -0
  24. package/dist/hooks/lib/reflection-prompt-builder.d.ts.map +1 -0
  25. package/dist/hooks/lib/reflection-prompt-builder.js +239 -0
  26. package/dist/hooks/lib/reflection-prompt-builder.js.map +1 -0
  27. package/dist/hooks/lib/reflection-storage.d.ts +64 -0
  28. package/dist/hooks/lib/reflection-storage.d.ts.map +1 -0
  29. package/dist/hooks/lib/reflection-storage.js +305 -0
  30. package/dist/hooks/lib/reflection-storage.js.map +1 -0
  31. package/dist/hooks/lib/run-self-reflection.d.ts +43 -0
  32. package/dist/hooks/lib/run-self-reflection.d.ts.map +1 -0
  33. package/dist/hooks/lib/run-self-reflection.js +203 -0
  34. package/dist/hooks/lib/run-self-reflection.js.map +1 -0
  35. package/dist/hooks/lib/types/reflection-types.d.ts +164 -0
  36. package/dist/hooks/lib/types/reflection-types.d.ts.map +1 -0
  37. package/dist/hooks/lib/types/reflection-types.js +73 -0
  38. package/dist/hooks/lib/types/reflection-types.js.map +1 -0
  39. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +89 -0
  40. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +1 -0
  41. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +226 -0
  42. package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +1 -0
  43. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +60 -0
  44. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +1 -0
  45. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +201 -0
  46. package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +1 -0
  47. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +42 -0
  48. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +1 -0
  49. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +123 -0
  50. package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +1 -0
  51. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +45 -0
  52. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +1 -0
  53. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +132 -0
  54. package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +1 -0
  55. package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +33 -0
  56. package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +1 -0
  57. package/dist/plugins/specweave/lib/hooks/reflection-parser.js +419 -0
  58. package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +1 -0
  59. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +56 -0
  60. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +1 -0
  61. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +239 -0
  62. package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +1 -0
  63. package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +64 -0
  64. package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +1 -0
  65. package/dist/plugins/specweave/lib/hooks/reflection-storage.js +305 -0
  66. package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +1 -0
  67. package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +43 -0
  68. package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +1 -0
  69. package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +203 -0
  70. package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +1 -0
  71. package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +27 -0
  72. package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -0
  73. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +116 -0
  74. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -0
  75. package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +59 -0
  76. package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +1 -0
  77. package/dist/plugins/specweave/lib/hooks/translate-file.js +350 -0
  78. package/dist/plugins/specweave/lib/hooks/translate-file.js.map +1 -0
  79. package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +13 -0
  80. package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +1 -0
  81. package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +175 -0
  82. package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +1 -0
  83. package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +164 -0
  84. package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +1 -0
  85. package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +73 -0
  86. package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +1 -0
  87. package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +29 -0
  88. package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +1 -0
  89. package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +203 -0
  90. package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +1 -0
  91. package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts +94 -0
  92. package/dist/plugins/specweave-ado/lib/ado-board-resolver.d.ts.map +1 -0
  93. package/dist/plugins/specweave-ado/lib/ado-board-resolver.js +219 -0
  94. package/dist/plugins/specweave-ado/lib/ado-board-resolver.js.map +1 -0
  95. package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts +124 -0
  96. package/dist/plugins/specweave-ado/lib/ado-client-v2.d.ts.map +1 -0
  97. package/dist/plugins/specweave-ado/lib/ado-client-v2.js +382 -0
  98. package/dist/plugins/specweave-ado/lib/ado-client-v2.js.map +1 -0
  99. package/dist/plugins/specweave-ado/lib/ado-client.d.ts +112 -0
  100. package/dist/plugins/specweave-ado/lib/ado-client.d.ts.map +1 -0
  101. package/dist/plugins/specweave-ado/lib/ado-client.js +257 -0
  102. package/dist/plugins/specweave-ado/lib/ado-client.js.map +1 -0
  103. package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts +40 -0
  104. package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.d.ts.map +1 -0
  105. package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js +370 -0
  106. package/dist/plugins/specweave-ado/lib/ado-hierarchical-sync.js.map +1 -0
  107. package/dist/plugins/specweave-ado/lib/project-selector.d.ts +42 -0
  108. package/dist/plugins/specweave-ado/lib/project-selector.d.ts.map +1 -0
  109. package/dist/plugins/specweave-ado/lib/project-selector.js +211 -0
  110. package/dist/plugins/specweave-ado/lib/project-selector.js.map +1 -0
  111. package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts +54 -0
  112. package/dist/plugins/specweave-github/lib/github-board-resolver.d.ts.map +1 -0
  113. package/dist/plugins/specweave-github/lib/github-board-resolver.js +122 -0
  114. package/dist/plugins/specweave-github/lib/github-board-resolver.js.map +1 -0
  115. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +104 -0
  116. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -0
  117. package/dist/plugins/specweave-github/lib/github-client-v2.js +408 -0
  118. package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -0
  119. package/dist/plugins/specweave-github/lib/github-client.d.ts +10 -0
  120. package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
  121. package/dist/plugins/specweave-github/lib/github-client.js +24 -0
  122. package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
  123. package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts +29 -0
  124. package/dist/plugins/specweave-github/lib/github-hierarchical-sync.d.ts.map +1 -0
  125. package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js +268 -0
  126. package/dist/plugins/specweave-github/lib/github-hierarchical-sync.js.map +1 -0
  127. package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -1
  128. package/dist/plugins/specweave-github/lib/index.js.map +1 -1
  129. package/dist/plugins/specweave-github/lib/repo-selector.d.ts +49 -0
  130. package/dist/plugins/specweave-github/lib/repo-selector.d.ts.map +1 -0
  131. package/dist/plugins/specweave-github/lib/repo-selector.js +216 -0
  132. package/dist/plugins/specweave-github/lib/repo-selector.js.map +1 -0
  133. package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +1 -1
  134. package/dist/plugins/specweave-github/lib/subtask-sync.js.map +1 -1
  135. package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +1 -1
  136. package/dist/plugins/specweave-github/lib/task-parser.js.map +1 -1
  137. package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
  138. package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
  139. package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
  140. package/dist/plugins/specweave-github/lib/types.js.map +1 -1
  141. package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts +50 -0
  142. package/dist/plugins/specweave-jira/lib/jira-board-resolver.d.ts.map +1 -0
  143. package/dist/plugins/specweave-jira/lib/jira-board-resolver.js +84 -0
  144. package/dist/plugins/specweave-jira/lib/jira-board-resolver.js.map +1 -0
  145. package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts +33 -0
  146. package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.d.ts.map +1 -0
  147. package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js +206 -0
  148. package/dist/plugins/specweave-jira/lib/jira-hierarchical-sync.js.map +1 -0
  149. package/dist/plugins/specweave-jira/lib/project-selector.d.ts +42 -0
  150. package/dist/plugins/specweave-jira/lib/project-selector.d.ts.map +1 -0
  151. package/dist/plugins/specweave-jira/lib/project-selector.js +216 -0
  152. package/dist/plugins/specweave-jira/lib/project-selector.js.map +1 -0
  153. package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts +67 -0
  154. package/dist/plugins/specweave-jira/lib/reorganization-detector.d.ts.map +1 -0
  155. package/dist/plugins/specweave-jira/lib/reorganization-detector.js +252 -0
  156. package/dist/plugins/specweave-jira/lib/reorganization-detector.js.map +1 -0
  157. package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts +29 -0
  158. package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -0
  159. package/dist/plugins/specweave-jira/lib/setup-wizard.js +219 -0
  160. package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -0
  161. package/dist/src/adapters/adapter-base.d.ts +71 -0
  162. package/dist/src/adapters/adapter-base.d.ts.map +1 -0
  163. package/dist/src/adapters/adapter-base.js +139 -0
  164. package/dist/src/adapters/adapter-base.js.map +1 -0
  165. package/dist/src/adapters/adapter-interface.d.ts +149 -0
  166. package/dist/src/adapters/adapter-interface.d.ts.map +1 -0
  167. package/dist/src/adapters/adapter-interface.js +8 -0
  168. package/dist/src/adapters/adapter-interface.js.map +1 -0
  169. package/dist/src/adapters/adapter-loader.d.ts +91 -0
  170. package/dist/src/adapters/adapter-loader.d.ts.map +1 -0
  171. package/dist/src/adapters/adapter-loader.js +238 -0
  172. package/dist/src/adapters/adapter-loader.js.map +1 -0
  173. package/dist/src/adapters/agents-md-generator.d.ts +48 -0
  174. package/dist/src/adapters/agents-md-generator.d.ts.map +1 -0
  175. package/dist/src/adapters/agents-md-generator.js +193 -0
  176. package/dist/src/adapters/agents-md-generator.js.map +1 -0
  177. package/dist/src/adapters/claude/adapter.d.ts +128 -0
  178. package/dist/src/adapters/claude/adapter.d.ts.map +1 -0
  179. package/dist/src/adapters/claude/adapter.js +415 -0
  180. package/dist/src/adapters/claude/adapter.js.map +1 -0
  181. package/dist/src/adapters/claude-md-generator.d.ts +78 -0
  182. package/dist/src/adapters/claude-md-generator.d.ts.map +1 -0
  183. package/dist/src/adapters/claude-md-generator.js +307 -0
  184. package/dist/src/adapters/claude-md-generator.js.map +1 -0
  185. package/dist/src/adapters/codex/adapter.d.ts +50 -0
  186. package/dist/src/adapters/codex/adapter.d.ts.map +1 -0
  187. package/dist/src/adapters/codex/adapter.js +316 -0
  188. package/dist/src/adapters/codex/adapter.js.map +1 -0
  189. package/dist/src/adapters/cursor/adapter.d.ts +98 -0
  190. package/dist/src/adapters/cursor/adapter.d.ts.map +1 -0
  191. package/dist/src/adapters/cursor/adapter.js +406 -0
  192. package/dist/src/adapters/cursor/adapter.js.map +1 -0
  193. package/dist/src/adapters/doc-generator.d.ts +69 -0
  194. package/dist/src/adapters/doc-generator.d.ts.map +1 -0
  195. package/dist/src/adapters/doc-generator.js +247 -0
  196. package/dist/src/adapters/doc-generator.js.map +1 -0
  197. package/dist/src/adapters/gemini/adapter.d.ts +50 -0
  198. package/dist/src/adapters/gemini/adapter.d.ts.map +1 -0
  199. package/dist/src/adapters/gemini/adapter.js +281 -0
  200. package/dist/src/adapters/gemini/adapter.js.map +1 -0
  201. package/dist/src/adapters/generic/adapter.d.ts +86 -0
  202. package/dist/src/adapters/generic/adapter.d.ts.map +1 -0
  203. package/dist/src/adapters/generic/adapter.js +338 -0
  204. package/dist/src/adapters/generic/adapter.js.map +1 -0
  205. package/dist/src/cli/commands/abandon.d.ts +13 -0
  206. package/dist/src/cli/commands/abandon.d.ts.map +1 -0
  207. package/dist/src/cli/commands/abandon.js +15 -0
  208. package/dist/src/cli/commands/abandon.js.map +1 -0
  209. package/dist/src/cli/commands/import-docs.d.ts +21 -0
  210. package/dist/src/cli/commands/import-docs.d.ts.map +1 -0
  211. package/dist/src/cli/commands/import-docs.js +146 -0
  212. package/dist/src/cli/commands/import-docs.js.map +1 -0
  213. package/dist/src/cli/commands/init-multiproject.d.ts +11 -0
  214. package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -0
  215. package/dist/src/cli/commands/init-multiproject.js +202 -0
  216. package/dist/src/cli/commands/init-multiproject.js.map +1 -0
  217. package/dist/src/cli/commands/init.d.ts +9 -0
  218. package/dist/src/cli/commands/init.d.ts.map +1 -0
  219. package/dist/src/cli/commands/init.js +1205 -0
  220. package/dist/src/cli/commands/init.js.map +1 -0
  221. package/dist/src/cli/commands/install.d.ts +9 -0
  222. package/dist/src/cli/commands/install.d.ts.map +1 -0
  223. package/dist/src/cli/commands/install.js +127 -0
  224. package/dist/src/cli/commands/install.js.map +1 -0
  225. package/dist/src/cli/commands/list.d.ts +8 -0
  226. package/dist/src/cli/commands/list.d.ts.map +1 -0
  227. package/dist/src/cli/commands/list.js +119 -0
  228. package/dist/src/cli/commands/list.js.map +1 -0
  229. package/dist/src/cli/commands/migrate-to-multiproject.d.ts +37 -0
  230. package/dist/src/cli/commands/migrate-to-multiproject.d.ts.map +1 -0
  231. package/dist/src/cli/commands/migrate-to-multiproject.js +189 -0
  232. package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -0
  233. package/dist/src/cli/commands/migrate-to-profiles.d.ts +25 -0
  234. package/dist/src/cli/commands/migrate-to-profiles.d.ts.map +1 -0
  235. package/dist/src/cli/commands/migrate-to-profiles.js +350 -0
  236. package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -0
  237. package/dist/src/cli/commands/pause.d.ts +13 -0
  238. package/dist/src/cli/commands/pause.d.ts.map +1 -0
  239. package/dist/src/cli/commands/pause.js +15 -0
  240. package/dist/src/cli/commands/pause.js.map +1 -0
  241. package/dist/src/cli/commands/qa.d.ts +54 -0
  242. package/dist/src/cli/commands/qa.d.ts.map +1 -0
  243. package/dist/src/cli/commands/qa.js +98 -0
  244. package/dist/src/cli/commands/qa.js.map +1 -0
  245. package/dist/src/cli/commands/resume.d.ts +12 -0
  246. package/dist/src/cli/commands/resume.d.ts.map +1 -0
  247. package/dist/src/cli/commands/resume.js +14 -0
  248. package/dist/src/cli/commands/resume.js.map +1 -0
  249. package/dist/src/cli/commands/status.d.ts +12 -0
  250. package/dist/src/cli/commands/status.d.ts.map +1 -0
  251. package/dist/src/cli/commands/status.js +23 -0
  252. package/dist/src/cli/commands/status.js.map +1 -0
  253. package/dist/src/cli/commands/switch-project.d.ts +13 -0
  254. package/dist/src/cli/commands/switch-project.d.ts.map +1 -0
  255. package/dist/src/cli/commands/switch-project.js +91 -0
  256. package/dist/src/cli/commands/switch-project.js.map +1 -0
  257. package/dist/src/cli/commands/validate-jira.d.ts +35 -0
  258. package/dist/src/cli/commands/validate-jira.d.ts.map +1 -0
  259. package/dist/src/cli/commands/validate-jira.js +112 -0
  260. package/dist/src/cli/commands/validate-jira.js.map +1 -0
  261. package/dist/src/cli/commands/validate-plugins.d.ts +41 -0
  262. package/dist/src/cli/commands/validate-plugins.d.ts.map +1 -0
  263. package/dist/src/cli/commands/validate-plugins.js +171 -0
  264. package/dist/src/cli/commands/validate-plugins.js.map +1 -0
  265. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +57 -0
  266. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -0
  267. package/dist/src/cli/helpers/issue-tracker/ado.js +243 -0
  268. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -0
  269. package/dist/src/cli/helpers/issue-tracker/github.d.ts +65 -0
  270. package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -0
  271. package/dist/src/cli/helpers/issue-tracker/github.js +426 -0
  272. package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -0
  273. package/dist/src/cli/helpers/issue-tracker/index.d.ts +22 -0
  274. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -0
  275. package/dist/src/cli/helpers/issue-tracker/index.js +314 -0
  276. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -0
  277. package/dist/src/cli/helpers/issue-tracker/jira.d.ts +61 -0
  278. package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -0
  279. package/dist/src/cli/helpers/issue-tracker/jira.js +404 -0
  280. package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -0
  281. package/dist/src/cli/helpers/issue-tracker/types.d.ts +107 -0
  282. package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -0
  283. package/dist/src/cli/helpers/issue-tracker/types.js +16 -0
  284. package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -0
  285. package/dist/src/cli/helpers/issue-tracker/utils.d.ts +112 -0
  286. package/dist/src/cli/helpers/issue-tracker/utils.d.ts.map +1 -0
  287. package/dist/src/cli/helpers/issue-tracker/utils.js +247 -0
  288. package/dist/src/cli/helpers/issue-tracker/utils.js.map +1 -0
  289. package/dist/src/core/agent-model-manager.d.ts +52 -0
  290. package/dist/src/core/agent-model-manager.d.ts.map +1 -0
  291. package/dist/src/core/agent-model-manager.js +120 -0
  292. package/dist/src/core/agent-model-manager.js.map +1 -0
  293. package/dist/src/core/brownfield/analyzer.d.ts +86 -0
  294. package/dist/src/core/brownfield/analyzer.d.ts.map +1 -0
  295. package/dist/src/core/brownfield/analyzer.js +365 -0
  296. package/dist/src/core/brownfield/analyzer.js.map +1 -0
  297. package/dist/src/core/brownfield/importer.d.ts +76 -0
  298. package/dist/src/core/brownfield/importer.d.ts.map +1 -0
  299. package/dist/src/core/brownfield/importer.js +287 -0
  300. package/dist/src/core/brownfield/importer.js.map +1 -0
  301. package/dist/src/core/config-manager.d.ts +47 -0
  302. package/dist/src/core/config-manager.d.ts.map +1 -0
  303. package/dist/src/core/config-manager.js +136 -0
  304. package/dist/src/core/config-manager.js.map +1 -0
  305. package/dist/src/core/cost-tracker.d.ts +108 -0
  306. package/dist/src/core/cost-tracker.d.ts.map +1 -0
  307. package/dist/src/core/cost-tracker.js +281 -0
  308. package/dist/src/core/cost-tracker.js.map +1 -0
  309. package/dist/src/core/credentials-manager.d.ts +107 -0
  310. package/dist/src/core/credentials-manager.d.ts.map +1 -0
  311. package/dist/src/core/credentials-manager.js +457 -0
  312. package/dist/src/core/credentials-manager.js.map +1 -0
  313. package/dist/src/core/i18n/language-detector.d.ts +29 -0
  314. package/dist/src/core/i18n/language-detector.d.ts.map +1 -0
  315. package/dist/src/core/i18n/language-detector.js +143 -0
  316. package/dist/src/core/i18n/language-detector.js.map +1 -0
  317. package/dist/src/core/i18n/language-manager.d.ts +101 -0
  318. package/dist/src/core/i18n/language-manager.d.ts.map +1 -0
  319. package/dist/src/core/i18n/language-manager.js +232 -0
  320. package/dist/src/core/i18n/language-manager.js.map +1 -0
  321. package/dist/src/core/i18n/language-registry.d.ts +44 -0
  322. package/dist/src/core/i18n/language-registry.d.ts.map +1 -0
  323. package/dist/src/core/i18n/language-registry.js +234 -0
  324. package/dist/src/core/i18n/language-registry.js.map +1 -0
  325. package/dist/src/core/i18n/locale-manager.d.ts +62 -0
  326. package/dist/src/core/i18n/locale-manager.d.ts.map +1 -0
  327. package/dist/src/core/i18n/locale-manager.js +137 -0
  328. package/dist/src/core/i18n/locale-manager.js.map +1 -0
  329. package/dist/src/core/i18n/system-prompt-injector.d.ts +33 -0
  330. package/dist/src/core/i18n/system-prompt-injector.d.ts.map +1 -0
  331. package/dist/src/core/i18n/system-prompt-injector.js +131 -0
  332. package/dist/src/core/i18n/system-prompt-injector.js.map +1 -0
  333. package/dist/src/core/i18n/types.d.ts +151 -0
  334. package/dist/src/core/i18n/types.d.ts.map +1 -0
  335. package/dist/src/core/i18n/types.js +11 -0
  336. package/dist/src/core/i18n/types.js.map +1 -0
  337. package/dist/src/core/increment/limits.d.ts +68 -0
  338. package/dist/src/core/increment/limits.d.ts.map +1 -0
  339. package/dist/src/core/increment/limits.js +224 -0
  340. package/dist/src/core/increment/limits.js.map +1 -0
  341. package/dist/src/core/increment/metadata-manager.d.ts +114 -0
  342. package/dist/src/core/increment/metadata-manager.d.ts.map +1 -0
  343. package/dist/src/core/increment/metadata-manager.js +320 -0
  344. package/dist/src/core/increment/metadata-manager.js.map +1 -0
  345. package/dist/src/core/increment/status-commands.d.ts +43 -0
  346. package/dist/src/core/increment/status-commands.d.ts.map +1 -0
  347. package/dist/src/core/increment/status-commands.js +277 -0
  348. package/dist/src/core/increment/status-commands.js.map +1 -0
  349. package/dist/src/core/increment-status.d.ts +72 -0
  350. package/dist/src/core/increment-status.d.ts.map +1 -0
  351. package/dist/src/core/increment-status.js +227 -0
  352. package/dist/src/core/increment-status.js.map +1 -0
  353. package/dist/src/core/model-selector.d.ts +57 -0
  354. package/dist/src/core/model-selector.d.ts.map +1 -0
  355. package/dist/src/core/model-selector.js +115 -0
  356. package/dist/src/core/model-selector.js.map +1 -0
  357. package/dist/src/core/phase-detector.d.ts +62 -0
  358. package/dist/src/core/phase-detector.d.ts.map +1 -0
  359. package/dist/src/core/phase-detector.js +229 -0
  360. package/dist/src/core/phase-detector.js.map +1 -0
  361. package/dist/src/core/plugin-loader.d.ts +131 -0
  362. package/dist/src/core/plugin-loader.d.ts.map +1 -0
  363. package/dist/src/core/plugin-loader.js +421 -0
  364. package/dist/src/core/plugin-loader.js.map +1 -0
  365. package/dist/src/core/project-manager.d.ts +127 -0
  366. package/dist/src/core/project-manager.d.ts.map +1 -0
  367. package/dist/src/core/project-manager.js +524 -0
  368. package/dist/src/core/project-manager.js.map +1 -0
  369. package/dist/src/core/project-structure-detector.d.ts +92 -0
  370. package/dist/src/core/project-structure-detector.d.ts.map +1 -0
  371. package/dist/src/core/project-structure-detector.js +289 -0
  372. package/dist/src/core/project-structure-detector.js.map +1 -0
  373. package/dist/src/core/qa/qa-runner.d.ts +16 -0
  374. package/dist/src/core/qa/qa-runner.d.ts.map +1 -0
  375. package/dist/src/core/qa/qa-runner.js +404 -0
  376. package/dist/src/core/qa/qa-runner.js.map +1 -0
  377. package/dist/src/core/qa/quality-gate-decider.d.ts +53 -0
  378. package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -0
  379. package/dist/src/core/qa/quality-gate-decider.js +268 -0
  380. package/dist/src/core/qa/quality-gate-decider.js.map +1 -0
  381. package/dist/src/core/qa/risk-calculator.d.ts +126 -0
  382. package/dist/src/core/qa/risk-calculator.d.ts.map +1 -0
  383. package/dist/src/core/qa/risk-calculator.js +247 -0
  384. package/dist/src/core/qa/risk-calculator.js.map +1 -0
  385. package/dist/src/core/qa/types.d.ts +315 -0
  386. package/dist/src/core/qa/types.d.ts.map +1 -0
  387. package/dist/src/core/qa/types.js +8 -0
  388. package/dist/src/core/qa/types.js.map +1 -0
  389. package/dist/src/core/rfc-generator-v2.d.ts +149 -0
  390. package/dist/src/core/rfc-generator-v2.d.ts.map +1 -0
  391. package/dist/src/core/rfc-generator-v2.js +399 -0
  392. package/dist/src/core/rfc-generator-v2.js.map +1 -0
  393. package/dist/src/core/sync/bidirectional-engine.d.ts +110 -0
  394. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -0
  395. package/dist/src/core/sync/bidirectional-engine.js +356 -0
  396. package/dist/src/core/sync/bidirectional-engine.js.map +1 -0
  397. package/dist/src/core/sync/folder-mapper.d.ts +71 -0
  398. package/dist/src/core/sync/folder-mapper.d.ts.map +1 -0
  399. package/dist/src/core/sync/folder-mapper.js +168 -0
  400. package/dist/src/core/sync/folder-mapper.js.map +1 -0
  401. package/dist/src/core/sync/profile-manager.d.ts +72 -0
  402. package/dist/src/core/sync/profile-manager.d.ts.map +1 -0
  403. package/dist/src/core/sync/profile-manager.js +338 -0
  404. package/dist/src/core/sync/profile-manager.js.map +1 -0
  405. package/dist/src/core/sync/profile-selector.d.ts +52 -0
  406. package/dist/src/core/sync/profile-selector.d.ts.map +1 -0
  407. package/dist/src/core/sync/profile-selector.js +179 -0
  408. package/dist/src/core/sync/profile-selector.js.map +1 -0
  409. package/dist/src/core/sync/profile-validator.d.ts +52 -0
  410. package/dist/src/core/sync/profile-validator.d.ts.map +1 -0
  411. package/dist/src/core/sync/profile-validator.js +225 -0
  412. package/dist/src/core/sync/profile-validator.js.map +1 -0
  413. package/dist/src/core/sync/project-context.d.ts +81 -0
  414. package/dist/src/core/sync/project-context.d.ts.map +1 -0
  415. package/dist/src/core/sync/project-context.js +354 -0
  416. package/dist/src/core/sync/project-context.js.map +1 -0
  417. package/dist/src/core/sync/rate-limiter.d.ts +116 -0
  418. package/dist/src/core/sync/rate-limiter.d.ts.map +1 -0
  419. package/dist/src/core/sync/rate-limiter.js +308 -0
  420. package/dist/src/core/sync/rate-limiter.js.map +1 -0
  421. package/dist/src/core/sync/time-range-selector.d.ts +48 -0
  422. package/dist/src/core/sync/time-range-selector.d.ts.map +1 -0
  423. package/dist/src/core/sync/time-range-selector.js +224 -0
  424. package/dist/src/core/sync/time-range-selector.js.map +1 -0
  425. package/dist/src/core/types/config.d.ts +90 -0
  426. package/dist/src/core/types/config.d.ts.map +1 -0
  427. package/dist/src/core/types/config.js +37 -0
  428. package/dist/src/core/types/config.js.map +1 -0
  429. package/dist/src/core/types/increment-metadata.d.ts +120 -0
  430. package/dist/src/core/types/increment-metadata.d.ts.map +1 -0
  431. package/dist/src/core/types/increment-metadata.js +138 -0
  432. package/dist/src/core/types/increment-metadata.js.map +1 -0
  433. package/dist/src/core/types/plugin.d.ts +283 -0
  434. package/dist/src/core/types/plugin.d.ts.map +1 -0
  435. package/dist/src/core/types/plugin.js +49 -0
  436. package/dist/src/core/types/plugin.js.map +1 -0
  437. package/dist/src/core/types/sync-profile.d.ts +403 -0
  438. package/dist/src/core/types/sync-profile.d.ts.map +1 -0
  439. package/dist/src/core/types/sync-profile.js +55 -0
  440. package/dist/src/core/types/sync-profile.js.map +1 -0
  441. package/dist/src/hooks/lib/types/reflection-types.d.ts +125 -0
  442. package/dist/src/hooks/lib/types/reflection-types.d.ts.map +1 -0
  443. package/dist/src/hooks/lib/types/reflection-types.js +54 -0
  444. package/dist/src/hooks/lib/types/reflection-types.js.map +1 -0
  445. package/dist/src/integrations/ado/ado-client.d.ts +127 -0
  446. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -0
  447. package/dist/src/integrations/ado/ado-client.js +416 -0
  448. package/dist/src/integrations/ado/ado-client.js.map +1 -0
  449. package/dist/src/integrations/jira/jira-client.d.ts +139 -0
  450. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -0
  451. package/dist/src/integrations/jira/jira-client.js +386 -0
  452. package/dist/src/integrations/jira/jira-client.js.map +1 -0
  453. package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +75 -0
  454. package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -0
  455. package/dist/src/integrations/jira/jira-incremental-mapper.js +474 -0
  456. package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -0
  457. package/dist/src/integrations/jira/jira-mapper.d.ts +105 -0
  458. package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -0
  459. package/dist/src/integrations/jira/jira-mapper.js +494 -0
  460. package/dist/src/integrations/jira/jira-mapper.js.map +1 -0
  461. package/dist/src/metrics/calculators/change-failure-rate.d.ts +22 -0
  462. package/dist/src/metrics/calculators/change-failure-rate.d.ts.map +1 -0
  463. package/dist/src/metrics/calculators/change-failure-rate.js +70 -0
  464. package/dist/src/metrics/calculators/change-failure-rate.js.map +1 -0
  465. package/dist/src/metrics/calculators/deployment-frequency.d.ts +20 -0
  466. package/dist/src/metrics/calculators/deployment-frequency.d.ts.map +1 -0
  467. package/dist/src/metrics/calculators/deployment-frequency.js +61 -0
  468. package/dist/src/metrics/calculators/deployment-frequency.js.map +1 -0
  469. package/dist/src/metrics/calculators/lead-time.d.ts +22 -0
  470. package/dist/src/metrics/calculators/lead-time.d.ts.map +1 -0
  471. package/dist/src/metrics/calculators/lead-time.js +82 -0
  472. package/dist/src/metrics/calculators/lead-time.js.map +1 -0
  473. package/dist/src/metrics/calculators/mttr.d.ts +21 -0
  474. package/dist/src/metrics/calculators/mttr.d.ts.map +1 -0
  475. package/dist/src/metrics/calculators/mttr.js +60 -0
  476. package/dist/src/metrics/calculators/mttr.js.map +1 -0
  477. package/dist/src/metrics/dora-calculator.d.ts +28 -0
  478. package/dist/src/metrics/dora-calculator.d.ts.map +1 -0
  479. package/dist/src/metrics/dora-calculator.js +117 -0
  480. package/dist/src/metrics/dora-calculator.js.map +1 -0
  481. package/dist/src/metrics/github-client.d.ts +51 -0
  482. package/dist/src/metrics/github-client.d.ts.map +1 -0
  483. package/dist/src/metrics/github-client.js +133 -0
  484. package/dist/src/metrics/github-client.js.map +1 -0
  485. package/dist/src/metrics/report-generator.d.ts +17 -0
  486. package/dist/src/metrics/report-generator.d.ts.map +1 -0
  487. package/dist/src/metrics/report-generator.js +403 -0
  488. package/dist/src/metrics/report-generator.js.map +1 -0
  489. package/dist/src/metrics/types.d.ts +112 -0
  490. package/dist/src/metrics/types.d.ts.map +1 -0
  491. package/dist/src/metrics/types.js +10 -0
  492. package/dist/src/metrics/types.js.map +1 -0
  493. package/dist/src/metrics/utils/percentile.d.ts +25 -0
  494. package/dist/src/metrics/utils/percentile.d.ts.map +1 -0
  495. package/dist/src/metrics/utils/percentile.js +46 -0
  496. package/dist/src/metrics/utils/percentile.js.map +1 -0
  497. package/dist/src/metrics/utils/tier-classifier.d.ts +61 -0
  498. package/dist/src/metrics/utils/tier-classifier.d.ts.map +1 -0
  499. package/dist/src/metrics/utils/tier-classifier.js +100 -0
  500. package/dist/src/metrics/utils/tier-classifier.js.map +1 -0
  501. package/dist/src/testing/test-generator.d.ts +117 -0
  502. package/dist/src/testing/test-generator.d.ts.map +1 -0
  503. package/dist/src/testing/test-generator.js +370 -0
  504. package/dist/src/testing/test-generator.js.map +1 -0
  505. package/dist/src/types/cost-tracking.d.ts +43 -0
  506. package/dist/src/types/cost-tracking.d.ts.map +1 -0
  507. package/dist/src/types/cost-tracking.js +8 -0
  508. package/dist/src/types/cost-tracking.js.map +1 -0
  509. package/dist/src/types/model-selection.d.ts +53 -0
  510. package/dist/src/types/model-selection.d.ts.map +1 -0
  511. package/dist/src/types/model-selection.js +12 -0
  512. package/dist/src/types/model-selection.js.map +1 -0
  513. package/dist/src/utils/agents-md-compiler.d.ts +68 -0
  514. package/dist/src/utils/agents-md-compiler.d.ts.map +1 -0
  515. package/dist/src/utils/agents-md-compiler.js +420 -0
  516. package/dist/src/utils/agents-md-compiler.js.map +1 -0
  517. package/dist/src/utils/auth-helpers.d.ts +58 -0
  518. package/dist/src/utils/auth-helpers.d.ts.map +1 -0
  519. package/dist/src/utils/auth-helpers.js +108 -0
  520. package/dist/src/utils/auth-helpers.js.map +1 -0
  521. package/dist/src/utils/auto-install.d.ts +47 -0
  522. package/dist/src/utils/auto-install.d.ts.map +1 -0
  523. package/dist/src/utils/auto-install.js +211 -0
  524. package/dist/src/utils/auto-install.js.map +1 -0
  525. package/dist/src/utils/claude-cli-detector.d.ts +75 -0
  526. package/dist/src/utils/claude-cli-detector.d.ts.map +1 -0
  527. package/dist/src/utils/claude-cli-detector.js +285 -0
  528. package/dist/src/utils/claude-cli-detector.js.map +1 -0
  529. package/dist/src/utils/cost-reporter.d.ts +58 -0
  530. package/dist/src/utils/cost-reporter.d.ts.map +1 -0
  531. package/dist/src/utils/cost-reporter.js +224 -0
  532. package/dist/src/utils/cost-reporter.js.map +1 -0
  533. package/dist/src/utils/docs-preview/config-generator.d.ts +46 -0
  534. package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -0
  535. package/dist/src/utils/docs-preview/config-generator.js +377 -0
  536. package/dist/src/utils/docs-preview/config-generator.js.map +1 -0
  537. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +38 -0
  538. package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -0
  539. package/dist/src/utils/docs-preview/docusaurus-setup.js +177 -0
  540. package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -0
  541. package/dist/src/utils/docs-preview/index.d.ts +7 -0
  542. package/dist/src/utils/docs-preview/index.d.ts.map +1 -0
  543. package/dist/src/utils/docs-preview/index.js +7 -0
  544. package/dist/src/utils/docs-preview/index.js.map +1 -0
  545. package/dist/src/utils/docs-preview/package-installer.d.ts +42 -0
  546. package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -0
  547. package/dist/src/utils/docs-preview/package-installer.js +182 -0
  548. package/dist/src/utils/docs-preview/package-installer.js.map +1 -0
  549. package/dist/src/utils/docs-preview/server-manager.d.ts +30 -0
  550. package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -0
  551. package/dist/src/utils/docs-preview/server-manager.js +212 -0
  552. package/dist/src/utils/docs-preview/server-manager.js.map +1 -0
  553. package/dist/src/utils/docs-preview/sidebar-builder.d.ts +32 -0
  554. package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -0
  555. package/dist/src/utils/docs-preview/sidebar-builder.js +202 -0
  556. package/dist/src/utils/docs-preview/sidebar-builder.js.map +1 -0
  557. package/dist/src/utils/docs-preview/types.d.ts +57 -0
  558. package/dist/src/utils/docs-preview/types.d.ts.map +1 -0
  559. package/dist/src/utils/docs-preview/types.js +2 -0
  560. package/dist/src/utils/docs-preview/types.js.map +1 -0
  561. package/dist/src/utils/env-file.d.ts +88 -0
  562. package/dist/src/utils/env-file.d.ts.map +1 -0
  563. package/dist/src/utils/env-file.js +180 -0
  564. package/dist/src/utils/env-file.js.map +1 -0
  565. package/dist/src/utils/env-multi-project-parser.d.ts +220 -0
  566. package/dist/src/utils/env-multi-project-parser.d.ts.map +1 -0
  567. package/dist/src/utils/env-multi-project-parser.js +403 -0
  568. package/dist/src/utils/env-multi-project-parser.js.map +1 -0
  569. package/dist/src/utils/esm-helpers.d.ts +50 -0
  570. package/dist/src/utils/esm-helpers.d.ts.map +1 -0
  571. package/dist/src/utils/esm-helpers.js +57 -0
  572. package/dist/src/utils/esm-helpers.js.map +1 -0
  573. package/dist/src/utils/execFileNoThrow.d.ts +99 -0
  574. package/dist/src/utils/execFileNoThrow.d.ts.map +1 -0
  575. package/dist/src/utils/execFileNoThrow.js +137 -0
  576. package/dist/src/utils/execFileNoThrow.js.map +1 -0
  577. package/dist/src/utils/external-resource-validator.d.ts +102 -0
  578. package/dist/src/utils/external-resource-validator.d.ts.map +1 -0
  579. package/dist/src/utils/external-resource-validator.js +400 -0
  580. package/dist/src/utils/external-resource-validator.js.map +1 -0
  581. package/dist/src/utils/generate-skills-index.d.ts +24 -0
  582. package/dist/src/utils/generate-skills-index.d.ts.map +1 -0
  583. package/dist/src/utils/generate-skills-index.js +410 -0
  584. package/dist/src/utils/generate-skills-index.js.map +1 -0
  585. package/dist/src/utils/model-selection.d.ts +75 -0
  586. package/dist/src/utils/model-selection.d.ts.map +1 -0
  587. package/dist/src/utils/model-selection.js +204 -0
  588. package/dist/src/utils/model-selection.js.map +1 -0
  589. package/dist/src/utils/plugin-validator.d.ts +161 -0
  590. package/dist/src/utils/plugin-validator.d.ts.map +1 -0
  591. package/dist/src/utils/plugin-validator.js +558 -0
  592. package/dist/src/utils/plugin-validator.js.map +1 -0
  593. package/dist/src/utils/pricing-constants.d.ts +70 -0
  594. package/dist/src/utils/pricing-constants.d.ts.map +1 -0
  595. package/dist/src/utils/pricing-constants.js +71 -0
  596. package/dist/src/utils/pricing-constants.js.map +1 -0
  597. package/dist/src/utils/project-detection.d.ts +141 -0
  598. package/dist/src/utils/project-detection.d.ts.map +1 -0
  599. package/dist/src/utils/project-detection.js +321 -0
  600. package/dist/src/utils/project-detection.js.map +1 -0
  601. package/dist/src/utils/string-utils.d.ts +40 -0
  602. package/dist/src/utils/string-utils.d.ts.map +1 -0
  603. package/dist/src/utils/string-utils.js +58 -0
  604. package/dist/src/utils/string-utils.js.map +1 -0
  605. package/dist/src/utils/translation.d.ts +187 -0
  606. package/dist/src/utils/translation.d.ts.map +1 -0
  607. package/dist/src/utils/translation.js +414 -0
  608. package/dist/src/utils/translation.js.map +1 -0
  609. package/dist/utils/external-resource-validator.d.ts.map +1 -1
  610. package/dist/utils/external-resource-validator.js +101 -59
  611. package/dist/utils/external-resource-validator.js.map +1 -1
  612. package/dist/utils/plugin-validator.d.ts.map +1 -1
  613. package/dist/utils/plugin-validator.js +0 -7
  614. package/dist/utils/plugin-validator.js.map +1 -1
  615. package/package.json +3 -2
  616. package/plugins/specweave/agents/reflective-reviewer/AGENT.md +535 -0
  617. package/plugins/specweave/hooks/post-first-increment.sh +10 -28
  618. package/plugins/specweave/hooks/post-increment-change.sh +94 -0
  619. package/plugins/specweave/hooks/post-increment-planning.sh +261 -1
  620. package/plugins/specweave/hooks/post-increment-status-change.sh +143 -0
  621. package/plugins/specweave/hooks/post-task-completion.sh +26 -0
  622. package/plugins/specweave/lib/hooks/git-diff-analyzer.ts +269 -0
  623. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +264 -0
  624. package/plugins/specweave/lib/hooks/prepare-reflection-context.ts +178 -0
  625. package/plugins/specweave/lib/hooks/reflection-config-loader.ts +156 -0
  626. package/plugins/specweave/lib/hooks/reflection-parser.ts +484 -0
  627. package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts +306 -0
  628. package/plugins/specweave/lib/hooks/reflection-storage.ts +369 -0
  629. package/plugins/specweave/lib/hooks/run-self-reflection.ts +258 -0
  630. package/plugins/specweave/lib/hooks/sync-living-docs.ts +188 -0
  631. package/plugins/specweave/lib/hooks/translate-file.ts +428 -0
  632. package/plugins/specweave/lib/hooks/translate-living-docs.ts +224 -0
  633. package/plugins/specweave/lib/hooks/types/reflection-types.ts +193 -0
  634. package/plugins/specweave/lib/hooks/update-tasks-md.ts +256 -0
  635. package/plugins/specweave/skills/SKILLS-INDEX.md +2 -2
  636. package/plugins/specweave/skills/increment-planner/SKILL.md +8 -0
  637. package/plugins/specweave/skills/plugin-expert/SKILL.md +0 -4
  638. package/plugins/specweave/skills/plugin-installer/SKILL.md +19 -21
  639. package/plugins/specweave/skills/plugin-validator/SKILL.md +0 -1
  640. package/plugins/specweave/skills/project-kickstarter/SKILL.md +3 -3
  641. package/plugins/specweave/skills/spec-generator/SKILL.md +3 -3
  642. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +21 -0
  643. package/plugins/specweave-docs-preview/commands/build.md +489 -0
  644. package/plugins/specweave-docs-preview/commands/preview.md +330 -0
  645. package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +386 -0
  646. package/plugins/specweave-github/commands/specweave-github-sync-from.md +147 -0
  647. package/plugins/specweave-github/lib/cli-sync-increment-changes.ts +33 -0
  648. package/plugins/specweave-github/lib/github-issue-updater.ts +449 -0
  649. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +342 -0
  650. package/plugins/specweave-github/lib/github-sync-increment-changes.ts +380 -0
  651. package/src/templates/AGENTS.md.template +55 -9
  652. package/plugins/specweave/skills/translator/SKILL.md.bak +0 -172
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Reflection Configuration Loader
3
+ *
4
+ * Loads and validates reflection configuration from .specweave/config.json
5
+ * Merges user config with defaults, validates against schema
6
+ *
7
+ * @module reflection-config-loader
8
+ */
9
+
10
+ import fs from 'fs-extra';
11
+ import path from 'path';
12
+ import { DEFAULT_REFLECTION_CONFIG, ReflectionConfig } from './types/reflection-types';
13
+
14
+ /**
15
+ * Find .specweave directory by traversing up from current directory
16
+ * @param startDir Starting directory (defaults to cwd)
17
+ * @returns Path to .specweave directory or null if not found
18
+ */
19
+ export function findSpecweaveRoot(startDir: string = process.cwd()): string | null {
20
+ let currentDir = startDir;
21
+ const root = path.parse(currentDir).root;
22
+
23
+ while (currentDir !== root) {
24
+ const specweavePath = path.join(currentDir, '.specweave');
25
+ if (fs.existsSync(specweavePath)) {
26
+ return currentDir;
27
+ }
28
+ currentDir = path.dirname(currentDir);
29
+ }
30
+
31
+ return null;
32
+ }
33
+
34
+ /**
35
+ * Load reflection configuration from .specweave/config.json
36
+ * Falls back to defaults if config file doesn't exist or reflection section is missing
37
+ *
38
+ * @param projectRoot Path to project root (optional, auto-detected if not provided)
39
+ * @returns Merged reflection configuration
40
+ * @throws Error if config file exists but has invalid JSON
41
+ */
42
+ export function loadReflectionConfig(projectRoot?: string): ReflectionConfig {
43
+ // Auto-detect project root if not provided
44
+ const rootDir = projectRoot || findSpecweaveRoot();
45
+
46
+ if (!rootDir) {
47
+ // No .specweave directory found, return defaults
48
+ return { ...DEFAULT_REFLECTION_CONFIG };
49
+ }
50
+
51
+ const configPath = path.join(rootDir, '.specweave', 'config.json');
52
+
53
+ // Config file doesn't exist, return defaults
54
+ if (!fs.existsSync(configPath)) {
55
+ return { ...DEFAULT_REFLECTION_CONFIG };
56
+ }
57
+
58
+ try {
59
+ // Read and parse config file
60
+ const configContent = fs.readFileSync(configPath, 'utf-8');
61
+ const config = JSON.parse(configContent);
62
+
63
+ // Extract reflection section (may be undefined)
64
+ const userReflectionConfig = config.reflection || {};
65
+
66
+ // Deep merge with defaults (user config overrides defaults)
67
+ const mergedConfig: ReflectionConfig = {
68
+ enabled: userReflectionConfig.enabled ?? DEFAULT_REFLECTION_CONFIG.enabled,
69
+ mode: userReflectionConfig.mode ?? DEFAULT_REFLECTION_CONFIG.mode,
70
+ depth: userReflectionConfig.depth ?? DEFAULT_REFLECTION_CONFIG.depth,
71
+ model: userReflectionConfig.model ?? DEFAULT_REFLECTION_CONFIG.model,
72
+ categories: {
73
+ security: userReflectionConfig.categories?.security ?? DEFAULT_REFLECTION_CONFIG.categories.security,
74
+ quality: userReflectionConfig.categories?.quality ?? DEFAULT_REFLECTION_CONFIG.categories.quality,
75
+ testing: userReflectionConfig.categories?.testing ?? DEFAULT_REFLECTION_CONFIG.categories.testing,
76
+ performance: userReflectionConfig.categories?.performance ?? DEFAULT_REFLECTION_CONFIG.categories.performance,
77
+ technicalDebt: userReflectionConfig.categories?.technicalDebt ?? DEFAULT_REFLECTION_CONFIG.categories.technicalDebt,
78
+ },
79
+ criticalThreshold: userReflectionConfig.criticalThreshold ?? DEFAULT_REFLECTION_CONFIG.criticalThreshold,
80
+ storeReflections: userReflectionConfig.storeReflections ?? DEFAULT_REFLECTION_CONFIG.storeReflections,
81
+ autoCreateFollowUpTasks: userReflectionConfig.autoCreateFollowUpTasks ?? DEFAULT_REFLECTION_CONFIG.autoCreateFollowUpTasks,
82
+ soundNotifications: userReflectionConfig.soundNotifications ?? DEFAULT_REFLECTION_CONFIG.soundNotifications,
83
+ };
84
+
85
+ return mergedConfig;
86
+ } catch (error) {
87
+ // Invalid JSON or other error
88
+ if (error instanceof SyntaxError) {
89
+ throw new Error(`Invalid JSON in config file: ${configPath}. ${error.message}`);
90
+ }
91
+ throw error;
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Validate reflection configuration against constraints
97
+ * Checks for logical inconsistencies (e.g., all categories disabled)
98
+ *
99
+ * @param config Reflection configuration to validate
100
+ * @returns Validation result with errors array
101
+ */
102
+ export function validateReflectionConfig(config: ReflectionConfig): {
103
+ valid: boolean;
104
+ errors: string[];
105
+ } {
106
+ const errors: string[] = [];
107
+
108
+ // Check: If reflection enabled, at least one category must be enabled
109
+ if (config.enabled && config.mode !== 'disabled') {
110
+ const hasEnabledCategory = Object.values(config.categories).some(enabled => enabled);
111
+ if (!hasEnabledCategory) {
112
+ errors.push('At least one analysis category must be enabled when reflection is active');
113
+ }
114
+ }
115
+
116
+ // Check: Mode cannot be 'auto' if reflection is disabled
117
+ if (!config.enabled && config.mode === 'auto') {
118
+ errors.push('Reflection mode cannot be "auto" when reflection is disabled');
119
+ }
120
+
121
+ // Check: Sound notifications require reflection to be enabled
122
+ if (config.soundNotifications && !config.enabled) {
123
+ errors.push('Sound notifications require reflection to be enabled');
124
+ }
125
+
126
+ // Check: Auto-create follow-up tasks requires storeReflections
127
+ if (config.autoCreateFollowUpTasks && !config.storeReflections) {
128
+ errors.push('Auto-create follow-up tasks requires storeReflections to be enabled');
129
+ }
130
+
131
+ return {
132
+ valid: errors.length === 0,
133
+ errors
134
+ };
135
+ }
136
+
137
+ /**
138
+ * Load and validate reflection configuration
139
+ * Throws error if configuration is invalid
140
+ *
141
+ * @param projectRoot Path to project root (optional, auto-detected if not provided)
142
+ * @returns Valid reflection configuration
143
+ * @throws Error if configuration is invalid
144
+ */
145
+ export function loadAndValidateReflectionConfig(projectRoot?: string): ReflectionConfig {
146
+ const config = loadReflectionConfig(projectRoot);
147
+ const validation = validateReflectionConfig(config);
148
+
149
+ if (!validation.valid) {
150
+ throw new Error(
151
+ `Invalid reflection configuration:\n${validation.errors.map(e => ` - ${e}`).join('\n')}`
152
+ );
153
+ }
154
+
155
+ return config;
156
+ }
@@ -0,0 +1,484 @@
1
+ /**
2
+ * Reflection Parser
3
+ *
4
+ * Parses markdown output from reflective-reviewer agent
5
+ * Extracts structured data (issues, metrics, lessons learned, etc.)
6
+ *
7
+ * @module reflection-parser
8
+ */
9
+
10
+ import {
11
+ ReflectionResult,
12
+ ReflectionIssue,
13
+ IssueSeverity,
14
+ IssueCategory,
15
+ LessonLearned,
16
+ ReflectionMetrics,
17
+ ReflectionModel
18
+ } from './types/reflection-types';
19
+
20
+ /**
21
+ * Extract section content by heading
22
+ * @param markdown Markdown content
23
+ * @param heading Section heading to find (e.g., "## What Was Accomplished")
24
+ * @returns Section content (text after heading until next heading or end)
25
+ */
26
+ function extractSection(markdown: string, heading: string): string {
27
+ const headingRegex = new RegExp(`^${heading}\\s*$`, 'mi');
28
+ const match = markdown.match(headingRegex);
29
+
30
+ if (!match || match.index === undefined) {
31
+ return '';
32
+ }
33
+
34
+ const startIndex = match.index + match[0].length;
35
+ const afterHeading = markdown.slice(startIndex);
36
+
37
+ // Find next heading at same or higher level
38
+ const nextHeadingMatch = afterHeading.match(/^#{1,3}\s+/m);
39
+ const endIndex = nextHeadingMatch?.index ?? afterHeading.length;
40
+
41
+ return afterHeading.slice(0, endIndex).trim();
42
+ }
43
+
44
+ /**
45
+ * Parse accomplishments from "What Was Accomplished" section
46
+ * @param markdown Reflection markdown
47
+ * @returns Array of accomplishment strings
48
+ */
49
+ function parseAccomplishments(markdown: string): string[] {
50
+ const section = extractSection(markdown, '## ✅ What Was Accomplished');
51
+ if (!section) return [];
52
+
53
+ // Extract bullet points and paragraphs
54
+ const lines = section.split('\n').filter(line => line.trim());
55
+ const accomplishments: string[] = [];
56
+
57
+ for (const line of lines) {
58
+ const trimmed = line.trim();
59
+ // Match bullet points (-, *, +) or numbered lists (1., 2.)
60
+ if (/^[-*+]\s+/.test(trimmed) || /^\d+\.\s+/.test(trimmed)) {
61
+ accomplishments.push(trimmed.replace(/^[-*+\d.]\s+/, '').trim());
62
+ } else if (trimmed.length > 10 && !trimmed.startsWith('#')) {
63
+ // Include non-heading paragraphs
64
+ accomplishments.push(trimmed);
65
+ }
66
+ }
67
+
68
+ return accomplishments;
69
+ }
70
+
71
+ /**
72
+ * Parse strengths from "Quality Assessment" section
73
+ * @param markdown Reflection markdown
74
+ * @returns Array of strength strings
75
+ */
76
+ function parseStrengths(markdown: string): string[] {
77
+ const section = extractSection(markdown, '### ✅ Strengths');
78
+ if (!section) return [];
79
+
80
+ const lines = section.split('\n').filter(line => line.trim());
81
+ const strengths: string[] = [];
82
+
83
+ for (const line of lines) {
84
+ const trimmed = line.trim();
85
+ if (trimmed.startsWith('- ✅') || trimmed.startsWith('✅')) {
86
+ strengths.push(trimmed.replace(/^[-*+]?\s*✅\s*/, '').trim());
87
+ }
88
+ }
89
+
90
+ return strengths;
91
+ }
92
+
93
+ /**
94
+ * Parse severity from issue description
95
+ * @param text Issue text (e.g., "**CRITICAL (SECURITY)**")
96
+ * @returns Issue severity enum or undefined
97
+ */
98
+ function parseSeverity(text: string): IssueSeverity | undefined {
99
+ if (/CRITICAL/i.test(text)) return IssueSeverity.CRITICAL;
100
+ if (/HIGH/i.test(text)) return IssueSeverity.HIGH;
101
+ if (/MEDIUM/i.test(text)) return IssueSeverity.MEDIUM;
102
+ if (/LOW/i.test(text)) return IssueSeverity.LOW;
103
+ return undefined;
104
+ }
105
+
106
+ /**
107
+ * Parse category from issue description
108
+ * @param text Issue text (e.g., "**CRITICAL (SECURITY)**")
109
+ * @returns Issue category enum or undefined
110
+ */
111
+ function parseCategory(text: string): IssueCategory | undefined {
112
+ if (/SECURITY/i.test(text)) return IssueCategory.SECURITY;
113
+ if (/QUALITY/i.test(text)) return IssueCategory.QUALITY;
114
+ if (/TESTING/i.test(text)) return IssueCategory.TESTING;
115
+ if (/PERFORMANCE/i.test(text)) return IssueCategory.PERFORMANCE;
116
+ if (/TECHNICAL[_\s]DEBT/i.test(text)) return IssueCategory.TECHNICAL_DEBT;
117
+ return undefined;
118
+ }
119
+
120
+ /**
121
+ * Parse location from issue text
122
+ * @param text Issue text (may contain **Location**: `path/to/file.ts:123`)
123
+ * @returns Location object or undefined
124
+ */
125
+ function parseLocation(text: string): ReflectionIssue['location'] | undefined {
126
+ // Match: **Location**: `path/to/file.ts:123`
127
+ const locationMatch = text.match(/\*\*Location\*\*:\s*`([^`]+)`/i);
128
+ if (!locationMatch) return undefined;
129
+
130
+ const locationStr = locationMatch[1];
131
+ const [file, lineStr] = locationStr.split(':');
132
+ const line = lineStr ? parseInt(lineStr, 10) : undefined;
133
+
134
+ return {
135
+ file: file.trim(),
136
+ line
137
+ };
138
+ }
139
+
140
+ /**
141
+ * Parse issues from "Issues Identified" section
142
+ * @param markdown Reflection markdown
143
+ * @returns Array of ReflectionIssue objects
144
+ */
145
+ function parseIssues(markdown: string): ReflectionIssue[] {
146
+ const section = extractSection(markdown, '### ⚠️ Issues Identified');
147
+ if (!section) return [];
148
+
149
+ const issues: ReflectionIssue[] = [];
150
+ const lines = section.split('\n');
151
+
152
+ let currentIssue: Partial<ReflectionIssue> | null = null;
153
+ let currentField: 'description' | 'impact' | 'recommendation' | null = null;
154
+
155
+ for (const line of lines) {
156
+ const trimmed = line.trim();
157
+
158
+ // Check for severity/category header (e.g., "**CRITICAL (SECURITY)**")
159
+ const headerMatch = trimmed.match(/^\*\*(CRITICAL|HIGH|MEDIUM|LOW)\s*\(([^)]+)\)\*\*/i);
160
+ if (headerMatch) {
161
+ // Save previous issue
162
+ if (currentIssue && currentIssue.severity && currentIssue.category && currentIssue.description) {
163
+ issues.push(currentIssue as ReflectionIssue);
164
+ }
165
+
166
+ // Start new issue
167
+ currentIssue = {
168
+ severity: parseSeverity(headerMatch[1])!,
169
+ category: parseCategory(headerMatch[2])!,
170
+ description: '',
171
+ impact: '',
172
+ recommendation: ''
173
+ };
174
+ currentField = null;
175
+ continue;
176
+ }
177
+
178
+ // Check for issue bullet point (❌ or ⚠️)
179
+ if ((trimmed.startsWith('- ❌') || trimmed.startsWith('❌') || trimmed.startsWith('- ⚠️')) && currentIssue) {
180
+ currentField = 'description';
181
+ const descText = trimmed.replace(/^[-*+]?\s*[❌⚠️]\s*/, '').trim();
182
+ currentIssue.description = descText;
183
+ continue;
184
+ }
185
+
186
+ // Check for Impact field
187
+ if (trimmed.startsWith('- **Impact**:') || trimmed.startsWith('**Impact**:')) {
188
+ currentField = 'impact';
189
+ const impactText = trimmed.replace(/^[-*+]?\s*\*\*Impact\*\*:\s*/, '').trim();
190
+ if (currentIssue) currentIssue.impact = impactText;
191
+ continue;
192
+ }
193
+
194
+ // Check for Recommendation field
195
+ if (trimmed.startsWith('- **Recommendation**:') || trimmed.startsWith('**Recommendation**:')) {
196
+ currentField = 'recommendation';
197
+ const recText = trimmed.replace(/^[-*+]?\s*\*\*Recommendation\*\*:\s*/, '').trim();
198
+ if (currentIssue) currentIssue.recommendation = recText;
199
+ continue;
200
+ }
201
+
202
+ // Check for Location field
203
+ if (trimmed.startsWith('- **Location**:') || trimmed.startsWith('**Location**:')) {
204
+ if (currentIssue) {
205
+ const location = parseLocation(trimmed);
206
+ if (location) currentIssue.location = location;
207
+ }
208
+ currentField = null;
209
+ continue;
210
+ }
211
+
212
+ // Append continuation lines to current field
213
+ if (currentField && currentIssue && trimmed && !trimmed.startsWith('#')) {
214
+ const fieldValue = currentIssue[currentField] || '';
215
+ currentIssue[currentField] = fieldValue + ' ' + trimmed;
216
+ }
217
+ }
218
+
219
+ // Save last issue
220
+ if (currentIssue && currentIssue.severity && currentIssue.category && currentIssue.description) {
221
+ issues.push(currentIssue as ReflectionIssue);
222
+ }
223
+
224
+ return issues;
225
+ }
226
+
227
+ /**
228
+ * Parse recommended actions from "Recommended Follow-Up Actions" section
229
+ * @param markdown Reflection markdown
230
+ * @returns Recommended actions object with priority levels
231
+ */
232
+ function parseRecommendedActions(markdown: string): ReflectionResult['recommendedActions'] {
233
+ const section = extractSection(markdown, '## 🔧 Recommended Follow-Up Actions');
234
+
235
+ const actions = {
236
+ priority1: [] as string[],
237
+ priority2: [] as string[],
238
+ priority3: [] as string[]
239
+ };
240
+
241
+ if (!section) return actions;
242
+
243
+ const lines = section.split('\n');
244
+ let currentPriority: 'priority1' | 'priority2' | 'priority3' | null = null;
245
+
246
+ for (const line of lines) {
247
+ const trimmed = line.trim();
248
+
249
+ // Check for priority headers
250
+ if (/Priority 1|MUST FIX/i.test(trimmed)) {
251
+ currentPriority = 'priority1';
252
+ continue;
253
+ }
254
+ if (/Priority 2|SHOULD FIX/i.test(trimmed)) {
255
+ currentPriority = 'priority2';
256
+ continue;
257
+ }
258
+ if (/Priority 3|NICE TO HAVE/i.test(trimmed)) {
259
+ currentPriority = 'priority3';
260
+ continue;
261
+ }
262
+
263
+ // Parse action items (numbered or bulleted)
264
+ if (currentPriority && (/^\d+\.\s/.test(trimmed) || /^[-*+]\s/.test(trimmed))) {
265
+ const actionText = trimmed.replace(/^(\d+\.|-|\*|\+)\s+/, '').trim();
266
+ if (actionText.length > 0) {
267
+ actions[currentPriority].push(actionText);
268
+ }
269
+ }
270
+ }
271
+
272
+ return actions;
273
+ }
274
+
275
+ /**
276
+ * Parse lessons learned from "Lessons Learned" section
277
+ * @param markdown Reflection markdown
278
+ * @returns LessonLearned object
279
+ */
280
+ function parseLessonsLearned(markdown: string): LessonLearned {
281
+ const section = extractSection(markdown, '## 📚 Lessons Learned');
282
+
283
+ const lessons: LessonLearned = {
284
+ whatWentWell: [],
285
+ whatCouldImprove: [],
286
+ forNextTime: []
287
+ };
288
+
289
+ if (!section) return lessons;
290
+
291
+ const lines = section.split('\n');
292
+ let currentCategory: 'whatWentWell' | 'whatCouldImprove' | 'forNextTime' | null = null;
293
+
294
+ for (const line of lines) {
295
+ const trimmed = line.trim();
296
+
297
+ // Check for category headers
298
+ if (/What went well/i.test(trimmed)) {
299
+ currentCategory = 'whatWentWell';
300
+ continue;
301
+ }
302
+ if (/What could improve/i.test(trimmed)) {
303
+ currentCategory = 'whatCouldImprove';
304
+ continue;
305
+ }
306
+ if (/For next time/i.test(trimmed)) {
307
+ currentCategory = 'forNextTime';
308
+ continue;
309
+ }
310
+
311
+ // Parse bullet points
312
+ if (currentCategory && /^[-*+]\s/.test(trimmed)) {
313
+ const text = trimmed.replace(/^[-*+]\s+/, '').trim();
314
+ if (text.length > 0) {
315
+ lessons[currentCategory].push(text);
316
+ }
317
+ }
318
+ }
319
+
320
+ return lessons;
321
+ }
322
+
323
+ /**
324
+ * Parse metrics from "Metrics" section
325
+ * @param markdown Reflection markdown
326
+ * @returns ReflectionMetrics object
327
+ */
328
+ function parseMetrics(markdown: string): ReflectionMetrics {
329
+ const section = extractSection(markdown, '## 📊 Metrics');
330
+
331
+ const metrics: ReflectionMetrics = {
332
+ codeQuality: 5,
333
+ security: 5,
334
+ testCoverage: undefined,
335
+ technicalDebt: 'MEDIUM',
336
+ performance: 'ACCEPTABLE'
337
+ };
338
+
339
+ if (!section) return metrics;
340
+
341
+ // Parse Code Quality (1-10)
342
+ const qualityMatch = section.match(/Code Quality.*?(\d+)/i);
343
+ if (qualityMatch) {
344
+ metrics.codeQuality = parseInt(qualityMatch[1], 10);
345
+ }
346
+
347
+ // Parse Security (1-10)
348
+ const securityMatch = section.match(/Security.*?(\d+)/i);
349
+ if (securityMatch) {
350
+ metrics.security = parseInt(securityMatch[1], 10);
351
+ }
352
+
353
+ // Parse Test Coverage (percentage)
354
+ const coverageMatch = section.match(/Test Coverage.*?(\d+)%/i);
355
+ if (coverageMatch) {
356
+ metrics.testCoverage = parseInt(coverageMatch[1], 10);
357
+ }
358
+
359
+ // Parse Technical Debt (LOW/MEDIUM/HIGH)
360
+ const debtMatch = section.match(/Technical Debt.*?(LOW|MEDIUM|HIGH)/i);
361
+ if (debtMatch) {
362
+ metrics.technicalDebt = debtMatch[1].toUpperCase() as 'LOW' | 'MEDIUM' | 'HIGH';
363
+ }
364
+
365
+ // Parse Performance (GOOD/ACCEPTABLE/NEEDS WORK)
366
+ const perfMatch = section.match(/Performance.*?(GOOD|ACCEPTABLE|NEEDS[\s_]WORK)/i);
367
+ if (perfMatch) {
368
+ metrics.performance = perfMatch[1].toUpperCase().replace(/[\s_]/g, '_') as 'GOOD' | 'ACCEPTABLE' | 'NEEDS_WORK';
369
+ }
370
+
371
+ return metrics;
372
+ }
373
+
374
+ /**
375
+ * Parse complete reflection result from markdown
376
+ * Main parsing function
377
+ *
378
+ * @param markdown Reflection markdown from reflective-reviewer agent
379
+ * @param taskName Task name for result
380
+ * @param model Model used for reflection
381
+ * @param reflectionTime Time taken in seconds
382
+ * @param estimatedCost Estimated cost in USD
383
+ * @returns Complete ReflectionResult object
384
+ */
385
+ export function parseReflectionMarkdown(
386
+ markdown: string,
387
+ taskName: string,
388
+ model: ReflectionModel = ReflectionModel.HAIKU,
389
+ reflectionTime: number = 0,
390
+ estimatedCost: number = 0
391
+ ): ReflectionResult {
392
+ const result: ReflectionResult = {
393
+ taskName,
394
+ completed: new Date().toISOString(),
395
+ duration: reflectionTime > 0 ? `${reflectionTime}s` : undefined,
396
+ filesModified: {
397
+ count: 0,
398
+ linesAdded: 0,
399
+ linesRemoved: 0
400
+ },
401
+ accomplishments: parseAccomplishments(markdown),
402
+ strengths: parseStrengths(markdown),
403
+ issues: parseIssues(markdown),
404
+ recommendedActions: parseRecommendedActions(markdown),
405
+ lessonsLearned: parseLessonsLearned(markdown),
406
+ metrics: parseMetrics(markdown),
407
+ metadata: {
408
+ model,
409
+ reflectionTime,
410
+ estimatedCost
411
+ }
412
+ };
413
+
414
+ // Extract file modification stats from markdown if present
415
+ const filesChangedMatch = markdown.match(/\*\*Files Modified\*\*:\s*(\d+)\s*files?,\s*\+(\d+)\s*-(\d+)/i);
416
+ if (filesChangedMatch) {
417
+ result.filesModified = {
418
+ count: parseInt(filesChangedMatch[1], 10),
419
+ linesAdded: parseInt(filesChangedMatch[2], 10),
420
+ linesRemoved: parseInt(filesChangedMatch[3], 10)
421
+ };
422
+ }
423
+
424
+ return result;
425
+ }
426
+
427
+ /**
428
+ * Validate parsed reflection result
429
+ * Checks for required fields and data quality
430
+ *
431
+ * @param result Parsed reflection result
432
+ * @returns Validation result with errors
433
+ */
434
+ export function validateReflectionResult(result: ReflectionResult): {
435
+ valid: boolean;
436
+ errors: string[];
437
+ } {
438
+ const errors: string[] = [];
439
+
440
+ // Check required fields
441
+ if (!result.taskName) {
442
+ errors.push('Missing task name');
443
+ }
444
+
445
+ if (!result.completed) {
446
+ errors.push('Missing completion timestamp');
447
+ }
448
+
449
+ // Check for meaningful content
450
+ if (result.accomplishments.length === 0 && result.strengths.length === 0) {
451
+ errors.push('No accomplishments or strengths identified (reflection too sparse)');
452
+ }
453
+
454
+ // Validate metrics
455
+ if (result.metrics.codeQuality < 1 || result.metrics.codeQuality > 10) {
456
+ errors.push('Code quality must be 1-10');
457
+ }
458
+
459
+ if (result.metrics.security < 1 || result.metrics.security > 10) {
460
+ errors.push('Security must be 1-10');
461
+ }
462
+
463
+ if (result.metrics.testCoverage !== undefined && (result.metrics.testCoverage < 0 || result.metrics.testCoverage > 100)) {
464
+ errors.push('Test coverage must be 0-100%');
465
+ }
466
+
467
+ // Validate issues have required fields
468
+ for (const issue of result.issues) {
469
+ if (!issue.description) {
470
+ errors.push('Issue missing description');
471
+ }
472
+ if (!issue.impact) {
473
+ errors.push('Issue missing impact explanation');
474
+ }
475
+ if (!issue.recommendation) {
476
+ errors.push('Issue missing recommendation');
477
+ }
478
+ }
479
+
480
+ return {
481
+ valid: errors.length === 0,
482
+ errors
483
+ };
484
+ }