specweave 0.18.0 → 0.20.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 (428) hide show
  1. package/CLAUDE.md +229 -1817
  2. package/README.md +68 -0
  3. package/bin/specweave.js +62 -6
  4. package/dist/locales/de/.gitkeep +0 -0
  5. package/dist/locales/de/cli.json +108 -0
  6. package/dist/locales/en/cli.json +287 -0
  7. package/dist/locales/en/errors.json +7 -0
  8. package/dist/locales/en/templates.json +6 -0
  9. package/dist/locales/es/.gitkeep +0 -0
  10. package/dist/locales/es/cli.json +41 -0
  11. package/dist/locales/fr/.gitkeep +0 -0
  12. package/dist/locales/fr/cli.json +108 -0
  13. package/dist/locales/ja/.gitkeep +0 -0
  14. package/dist/locales/ja/cli.json +108 -0
  15. package/dist/locales/ko/.gitkeep +0 -0
  16. package/dist/locales/ko/cli.json +108 -0
  17. package/dist/locales/pt/.gitkeep +0 -0
  18. package/dist/locales/pt/cli.json +108 -0
  19. package/dist/locales/ru/.gitkeep +0 -0
  20. package/dist/locales/ru/cli.json +269 -0
  21. package/dist/locales/zh/.gitkeep +0 -0
  22. package/dist/locales/zh/cli.json +108 -0
  23. package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
  24. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +3 -0
  25. package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
  26. package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts +21 -0
  27. package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts.map +1 -0
  28. package/dist/plugins/specweave/lib/hooks/update-ac-status.js +162 -0
  29. package/dist/plugins/specweave/lib/hooks/update-ac-status.js.map +1 -0
  30. package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.d.ts.map +1 -1
  31. package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js +65 -6
  32. package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js.map +1 -1
  33. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +25 -0
  34. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +1 -0
  35. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +191 -0
  36. package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +1 -0
  37. package/dist/plugins/specweave-github/lib/completion-calculator.d.ts +112 -0
  38. package/dist/plugins/specweave-github/lib/completion-calculator.d.ts.map +1 -0
  39. package/dist/plugins/specweave-github/lib/completion-calculator.js +301 -0
  40. package/dist/plugins/specweave-github/lib/completion-calculator.js.map +1 -0
  41. package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +3 -3
  42. package/dist/plugins/specweave-github/lib/duplicate-detector.js +3 -3
  43. package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts +70 -0
  44. package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +1 -0
  45. package/dist/plugins/specweave-github/lib/epic-content-builder.js +258 -0
  46. package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +1 -0
  47. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts +14 -0
  48. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
  49. package/dist/plugins/specweave-github/lib/github-client-v2.js +51 -0
  50. package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
  51. package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +2 -2
  52. package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -1
  53. package/dist/plugins/specweave-github/lib/github-epic-sync.js +20 -5
  54. package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -1
  55. package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts +87 -0
  56. package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -0
  57. package/dist/plugins/specweave-github/lib/github-feature-sync.js +412 -0
  58. package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -0
  59. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  60. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +64 -13
  61. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  62. package/dist/plugins/specweave-github/lib/progress-comment-builder.d.ts +78 -0
  63. package/dist/plugins/specweave-github/lib/progress-comment-builder.d.ts.map +1 -0
  64. package/dist/plugins/specweave-github/lib/progress-comment-builder.js +237 -0
  65. package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -0
  66. package/dist/plugins/specweave-github/lib/user-story-content-builder.d.ts +97 -0
  67. package/dist/plugins/specweave-github/lib/user-story-content-builder.d.ts.map +1 -0
  68. package/dist/plugins/specweave-github/lib/user-story-content-builder.js +301 -0
  69. package/dist/plugins/specweave-github/lib/user-story-content-builder.js.map +1 -0
  70. package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts +83 -0
  71. package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -0
  72. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +386 -0
  73. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -0
  74. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +28 -0
  75. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +1 -0
  76. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +156 -0
  77. package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +1 -0
  78. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts +57 -0
  79. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.d.ts.map +1 -0
  80. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +248 -0
  81. package/dist/plugins/specweave-kafka/lib/cli/kcat-wrapper.js.map +1 -0
  82. package/dist/plugins/specweave-kafka/lib/cli/types.d.ts +82 -0
  83. package/dist/plugins/specweave-kafka/lib/cli/types.d.ts.map +1 -0
  84. package/dist/plugins/specweave-kafka/lib/cli/types.js +13 -0
  85. package/dist/plugins/specweave-kafka/lib/cli/types.js.map +1 -0
  86. package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts +49 -0
  87. package/dist/plugins/specweave-kafka/lib/mcp/detector.d.ts.map +1 -0
  88. package/dist/plugins/specweave-kafka/lib/mcp/detector.js +316 -0
  89. package/dist/plugins/specweave-kafka/lib/mcp/detector.js.map +1 -0
  90. package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts +70 -0
  91. package/dist/plugins/specweave-kafka/lib/mcp/types.d.ts.map +1 -0
  92. package/dist/plugins/specweave-kafka/lib/mcp/types.js +23 -0
  93. package/dist/plugins/specweave-kafka/lib/mcp/types.js.map +1 -0
  94. package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts +85 -0
  95. package/dist/plugins/specweave-kafka/lib/utils/partitioning.d.ts.map +1 -0
  96. package/dist/plugins/specweave-kafka/lib/utils/partitioning.js +281 -0
  97. package/dist/plugins/specweave-kafka/lib/utils/partitioning.js.map +1 -0
  98. package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts +75 -0
  99. package/dist/plugins/specweave-kafka/lib/utils/sizing.d.ts.map +1 -0
  100. package/dist/plugins/specweave-kafka/lib/utils/sizing.js +238 -0
  101. package/dist/plugins/specweave-kafka/lib/utils/sizing.js.map +1 -0
  102. package/dist/spec-parser.js +629 -0
  103. package/dist/src/cli/commands/import-docs.js +4 -4
  104. package/dist/src/cli/commands/import-docs.js.map +1 -1
  105. package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -1
  106. package/dist/src/cli/commands/init-multiproject.js +17 -18
  107. package/dist/src/cli/commands/init-multiproject.js.map +1 -1
  108. package/dist/src/cli/commands/init.d.ts.map +1 -1
  109. package/dist/src/cli/commands/init.js +107 -3
  110. package/dist/src/cli/commands/init.js.map +1 -1
  111. package/dist/src/cli/commands/migrate-to-multiproject.d.ts.map +1 -1
  112. package/dist/src/cli/commands/migrate-to-multiproject.js +8 -4
  113. package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
  114. package/dist/src/cli/commands/switch-project.d.ts.map +1 -1
  115. package/dist/src/cli/commands/switch-project.js +9 -26
  116. package/dist/src/cli/commands/switch-project.js.map +1 -1
  117. package/dist/src/cli/commands/sync-spec-content.js +3 -0
  118. package/dist/src/cli/commands/sync-spec-content.js.map +1 -1
  119. package/dist/src/core/deduplication/command-deduplicator.d.ts +166 -0
  120. package/dist/src/core/deduplication/command-deduplicator.d.ts.map +1 -0
  121. package/dist/src/core/deduplication/command-deduplicator.js +254 -0
  122. package/dist/src/core/deduplication/command-deduplicator.js.map +1 -0
  123. package/dist/src/core/increment/active-increment-manager.d.ts +42 -15
  124. package/dist/src/core/increment/active-increment-manager.d.ts.map +1 -1
  125. package/dist/src/core/increment/active-increment-manager.js +113 -46
  126. package/dist/src/core/increment/active-increment-manager.js.map +1 -1
  127. package/dist/src/core/increment/conflict-resolver.d.ts +40 -0
  128. package/dist/src/core/increment/conflict-resolver.d.ts.map +1 -0
  129. package/dist/src/core/increment/conflict-resolver.js +219 -0
  130. package/dist/src/core/increment/conflict-resolver.js.map +1 -0
  131. package/dist/src/core/increment/discipline-checker.d.ts.map +1 -1
  132. package/dist/src/core/increment/discipline-checker.js +7 -1
  133. package/dist/src/core/increment/discipline-checker.js.map +1 -1
  134. package/dist/src/core/increment/duplicate-detector.d.ts +52 -0
  135. package/dist/src/core/increment/duplicate-detector.d.ts.map +1 -0
  136. package/dist/src/core/increment/duplicate-detector.js +276 -0
  137. package/dist/src/core/increment/duplicate-detector.js.map +1 -0
  138. package/dist/src/core/increment/increment-archiver.d.ts +90 -0
  139. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -0
  140. package/dist/src/core/increment/increment-archiver.js +368 -0
  141. package/dist/src/core/increment/increment-archiver.js.map +1 -0
  142. package/dist/src/core/increment/increment-reopener.d.ts +165 -0
  143. package/dist/src/core/increment/increment-reopener.d.ts.map +1 -0
  144. package/dist/src/core/increment/increment-reopener.js +390 -0
  145. package/dist/src/core/increment/increment-reopener.js.map +1 -0
  146. package/dist/src/core/increment/metadata-manager.d.ts +26 -1
  147. package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
  148. package/dist/src/core/increment/metadata-manager.js +143 -5
  149. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  150. package/dist/src/core/increment/recent-work-scanner.d.ts +121 -0
  151. package/dist/src/core/increment/recent-work-scanner.d.ts.map +1 -0
  152. package/dist/src/core/increment/recent-work-scanner.js +303 -0
  153. package/dist/src/core/increment/recent-work-scanner.js.map +1 -0
  154. package/dist/src/core/increment/types.d.ts +1 -0
  155. package/dist/src/core/increment/types.d.ts.map +1 -1
  156. package/dist/src/core/increment-utils.d.ts +112 -0
  157. package/dist/src/core/increment-utils.d.ts.map +1 -0
  158. package/dist/src/core/increment-utils.js +210 -0
  159. package/dist/src/core/increment-utils.js.map +1 -0
  160. package/dist/src/core/living-docs/ac-project-specific-generator.d.ts +65 -0
  161. package/dist/src/core/living-docs/ac-project-specific-generator.d.ts.map +1 -0
  162. package/dist/src/core/living-docs/ac-project-specific-generator.js +175 -0
  163. package/dist/src/core/living-docs/ac-project-specific-generator.js.map +1 -0
  164. package/dist/src/core/living-docs/feature-archiver.d.ts +130 -0
  165. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -0
  166. package/dist/src/core/living-docs/feature-archiver.js +549 -0
  167. package/dist/src/core/living-docs/feature-archiver.js.map +1 -0
  168. package/dist/src/core/living-docs/feature-id-manager.d.ts +81 -0
  169. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -0
  170. package/dist/src/core/living-docs/feature-id-manager.js +339 -0
  171. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -0
  172. package/dist/src/core/living-docs/hierarchy-mapper.d.ts +144 -83
  173. package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -1
  174. package/dist/src/core/living-docs/hierarchy-mapper.js +488 -270
  175. package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
  176. package/dist/src/core/living-docs/index.d.ts +6 -0
  177. package/dist/src/core/living-docs/index.d.ts.map +1 -1
  178. package/dist/src/core/living-docs/index.js +6 -0
  179. package/dist/src/core/living-docs/index.js.map +1 -1
  180. package/dist/src/core/living-docs/project-detector.d.ts +6 -0
  181. package/dist/src/core/living-docs/project-detector.d.ts.map +1 -1
  182. package/dist/src/core/living-docs/project-detector.js +35 -1
  183. package/dist/src/core/living-docs/project-detector.js.map +1 -1
  184. package/dist/src/core/living-docs/spec-distributor.d.ts +100 -26
  185. package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -1
  186. package/dist/src/core/living-docs/spec-distributor.js +1275 -258
  187. package/dist/src/core/living-docs/spec-distributor.js.map +1 -1
  188. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +109 -0
  189. package/dist/src/core/living-docs/task-project-specific-generator.d.ts.map +1 -0
  190. package/dist/src/core/living-docs/task-project-specific-generator.js +221 -0
  191. package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -0
  192. package/dist/src/core/living-docs/types.d.ts +143 -0
  193. package/dist/src/core/living-docs/types.d.ts.map +1 -1
  194. package/dist/src/core/project-manager.d.ts +2 -17
  195. package/dist/src/core/project-manager.d.ts.map +1 -1
  196. package/dist/src/core/project-manager.js +68 -48
  197. package/dist/src/core/project-manager.js.map +1 -1
  198. package/dist/src/core/spec-content-sync.d.ts +1 -1
  199. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  200. package/dist/src/core/sync/enhanced-content-builder.d.ts +32 -54
  201. package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -1
  202. package/dist/src/core/sync/enhanced-content-builder.js +142 -138
  203. package/dist/src/core/sync/enhanced-content-builder.js.map +1 -1
  204. package/dist/src/core/sync/performance-optimizer.d.ts +153 -0
  205. package/dist/src/core/sync/performance-optimizer.d.ts.map +1 -0
  206. package/dist/src/core/sync/performance-optimizer.js +220 -0
  207. package/dist/src/core/sync/performance-optimizer.js.map +1 -0
  208. package/dist/src/core/sync/retry-handler.d.ts +98 -0
  209. package/dist/src/core/sync/retry-handler.d.ts.map +1 -0
  210. package/dist/src/core/sync/retry-handler.js +196 -0
  211. package/dist/src/core/sync/retry-handler.js.map +1 -0
  212. package/dist/src/core/sync/spec-content-sync.d.ts +88 -0
  213. package/dist/src/core/sync/spec-content-sync.d.ts.map +1 -0
  214. package/dist/src/core/sync/spec-content-sync.js +5 -0
  215. package/dist/src/core/sync/spec-content-sync.js.map +1 -0
  216. package/dist/src/core/sync/types.d.ts +52 -0
  217. package/dist/src/core/sync/types.d.ts.map +1 -0
  218. package/dist/src/core/sync/types.js +5 -0
  219. package/dist/src/core/sync/types.js.map +1 -0
  220. package/dist/src/core/types/config.d.ts +125 -0
  221. package/dist/src/core/types/config.d.ts.map +1 -1
  222. package/dist/src/core/types/config.js +25 -0
  223. package/dist/src/core/types/config.js.map +1 -1
  224. package/dist/src/core/types/increment-metadata.d.ts +10 -0
  225. package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
  226. package/dist/src/core/types/increment-metadata.js +10 -1
  227. package/dist/src/core/types/increment-metadata.js.map +1 -1
  228. package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
  229. package/dist/src/integrations/jira/jira-incremental-mapper.js +4 -8
  230. package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
  231. package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
  232. package/dist/src/integrations/jira/jira-mapper.js +4 -8
  233. package/dist/src/integrations/jira/jira-mapper.js.map +1 -1
  234. package/dist/tsconfig.tsbuildinfo +1 -0
  235. package/package.json +1 -1
  236. package/plugins/specweave/COMMANDS.md +13 -4
  237. package/plugins/specweave/agents/pm/AGENT.md +159 -12
  238. package/plugins/specweave/commands/specweave-abandon.md +22 -20
  239. package/plugins/specweave/commands/specweave-archive-features.md +121 -0
  240. package/plugins/specweave/commands/specweave-archive-increments.md +82 -0
  241. package/plugins/specweave/commands/specweave-archive.md +363 -0
  242. package/plugins/specweave/commands/specweave-backlog.md +211 -0
  243. package/plugins/specweave/commands/specweave-fix-duplicates.md +517 -0
  244. package/plugins/specweave/commands/specweave-increment.md +4 -3
  245. package/plugins/specweave/commands/specweave-progress.md +176 -27
  246. package/plugins/specweave/commands/specweave-reopen.md +391 -0
  247. package/plugins/specweave/commands/specweave-restore-feature.md +90 -0
  248. package/plugins/specweave/commands/specweave-restore.md +309 -0
  249. package/plugins/specweave/commands/specweave-resume.md +51 -23
  250. package/plugins/specweave/commands/specweave-status.md +41 -7
  251. package/plugins/specweave/commands/specweave-sync-specs.md +425 -0
  252. package/plugins/specweave/commands/specweave.md +70 -405
  253. package/plugins/specweave/hooks/hooks.json +4 -0
  254. package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
  255. package/plugins/specweave/hooks/post-increment-planning.sh +26 -2
  256. package/plugins/specweave/hooks/post-task-completion.sh +39 -0
  257. package/plugins/specweave/hooks/pre-command-deduplication.sh +83 -0
  258. package/plugins/specweave/hooks/user-prompt-submit.sh +1 -1
  259. package/plugins/specweave/lib/hooks/sync-living-docs.js +2 -0
  260. package/plugins/specweave/lib/hooks/sync-living-docs.ts +4 -0
  261. package/plugins/specweave/lib/hooks/update-ac-status.js +102 -0
  262. package/plugins/specweave/lib/hooks/update-ac-status.ts +192 -0
  263. package/plugins/specweave/skills/archive-increments/SKILL.md +198 -0
  264. package/plugins/specweave/skills/increment-planner/scripts/feature-utils.js +14 -0
  265. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +244 -0
  266. package/plugins/specweave-ado/lib/ado-spec-content-sync.js +49 -5
  267. package/plugins/specweave-ado/lib/ado-spec-content-sync.ts +72 -6
  268. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  269. package/plugins/specweave-confluent/.claude-plugin/plugin.json +23 -0
  270. package/plugins/specweave-confluent/README.md +375 -0
  271. package/plugins/specweave-confluent/agents/confluent-architect/AGENT.md +306 -0
  272. package/plugins/specweave-confluent/skills/confluent-kafka-connect/SKILL.md +453 -0
  273. package/plugins/specweave-confluent/skills/confluent-ksqldb/SKILL.md +470 -0
  274. package/plugins/specweave-confluent/skills/confluent-schema-registry/SKILL.md +316 -0
  275. package/plugins/specweave-github/agents/github-task-splitter/AGENT.md +2 -2
  276. package/plugins/specweave-github/agents/user-story-updater/AGENT.md +148 -0
  277. package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +1 -1
  278. package/plugins/specweave-github/commands/specweave-github-update-user-story.md +156 -0
  279. package/plugins/specweave-github/hooks/post-task-completion.sh +42 -9
  280. package/plugins/specweave-github/lib/completion-calculator.js +262 -0
  281. package/plugins/specweave-github/lib/completion-calculator.ts +434 -0
  282. package/plugins/specweave-github/lib/duplicate-detector.js +3 -3
  283. package/plugins/specweave-github/lib/duplicate-detector.ts +4 -4
  284. package/plugins/specweave-github/lib/epic-content-builder.js +265 -0
  285. package/plugins/specweave-github/lib/epic-content-builder.ts +376 -0
  286. package/plugins/specweave-github/lib/github-client-v2.js +49 -0
  287. package/plugins/specweave-github/lib/github-client-v2.ts +59 -0
  288. package/plugins/specweave-github/lib/github-epic-sync.js +23 -24
  289. package/plugins/specweave-github/lib/github-epic-sync.ts +30 -5
  290. package/plugins/specweave-github/lib/github-feature-sync.js +381 -0
  291. package/plugins/specweave-github/lib/github-feature-sync.ts +568 -0
  292. package/plugins/specweave-github/lib/github-spec-content-sync.js +40 -10
  293. package/plugins/specweave-github/lib/github-spec-content-sync.ts +82 -14
  294. package/plugins/specweave-github/lib/progress-comment-builder.js +229 -0
  295. package/plugins/specweave-github/lib/progress-comment-builder.ts +324 -0
  296. package/plugins/specweave-github/lib/user-story-content-builder.js +299 -0
  297. package/plugins/specweave-github/lib/user-story-content-builder.ts +413 -0
  298. package/plugins/specweave-github/lib/user-story-issue-builder.js +344 -0
  299. package/plugins/specweave-github/lib/user-story-issue-builder.ts +543 -0
  300. package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +189 -0
  301. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
  302. package/plugins/specweave-jira/lib/{enhanced-jira-sync.ts.disabled → enhanced-jira-sync.ts} +26 -52
  303. package/plugins/specweave-kafka/.claude-plugin/plugin.json +26 -0
  304. package/plugins/specweave-kafka/IMPLEMENTATION-COMPLETE.md +483 -0
  305. package/plugins/specweave-kafka/README.md +242 -0
  306. package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +235 -0
  307. package/plugins/specweave-kafka/agents/kafka-devops/AGENT.md +209 -0
  308. package/plugins/specweave-kafka/agents/kafka-observability/AGENT.md +266 -0
  309. package/plugins/specweave-kafka/commands/deploy.md +99 -0
  310. package/plugins/specweave-kafka/commands/dev-env.md +176 -0
  311. package/plugins/specweave-kafka/commands/mcp-configure.md +101 -0
  312. package/plugins/specweave-kafka/commands/monitor-setup.md +96 -0
  313. package/plugins/specweave-kafka/docker/kafka-local/docker-compose.yml +187 -0
  314. package/plugins/specweave-kafka/docker/redpanda/docker-compose.yml +199 -0
  315. package/plugins/specweave-kafka/docker/templates/consumer-nodejs.js +225 -0
  316. package/plugins/specweave-kafka/docker/templates/consumer-python.py +220 -0
  317. package/plugins/specweave-kafka/docker/templates/producer-nodejs.js +168 -0
  318. package/plugins/specweave-kafka/docker/templates/producer-python.py +167 -0
  319. package/plugins/specweave-kafka/lib/adapters/apache-kafka-adapter.js +438 -0
  320. package/plugins/specweave-kafka/lib/adapters/apache-kafka-adapter.ts +541 -0
  321. package/plugins/specweave-kafka/lib/adapters/platform-adapter.js +47 -0
  322. package/plugins/specweave-kafka/lib/adapters/platform-adapter.ts +343 -0
  323. package/plugins/specweave-kafka/lib/cli/kcat-wrapper.js +258 -0
  324. package/plugins/specweave-kafka/lib/cli/kcat-wrapper.ts +298 -0
  325. package/plugins/specweave-kafka/lib/cli/types.js +10 -0
  326. package/plugins/specweave-kafka/lib/cli/types.ts +92 -0
  327. package/plugins/specweave-kafka/lib/connectors/connector-catalog.js +305 -0
  328. package/plugins/specweave-kafka/lib/connectors/connector-catalog.ts +528 -0
  329. package/plugins/specweave-kafka/lib/documentation/diagram-generator.js +114 -0
  330. package/plugins/specweave-kafka/lib/documentation/diagram-generator.ts +195 -0
  331. package/plugins/specweave-kafka/lib/documentation/exporter.js +210 -0
  332. package/plugins/specweave-kafka/lib/documentation/exporter.ts +338 -0
  333. package/plugins/specweave-kafka/lib/documentation/schema-catalog-generator.js +60 -0
  334. package/plugins/specweave-kafka/lib/documentation/schema-catalog-generator.ts +130 -0
  335. package/plugins/specweave-kafka/lib/documentation/topology-generator.js +143 -0
  336. package/plugins/specweave-kafka/lib/documentation/topology-generator.ts +290 -0
  337. package/plugins/specweave-kafka/lib/mcp/detector.js +298 -0
  338. package/plugins/specweave-kafka/lib/mcp/detector.ts +352 -0
  339. package/plugins/specweave-kafka/lib/mcp/types.js +21 -0
  340. package/plugins/specweave-kafka/lib/mcp/types.ts +77 -0
  341. package/plugins/specweave-kafka/lib/multi-cluster/cluster-config-manager.js +193 -0
  342. package/plugins/specweave-kafka/lib/multi-cluster/cluster-config-manager.ts +362 -0
  343. package/plugins/specweave-kafka/lib/multi-cluster/cluster-switcher.js +188 -0
  344. package/plugins/specweave-kafka/lib/multi-cluster/cluster-switcher.ts +359 -0
  345. package/plugins/specweave-kafka/lib/multi-cluster/health-aggregator.js +195 -0
  346. package/plugins/specweave-kafka/lib/multi-cluster/health-aggregator.ts +380 -0
  347. package/plugins/specweave-kafka/lib/observability/opentelemetry-kafka.js +209 -0
  348. package/plugins/specweave-kafka/lib/observability/opentelemetry-kafka.ts +358 -0
  349. package/plugins/specweave-kafka/lib/patterns/advanced-ksqldb-patterns.js +354 -0
  350. package/plugins/specweave-kafka/lib/patterns/advanced-ksqldb-patterns.ts +563 -0
  351. package/plugins/specweave-kafka/lib/patterns/circuit-breaker-resilience.js +259 -0
  352. package/plugins/specweave-kafka/lib/patterns/circuit-breaker-resilience.ts +516 -0
  353. package/plugins/specweave-kafka/lib/patterns/dead-letter-queue.js +233 -0
  354. package/plugins/specweave-kafka/lib/patterns/dead-letter-queue.ts +423 -0
  355. package/plugins/specweave-kafka/lib/patterns/exactly-once-semantics.js +266 -0
  356. package/plugins/specweave-kafka/lib/patterns/exactly-once-semantics.ts +445 -0
  357. package/plugins/specweave-kafka/lib/patterns/flink-kafka-integration.js +312 -0
  358. package/plugins/specweave-kafka/lib/patterns/flink-kafka-integration.ts +561 -0
  359. package/plugins/specweave-kafka/lib/patterns/multi-dc-replication.js +289 -0
  360. package/plugins/specweave-kafka/lib/patterns/multi-dc-replication.ts +607 -0
  361. package/plugins/specweave-kafka/lib/patterns/rate-limiting-backpressure.js +264 -0
  362. package/plugins/specweave-kafka/lib/patterns/rate-limiting-backpressure.ts +498 -0
  363. package/plugins/specweave-kafka/lib/patterns/stream-processing-optimization.js +263 -0
  364. package/plugins/specweave-kafka/lib/patterns/stream-processing-optimization.ts +549 -0
  365. package/plugins/specweave-kafka/lib/patterns/tiered-storage-compaction.js +205 -0
  366. package/plugins/specweave-kafka/lib/patterns/tiered-storage-compaction.ts +399 -0
  367. package/plugins/specweave-kafka/lib/performance/performance-optimizer.js +249 -0
  368. package/plugins/specweave-kafka/lib/performance/performance-optimizer.ts +427 -0
  369. package/plugins/specweave-kafka/lib/security/kafka-security.js +252 -0
  370. package/plugins/specweave-kafka/lib/security/kafka-security.ts +494 -0
  371. package/plugins/specweave-kafka/lib/utils/capacity-planner.js +203 -0
  372. package/plugins/specweave-kafka/lib/utils/capacity-planner.ts +469 -0
  373. package/plugins/specweave-kafka/lib/utils/config-validator.js +419 -0
  374. package/plugins/specweave-kafka/lib/utils/config-validator.ts +564 -0
  375. package/plugins/specweave-kafka/lib/utils/partitioning.js +329 -0
  376. package/plugins/specweave-kafka/lib/utils/partitioning.ts +473 -0
  377. package/plugins/specweave-kafka/lib/utils/sizing.js +221 -0
  378. package/plugins/specweave-kafka/lib/utils/sizing.ts +374 -0
  379. package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-broker-metrics.json +628 -0
  380. package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-cluster-overview.json +564 -0
  381. package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-consumer-lag.json +509 -0
  382. package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-jvm-metrics.json +674 -0
  383. package/plugins/specweave-kafka/monitoring/grafana/dashboards/kafka-topic-metrics.json +578 -0
  384. package/plugins/specweave-kafka/monitoring/grafana/provisioning/dashboards/kafka.yml +17 -0
  385. package/plugins/specweave-kafka/monitoring/grafana/provisioning/datasources/prometheus.yml +17 -0
  386. package/plugins/specweave-kafka/monitoring/prometheus/kafka-alerts.yml +415 -0
  387. package/plugins/specweave-kafka/monitoring/prometheus/kafka-jmx-exporter.yml +256 -0
  388. package/plugins/specweave-kafka/package.json +41 -0
  389. package/plugins/specweave-kafka/skills/kafka-architecture/SKILL.md +647 -0
  390. package/plugins/specweave-kafka/skills/kafka-cli-tools/SKILL.md +433 -0
  391. package/plugins/specweave-kafka/skills/kafka-iac-deployment/SKILL.md +449 -0
  392. package/plugins/specweave-kafka/skills/kafka-kubernetes/SKILL.md +667 -0
  393. package/plugins/specweave-kafka/skills/kafka-mcp-integration/SKILL.md +273 -0
  394. package/plugins/specweave-kafka/skills/kafka-observability/SKILL.md +576 -0
  395. package/plugins/specweave-kafka/templates/config/broker-production.properties +254 -0
  396. package/plugins/specweave-kafka/templates/config/consumer-low-latency.properties +112 -0
  397. package/plugins/specweave-kafka/templates/config/producer-high-throughput.properties +120 -0
  398. package/plugins/specweave-kafka/templates/migration/mirrormaker2-config.properties +234 -0
  399. package/plugins/specweave-kafka/templates/monitoring/grafana/multi-cluster-dashboard.json +686 -0
  400. package/plugins/specweave-kafka/terraform/apache-kafka/main.tf +347 -0
  401. package/plugins/specweave-kafka/terraform/apache-kafka/outputs.tf +107 -0
  402. package/plugins/specweave-kafka/terraform/apache-kafka/templates/kafka-broker-init.sh.tpl +216 -0
  403. package/plugins/specweave-kafka/terraform/apache-kafka/variables.tf +156 -0
  404. package/plugins/specweave-kafka/terraform/aws-msk/main.tf +362 -0
  405. package/plugins/specweave-kafka/terraform/aws-msk/outputs.tf +93 -0
  406. package/plugins/specweave-kafka/terraform/aws-msk/templates/server.properties.tpl +32 -0
  407. package/plugins/specweave-kafka/terraform/aws-msk/variables.tf +235 -0
  408. package/plugins/specweave-kafka/terraform/azure-event-hubs/main.tf +281 -0
  409. package/plugins/specweave-kafka/terraform/azure-event-hubs/outputs.tf +118 -0
  410. package/plugins/specweave-kafka/terraform/azure-event-hubs/variables.tf +148 -0
  411. package/plugins/specweave-kafka/tsconfig.json +21 -0
  412. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +23 -0
  413. package/plugins/specweave-kafka-streams/README.md +310 -0
  414. package/plugins/specweave-kafka-streams/skills/kafka-streams-topology/SKILL.md +539 -0
  415. package/plugins/specweave-n8n/.claude-plugin/plugin.json +22 -0
  416. package/plugins/specweave-n8n/README.md +354 -0
  417. package/plugins/specweave-n8n/skills/n8n-kafka-workflows/SKILL.md +504 -0
  418. package/plugins/specweave-release/commands/specweave-release-platform.md +1 -1
  419. package/plugins/specweave-release/hooks/post-task-completion.sh +2 -2
  420. package/src/templates/AGENTS.md.template +601 -7
  421. package/src/templates/CLAUDE.md.template +188 -88
  422. package/plugins/specweave-ado/commands/specweave-ado-sync-spec.md +0 -255
  423. package/plugins/specweave-github/commands/specweave-github-sync-epic.md +0 -248
  424. package/plugins/specweave-github/commands/specweave-github-sync-from.md +0 -147
  425. package/plugins/specweave-github/commands/specweave-github-sync-spec.md +0 -208
  426. package/plugins/specweave-github/commands/specweave-github-sync-tasks.md +0 -530
  427. package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +0 -267
  428. package/plugins/specweave-jira/commands/specweave-jira-sync-spec.md +0 -240
@@ -0,0 +1,368 @@
1
+ /**
2
+ * Increment Archiver - Smart archiving system for completed increments
3
+ *
4
+ * Keeps the increments folder clean by archiving old/completed increments
5
+ * while preserving active work and maintaining full history.
6
+ */
7
+ import fs from 'fs-extra';
8
+ import * as path from 'path';
9
+ import { glob } from 'glob';
10
+ import { ConfigManager } from '../config-manager.js';
11
+ import { detectDuplicatesByNumber } from './duplicate-detector.js';
12
+ // Simple logger implementation
13
+ class Logger {
14
+ info(message) { console.log(`ℹ️ ${message}`); }
15
+ success(message) { console.log(`✅ ${message}`); }
16
+ warn(message) { console.warn(`⚠️ ${message}`); }
17
+ error(message) { console.error(`❌ ${message}`); }
18
+ debug(message) { if (process.env.DEBUG)
19
+ console.log(`🔍 ${message}`); }
20
+ }
21
+ export class IncrementArchiver {
22
+ constructor(rootDir) {
23
+ this.rootDir = rootDir;
24
+ this.logger = new Logger();
25
+ this.config = new ConfigManager(rootDir);
26
+ this.incrementsDir = path.join(rootDir, '.specweave', 'increments');
27
+ this.archiveDir = path.join(this.incrementsDir, '_archive');
28
+ this.abandonedDir = path.join(this.incrementsDir, '_abandoned');
29
+ }
30
+ /**
31
+ * Archive increments based on options
32
+ */
33
+ async archive(options = {}) {
34
+ const result = {
35
+ archived: [],
36
+ skipped: [],
37
+ errors: [],
38
+ totalSize: 0
39
+ };
40
+ // Ensure archive directory exists
41
+ if (!options.dryRun) {
42
+ await fs.ensureDir(this.archiveDir);
43
+ }
44
+ // Get all increments
45
+ const increments = await this.getIncrements();
46
+ // Filter increments based on options
47
+ const toArchive = await this.filterIncrements(increments, options);
48
+ // Process each increment
49
+ for (const increment of toArchive) {
50
+ try {
51
+ const shouldArchive = await this.shouldArchive(increment, options);
52
+ if (shouldArchive) {
53
+ if (options.dryRun) {
54
+ this.logger.info(`[DRY RUN] Would archive: ${increment}`);
55
+ result.archived.push(increment);
56
+ }
57
+ else {
58
+ await this.archiveIncrement(increment);
59
+ result.archived.push(increment);
60
+ this.logger.success(`Archived: ${increment}`);
61
+ }
62
+ }
63
+ else {
64
+ result.skipped.push(increment);
65
+ this.logger.debug(`Skipped: ${increment}`);
66
+ }
67
+ }
68
+ catch (error) {
69
+ result.errors.push(increment);
70
+ this.logger.error(`Failed to archive ${increment}: ${error}`);
71
+ }
72
+ }
73
+ // Calculate total size
74
+ if (!options.dryRun) {
75
+ result.totalSize = await this.calculateSize(result.archived);
76
+ }
77
+ return result;
78
+ }
79
+ /**
80
+ * Get all increment directories (excluding _archive and _abandoned)
81
+ */
82
+ async getIncrements() {
83
+ const pattern = path.join(this.incrementsDir, '[0-9]*-*');
84
+ const allPaths = await glob(pattern);
85
+ // Filter to only directories
86
+ const increments = [];
87
+ for (const p of allPaths) {
88
+ const stats = await fs.stat(p);
89
+ if (stats.isDirectory()) {
90
+ increments.push(p);
91
+ }
92
+ }
93
+ return increments
94
+ .map(p => path.basename(p))
95
+ .sort((a, b) => {
96
+ const numA = parseInt(a.split('-')[0]);
97
+ const numB = parseInt(b.split('-')[0]);
98
+ return numA - numB;
99
+ });
100
+ }
101
+ /**
102
+ * Filter increments based on archive options
103
+ */
104
+ async filterIncrements(increments, options) {
105
+ let filtered = [...increments];
106
+ // If specific increments provided, use only those
107
+ if (options.increments && options.increments.length > 0) {
108
+ filtered = filtered.filter(inc => {
109
+ const incNumber = inc.split('-')[0];
110
+ return options.increments.some(target => {
111
+ return inc === target || incNumber === target.padStart(4, '0');
112
+ });
113
+ });
114
+ return filtered;
115
+ }
116
+ // Apply pattern filter
117
+ if (options.pattern) {
118
+ const regex = new RegExp(options.pattern, 'i');
119
+ filtered = filtered.filter(inc => regex.test(inc));
120
+ }
121
+ // Keep last N increments
122
+ if (options.keepLast !== undefined) {
123
+ const toKeep = increments.slice(-options.keepLast);
124
+ filtered = filtered.filter(inc => !toKeep.includes(inc));
125
+ }
126
+ // Filter by age
127
+ if (options.olderThanDays !== undefined) {
128
+ const cutoffDate = new Date();
129
+ cutoffDate.setDate(cutoffDate.getDate() - options.olderThanDays);
130
+ filtered = await Promise.all(filtered.map(async (inc) => {
131
+ const metadata = await this.getMetadata(inc);
132
+ if (metadata?.lastActivity) {
133
+ const lastActivity = new Date(metadata.lastActivity);
134
+ return lastActivity < cutoffDate ? inc : null;
135
+ }
136
+ // Check directory modification time as fallback
137
+ const incPath = path.join(this.incrementsDir, inc);
138
+ const stats = await fs.stat(incPath);
139
+ return stats.mtime < cutoffDate ? inc : null;
140
+ })).then(results => results.filter(Boolean));
141
+ }
142
+ return filtered;
143
+ }
144
+ /**
145
+ * Determine if an increment should be archived
146
+ */
147
+ async shouldArchive(increment, options) {
148
+ // Check if already in archive
149
+ const archivePath = path.join(this.archiveDir, increment);
150
+ if (await fs.pathExists(archivePath)) {
151
+ this.logger.debug(`${increment} already archived`);
152
+ return false;
153
+ }
154
+ // Get metadata
155
+ const metadata = await this.getMetadata(increment);
156
+ // Preserve active/paused increments by default
157
+ if (options.preserveActive !== false && metadata?.status) {
158
+ if (['active', 'paused'].includes(metadata.status)) {
159
+ this.logger.debug(`${increment} is ${metadata.status}, preserving`);
160
+ return false;
161
+ }
162
+ }
163
+ // Check for active external sync (GitHub, JIRA, ADO) - MUST check before archiveCompleted
164
+ if (metadata) {
165
+ const hasActiveSync = (metadata.github && !metadata.github.closed) ||
166
+ (metadata.jira && metadata.jira.status !== 'Done') ||
167
+ (metadata.ado && metadata.ado.state !== 'Closed');
168
+ if (hasActiveSync) {
169
+ this.logger.warn(`${increment} has active external sync, skipping`);
170
+ return false;
171
+ }
172
+ }
173
+ // Archive completed increments if requested
174
+ if (options.archiveCompleted && metadata?.status === 'completed') {
175
+ return true;
176
+ }
177
+ // Check for uncommitted changes
178
+ const hasUncommittedChanges = await this.hasUncommittedChanges(increment);
179
+ if (hasUncommittedChanges) {
180
+ this.logger.warn(`${increment} has uncommitted changes, skipping`);
181
+ return false;
182
+ }
183
+ return true;
184
+ }
185
+ /**
186
+ * Archive a single increment
187
+ */
188
+ async archiveIncrement(increment) {
189
+ const sourcePath = path.join(this.incrementsDir, increment);
190
+ const targetPath = path.join(this.archiveDir, increment);
191
+ // CRITICAL: Check for duplicates before archiving
192
+ const numberMatch = increment.match(/^(\d+)/);
193
+ if (numberMatch) {
194
+ const incrementNumber = numberMatch[1];
195
+ const duplicates = await detectDuplicatesByNumber(incrementNumber, this.rootDir);
196
+ // Check if any duplicates exist in archive or abandoned
197
+ const archiveDuplicates = duplicates.filter(d => d.path.includes('_archive') || d.path.includes('_abandoned'));
198
+ if (archiveDuplicates.length > 0) {
199
+ const locations = archiveDuplicates.map(d => d.path).join('\n - ');
200
+ throw new Error(`Cannot archive ${increment}: Increment number ${incrementNumber} already exists in:\n - ${locations}\n\n` +
201
+ `Resolution options:\n` +
202
+ ` 1. Delete the existing archive/abandoned version first\n` +
203
+ ` 2. Use --force to overwrite (not recommended)\n` +
204
+ ` 3. Run /specweave:fix-duplicates to resolve conflicts`);
205
+ }
206
+ }
207
+ // Move the directory
208
+ await fs.move(sourcePath, targetPath, { overwrite: false });
209
+ // Update any references in config or living docs
210
+ await this.updateReferences(increment);
211
+ }
212
+ /**
213
+ * Get metadata for an increment
214
+ */
215
+ async getMetadata(increment) {
216
+ const metadataPath = path.join(this.incrementsDir, increment, 'metadata.json');
217
+ if (await fs.pathExists(metadataPath)) {
218
+ try {
219
+ return await fs.readJson(metadataPath);
220
+ }
221
+ catch (error) {
222
+ this.logger.debug(`Failed to read metadata for ${increment}: ${error}`);
223
+ }
224
+ }
225
+ return null;
226
+ }
227
+ /**
228
+ * Check if increment has uncommitted changes
229
+ */
230
+ async hasUncommittedChanges(increment) {
231
+ // This would integrate with git to check for uncommitted changes
232
+ // For now, return false to allow archiving
233
+ return false;
234
+ }
235
+ /**
236
+ * Update references after archiving
237
+ */
238
+ async updateReferences(increment) {
239
+ // Import and run feature archiving to maintain consistency
240
+ try {
241
+ const { FeatureArchiver } = await import('../living-docs/feature-archiver.js');
242
+ const featureArchiver = new FeatureArchiver(this.rootDir);
243
+ // Archive features that have all their increments archived
244
+ const result = await featureArchiver.archiveFeatures({
245
+ dryRun: false,
246
+ updateLinks: true,
247
+ preserveActiveFeatures: true,
248
+ archiveOrphanedFeatures: false,
249
+ archiveOrphanedEpics: false
250
+ });
251
+ if (result.archivedFeatures.length > 0) {
252
+ this.logger.success(`Archived ${result.archivedFeatures.length} features linked to increment ${increment}`);
253
+ }
254
+ if (result.archivedEpics.length > 0) {
255
+ this.logger.success(`Archived ${result.archivedEpics.length} epics`);
256
+ }
257
+ }
258
+ catch (error) {
259
+ this.logger.warn(`Could not update feature archives: ${error}`);
260
+ }
261
+ }
262
+ /**
263
+ * Calculate total size of archived increments
264
+ */
265
+ async calculateSize(increments) {
266
+ let totalSize = 0;
267
+ for (const increment of increments) {
268
+ const incPath = path.join(this.archiveDir, increment);
269
+ if (await fs.pathExists(incPath)) {
270
+ totalSize += await this.getDirectorySize(incPath);
271
+ }
272
+ }
273
+ return totalSize;
274
+ }
275
+ /**
276
+ * Get directory size recursively
277
+ */
278
+ async getDirectorySize(dirPath) {
279
+ let size = 0;
280
+ const files = await glob(path.join(dirPath, '**/*'));
281
+ for (const file of files) {
282
+ const stats = await fs.stat(file);
283
+ if (stats.isFile()) {
284
+ size += stats.size;
285
+ }
286
+ }
287
+ return size;
288
+ }
289
+ /**
290
+ * Restore an increment from archive
291
+ */
292
+ async restore(increment) {
293
+ const sourcePath = path.join(this.archiveDir, increment);
294
+ const targetPath = path.join(this.incrementsDir, increment);
295
+ if (!await fs.pathExists(sourcePath)) {
296
+ throw new Error(`Increment ${increment} not found in archive`);
297
+ }
298
+ if (await fs.pathExists(targetPath)) {
299
+ throw new Error(`Increment ${increment} already exists in main folder`);
300
+ }
301
+ // CRITICAL: Check for duplicates before restoring
302
+ const numberMatch = increment.match(/^(\d+)/);
303
+ if (numberMatch) {
304
+ const incrementNumber = numberMatch[1];
305
+ const duplicates = await detectDuplicatesByNumber(incrementNumber, this.rootDir);
306
+ // Check if any duplicates exist in active increments
307
+ const activeDuplicates = duplicates.filter(d => !d.path.includes('_archive') && !d.path.includes('_abandoned'));
308
+ if (activeDuplicates.length > 0) {
309
+ const locations = activeDuplicates.map(d => d.path).join('\n - ');
310
+ throw new Error(`Cannot restore ${increment}: Increment number ${incrementNumber} already exists in active folder:\n - ${locations}\n\n` +
311
+ `Resolution options:\n` +
312
+ ` 1. Delete/archive the existing active version first\n` +
313
+ ` 2. Run /specweave:fix-duplicates to resolve conflicts`);
314
+ }
315
+ }
316
+ await fs.move(sourcePath, targetPath);
317
+ this.logger.success(`Restored ${increment} from archive`);
318
+ }
319
+ /**
320
+ * List archived increments
321
+ */
322
+ async listArchived() {
323
+ if (!await fs.pathExists(this.archiveDir)) {
324
+ return [];
325
+ }
326
+ const pattern = path.join(this.archiveDir, '[0-9]*-*');
327
+ const allPaths = await glob(pattern);
328
+ // Filter to only directories
329
+ const archived = [];
330
+ for (const p of allPaths) {
331
+ const stats = await fs.stat(p);
332
+ if (stats.isDirectory()) {
333
+ archived.push(p);
334
+ }
335
+ }
336
+ return archived
337
+ .map(p => path.basename(p))
338
+ .sort((a, b) => {
339
+ const numA = parseInt(a.split('-')[0]);
340
+ const numB = parseInt(b.split('-')[0]);
341
+ return numA - numB;
342
+ });
343
+ }
344
+ /**
345
+ * Get archive statistics
346
+ */
347
+ async getStats() {
348
+ const active = await this.getIncrements();
349
+ const archived = await this.listArchived();
350
+ // Count abandoned
351
+ let abandoned = 0;
352
+ if (await fs.pathExists(this.abandonedDir)) {
353
+ const abandonedDirs = await glob(path.join(this.abandonedDir, '[0-9]*-*'));
354
+ abandoned = abandonedDirs.length;
355
+ }
356
+ // Calculate total archive size
357
+ const totalSize = await this.calculateSize(archived);
358
+ return {
359
+ active: active.length,
360
+ archived: archived.length,
361
+ abandoned,
362
+ totalSize,
363
+ oldestActive: active[0] || null,
364
+ newestArchived: archived[archived.length - 1] || null
365
+ };
366
+ }
367
+ }
368
+ //# sourceMappingURL=increment-archiver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"increment-archiver.js","sourceRoot":"","sources":["../../../../src/core/increment/increment-archiver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B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D,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Increment Reopener
3
+ *
4
+ * Handles reopening of completed increments, tasks, and user stories
5
+ * when issues are discovered after completion.
6
+ *
7
+ * Part of smart reopen functionality (increment 0032)
8
+ */
9
+ import { IncrementMetadata, IncrementStatus } from '../types/increment-metadata.js';
10
+ /**
11
+ * Reopen target types
12
+ */
13
+ export declare enum ReopenTarget {
14
+ /** Reopen entire increment */
15
+ INCREMENT = "increment",
16
+ /** Reopen specific task(s) */
17
+ TASK = "task",
18
+ /** Reopen user story + related tasks */
19
+ USER_STORY = "user-story"
20
+ }
21
+ /**
22
+ * Reopen context
23
+ */
24
+ export interface ReopenContext {
25
+ /** What to reopen */
26
+ target: ReopenTarget;
27
+ /** Increment ID */
28
+ incrementId: string;
29
+ /** Task ID (if target = TASK) */
30
+ taskId?: string;
31
+ /** User story ID (if target = USER_STORY) */
32
+ userStoryId?: string;
33
+ /** Reason for reopening (required for audit trail) */
34
+ reason: string;
35
+ /** Force reopen (bypass WIP checks) */
36
+ force?: boolean;
37
+ }
38
+ /**
39
+ * Reopen result
40
+ */
41
+ export interface ReopenResult {
42
+ /** Success flag */
43
+ success: boolean;
44
+ /** Items that were reopened */
45
+ itemsReopened: string[];
46
+ /** Warning messages */
47
+ warnings: string[];
48
+ /** Error messages */
49
+ errors: string[];
50
+ /** WIP limit exceeded? */
51
+ wipLimitExceeded?: boolean;
52
+ /** Increment metadata after reopen */
53
+ metadata?: IncrementMetadata;
54
+ }
55
+ /**
56
+ * WIP validation result
57
+ */
58
+ export interface WIPValidationResult {
59
+ /** Is reopen allowed? */
60
+ allowed: boolean;
61
+ /** Warning flag */
62
+ warning: boolean;
63
+ /** Message */
64
+ message?: string;
65
+ /** Current active count */
66
+ activeCount?: number;
67
+ /** Limit for increment type */
68
+ limit?: number;
69
+ }
70
+ /**
71
+ * Reopen history entry (audit trail)
72
+ */
73
+ export interface ReopenHistoryEntry {
74
+ /** When reopened */
75
+ date: string;
76
+ /** Why reopened */
77
+ reason: string;
78
+ /** Previous status */
79
+ previousStatus: IncrementStatus;
80
+ /** Who reopened (always 'user' for now) */
81
+ by: string;
82
+ }
83
+ /**
84
+ * Extended metadata with reopen history
85
+ */
86
+ export interface IncrementMetadataWithReopen extends IncrementMetadata {
87
+ /** Reopen tracking */
88
+ reopened?: {
89
+ /** Number of times reopened */
90
+ count: number;
91
+ /** Reopen history */
92
+ history: ReopenHistoryEntry[];
93
+ };
94
+ }
95
+ /**
96
+ * Increment Reopener
97
+ *
98
+ * Provides smart reopen functionality for increments, tasks, and user stories
99
+ */
100
+ export declare class IncrementReopener {
101
+ /**
102
+ * Reopen a completed increment
103
+ *
104
+ * @param context - Reopen context
105
+ * @returns Reopen result
106
+ */
107
+ static reopenIncrement(context: ReopenContext): Promise<ReopenResult>;
108
+ /**
109
+ * Reopen specific task(s) in an increment
110
+ *
111
+ * @param context - Reopen context
112
+ * @returns Reopen result
113
+ */
114
+ static reopenTask(context: ReopenContext): Promise<ReopenResult>;
115
+ /**
116
+ * Reopen user story + related tasks
117
+ *
118
+ * @param context - Reopen context
119
+ * @returns Reopen result
120
+ */
121
+ static reopenUserStory(context: ReopenContext): Promise<ReopenResult>;
122
+ /**
123
+ * Validate WIP limits before reopening
124
+ *
125
+ * @param metadata - Increment metadata
126
+ * @param force - Force reopen?
127
+ * @returns Validation result
128
+ */
129
+ private static validateWIPLimits;
130
+ /**
131
+ * Reopen uncompleted tasks in increment
132
+ *
133
+ * @param incrementId - Increment ID
134
+ * @param reason - Reason for reopening
135
+ * @returns List of reopened task IDs
136
+ */
137
+ private static reopenUncompletedTasks;
138
+ /**
139
+ * Find tasks that implement a user story (by AC field)
140
+ *
141
+ * @param incrementId - Increment ID
142
+ * @param userStoryId - User story ID (e.g., "US-001")
143
+ * @returns List of task IDs
144
+ */
145
+ private static findTasksForUserStory;
146
+ /**
147
+ * Update user story status in living docs
148
+ *
149
+ * @param incrementId - Increment ID
150
+ * @param userStoryId - User story ID
151
+ * @param status - New status
152
+ * @param reason - Reason
153
+ * @returns Success flag
154
+ */
155
+ private static updateUserStoryStatus;
156
+ /**
157
+ * Find user story files in living docs
158
+ *
159
+ * @param basePath - Base search path
160
+ * @param userStoryId - User story ID (e.g., "US-001")
161
+ * @returns List of file paths
162
+ */
163
+ private static findUserStoryFiles;
164
+ }
165
+ //# sourceMappingURL=increment-reopener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"increment-reopener.d.ts","sourceRoot":"","sources":["../../../../src/core/increment/increment-reopener.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EACL,iBAAiB,EACjB,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,oBAAY,YAAY;IACtB,8BAA8B;IAC9B,SAAS,cAAc;IAEvB,8BAA8B;IAC9B,IAAI,SAAS;IAEb,wCAAwC;IACxC,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,MAAM,EAAE,YAAY,CAAC;IAErB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IAEpB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IAEf,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mBAAmB;IACnB,OAAO,EAAE,OAAO,CAAC;IAEjB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,qBAAqB;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,0BAA0B;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,sCAAsC;IACtC,QAA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