specweave 0.32.0 → 0.32.3

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 (347) hide show
  1. package/CLAUDE.md +215 -2
  2. package/README.md +22 -0
  3. package/bin/specweave.js +52 -1
  4. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.d.ts +100 -0
  5. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.d.ts.map +1 -0
  6. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.js +291 -0
  7. package/dist/plugins/specweave-ado/lib/ado-duplicate-detector.js.map +1 -0
  8. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.d.ts +103 -0
  9. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.d.ts.map +1 -0
  10. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.js +310 -0
  11. package/dist/plugins/specweave-jira/lib/jira-duplicate-detector.js.map +1 -0
  12. package/dist/plugins/specweave-jira/lib/jira-permission-gate.d.ts +126 -0
  13. package/dist/plugins/specweave-jira/lib/jira-permission-gate.d.ts.map +1 -0
  14. package/dist/plugins/specweave-jira/lib/jira-permission-gate.js +207 -0
  15. package/dist/plugins/specweave-jira/lib/jira-permission-gate.js.map +1 -0
  16. package/dist/src/adapters/codex/README.md +1 -1
  17. package/dist/src/adapters/codex/adapter.js +1 -1
  18. package/dist/src/cli/commands/archive.d.ts +2 -0
  19. package/dist/src/cli/commands/archive.d.ts.map +1 -1
  20. package/dist/src/cli/commands/archive.js +33 -0
  21. package/dist/src/cli/commands/archive.js.map +1 -1
  22. package/dist/src/cli/commands/cache.d.ts +17 -0
  23. package/dist/src/cli/commands/cache.d.ts.map +1 -0
  24. package/dist/src/cli/commands/cache.js +126 -0
  25. package/dist/src/cli/commands/cache.js.map +1 -0
  26. package/dist/src/cli/commands/context.d.ts +92 -0
  27. package/dist/src/cli/commands/context.d.ts.map +1 -0
  28. package/dist/src/cli/commands/context.js +205 -0
  29. package/dist/src/cli/commands/context.js.map +1 -0
  30. package/dist/src/cli/commands/init.d.ts.map +1 -1
  31. package/dist/src/cli/commands/init.js +112 -70
  32. package/dist/src/cli/commands/init.js.map +1 -1
  33. package/dist/src/cli/commands/plan/increment-detector.js +2 -2
  34. package/dist/src/cli/commands/plan/increment-detector.js.map +1 -1
  35. package/dist/src/cli/commands/sync-spec-commits.js +1 -1
  36. package/dist/src/cli/commands/sync-spec-commits.js.map +1 -1
  37. package/dist/src/cli/commands/sync-specs.js +2 -2
  38. package/dist/src/cli/commands/sync-specs.js.map +1 -1
  39. package/dist/src/cli/helpers/github/increment-profile-selector.js +1 -1
  40. package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
  41. package/dist/src/cli/helpers/init/external-import.d.ts +3 -0
  42. package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -1
  43. package/dist/src/cli/helpers/init/external-import.js +17 -4
  44. package/dist/src/cli/helpers/init/external-import.js.map +1 -1
  45. package/dist/src/cli/helpers/init/index.d.ts +1 -0
  46. package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
  47. package/dist/src/cli/helpers/init/index.js +2 -0
  48. package/dist/src/cli/helpers/init/index.js.map +1 -1
  49. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts +70 -0
  50. package/dist/src/cli/helpers/init/jira-ado-auto-detect.d.ts.map +1 -1
  51. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js +214 -4
  52. package/dist/src/cli/helpers/init/jira-ado-auto-detect.js.map +1 -1
  53. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts +4 -0
  54. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts.map +1 -1
  55. package/dist/src/cli/helpers/init/living-docs-preflight.js +34 -3
  56. package/dist/src/cli/helpers/init/living-docs-preflight.js.map +1 -1
  57. package/dist/src/cli/helpers/init/testing-config.d.ts +3 -0
  58. package/dist/src/cli/helpers/init/testing-config.d.ts.map +1 -1
  59. package/dist/src/cli/helpers/init/testing-config.js +9 -2
  60. package/dist/src/cli/helpers/init/testing-config.js.map +1 -1
  61. package/dist/src/cli/helpers/init/translation-config.d.ts +3 -0
  62. package/dist/src/cli/helpers/init/translation-config.d.ts.map +1 -1
  63. package/dist/src/cli/helpers/init/translation-config.js +21 -4
  64. package/dist/src/cli/helpers/init/translation-config.js.map +1 -1
  65. package/dist/src/cli/helpers/init/wizard-navigation.d.ts +45 -0
  66. package/dist/src/cli/helpers/init/wizard-navigation.d.ts.map +1 -0
  67. package/dist/src/cli/helpers/init/wizard-navigation.js +97 -0
  68. package/dist/src/cli/helpers/init/wizard-navigation.js.map +1 -0
  69. package/dist/src/cli/workers/living-docs-worker.js +66 -1
  70. package/dist/src/cli/workers/living-docs-worker.js.map +1 -1
  71. package/dist/src/config/types.d.ts +203 -1208
  72. package/dist/src/config/types.d.ts.map +1 -1
  73. package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -1
  74. package/dist/src/core/discrepancy/increment-generator.js +5 -2
  75. package/dist/src/core/discrepancy/increment-generator.js.map +1 -1
  76. package/dist/src/core/increment/duplicate-detector.js +2 -2
  77. package/dist/src/core/increment/duplicate-detector.js.map +1 -1
  78. package/dist/src/core/increment/increment-archiver.d.ts +49 -4
  79. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  80. package/dist/src/core/increment/increment-archiver.js +123 -22
  81. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  82. package/dist/src/core/increment/increment-status.js +2 -2
  83. package/dist/src/core/increment/increment-status.js.map +1 -1
  84. package/dist/src/core/increment/increment-utils.d.ts +150 -0
  85. package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
  86. package/dist/src/core/increment/increment-utils.js +216 -4
  87. package/dist/src/core/increment/increment-utils.js.map +1 -1
  88. package/dist/src/core/increment/metadata-validator.js +1 -1
  89. package/dist/src/core/increment/metadata-validator.js.map +1 -1
  90. package/dist/src/core/living-docs/feature-archiver.d.ts +4 -0
  91. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  92. package/dist/src/core/living-docs/feature-archiver.js +32 -10
  93. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  94. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  95. package/dist/src/core/living-docs/feature-id-manager.js +8 -4
  96. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  97. package/dist/src/core/living-docs/governance/ecosystem-detector.d.ts +38 -0
  98. package/dist/src/core/living-docs/governance/ecosystem-detector.d.ts.map +1 -0
  99. package/dist/src/core/living-docs/governance/ecosystem-detector.js +325 -0
  100. package/dist/src/core/living-docs/governance/ecosystem-detector.js.map +1 -0
  101. package/dist/src/core/living-docs/governance/frontend-standards-parser.d.ts +74 -0
  102. package/dist/src/core/living-docs/governance/frontend-standards-parser.d.ts.map +1 -0
  103. package/dist/src/core/living-docs/governance/frontend-standards-parser.js +366 -0
  104. package/dist/src/core/living-docs/governance/frontend-standards-parser.js.map +1 -0
  105. package/dist/src/core/living-docs/governance/go-standards-parser.d.ts +64 -0
  106. package/dist/src/core/living-docs/governance/go-standards-parser.d.ts.map +1 -0
  107. package/dist/src/core/living-docs/governance/go-standards-parser.js +229 -0
  108. package/dist/src/core/living-docs/governance/go-standards-parser.js.map +1 -0
  109. package/dist/src/core/living-docs/governance/index.d.ts +50 -0
  110. package/dist/src/core/living-docs/governance/index.d.ts.map +1 -0
  111. package/dist/src/core/living-docs/governance/index.js +56 -0
  112. package/dist/src/core/living-docs/governance/index.js.map +1 -0
  113. package/dist/src/core/living-docs/governance/java-standards-parser.d.ts +89 -0
  114. package/dist/src/core/living-docs/governance/java-standards-parser.d.ts.map +1 -0
  115. package/dist/src/core/living-docs/governance/java-standards-parser.js +356 -0
  116. package/dist/src/core/living-docs/governance/java-standards-parser.js.map +1 -0
  117. package/dist/src/core/living-docs/governance/python-standards-parser.d.ts +83 -0
  118. package/dist/src/core/living-docs/governance/python-standards-parser.d.ts.map +1 -0
  119. package/dist/src/core/living-docs/governance/python-standards-parser.js +347 -0
  120. package/dist/src/core/living-docs/governance/python-standards-parser.js.map +1 -0
  121. package/dist/src/core/living-docs/governance/standards-generator.d.ts +38 -0
  122. package/dist/src/core/living-docs/governance/standards-generator.d.ts.map +1 -0
  123. package/dist/src/core/living-docs/governance/standards-generator.js +476 -0
  124. package/dist/src/core/living-docs/governance/standards-generator.js.map +1 -0
  125. package/dist/src/core/living-docs/hierarchy-mapper.js +3 -3
  126. package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
  127. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.d.ts +18 -0
  128. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.d.ts.map +1 -0
  129. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.js +299 -0
  130. package/dist/src/core/living-docs/intelligent-analyzer/architecture-generator.js.map +1 -0
  131. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts +15 -0
  132. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.d.ts.map +1 -0
  133. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js +138 -0
  134. package/dist/src/core/living-docs/intelligent-analyzer/deep-repo-analyzer.js.map +1 -0
  135. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.d.ts +24 -0
  136. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.d.ts.map +1 -0
  137. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.js +198 -0
  138. package/dist/src/core/living-docs/intelligent-analyzer/file-sampler.js.map +1 -0
  139. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts +17 -0
  140. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.d.ts.map +1 -0
  141. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js +241 -0
  142. package/dist/src/core/living-docs/intelligent-analyzer/inconsistency-detector.js.map +1 -0
  143. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +28 -0
  144. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -0
  145. package/dist/src/core/living-docs/intelligent-analyzer/index.js +197 -0
  146. package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -0
  147. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.d.ts +22 -0
  148. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.d.ts.map +1 -0
  149. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.js +482 -0
  150. package/dist/src/core/living-docs/intelligent-analyzer/organization-synthesizer.js.map +1 -0
  151. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.d.ts +42 -0
  152. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.d.ts.map +1 -0
  153. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.js +343 -0
  154. package/dist/src/core/living-docs/intelligent-analyzer/strategy-generator.js.map +1 -0
  155. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts +190 -0
  156. package/dist/src/core/living-docs/intelligent-analyzer/types.d.ts.map +1 -0
  157. package/dist/src/core/living-docs/intelligent-analyzer/types.js +7 -0
  158. package/dist/src/core/living-docs/intelligent-analyzer/types.js.map +1 -0
  159. package/dist/src/core/living-docs/living-docs-sync.d.ts +11 -3
  160. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  161. package/dist/src/core/living-docs/living-docs-sync.js +53 -10
  162. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  163. package/dist/src/core/living-docs/module-analyzer.d.ts +22 -0
  164. package/dist/src/core/living-docs/module-analyzer.d.ts.map +1 -1
  165. package/dist/src/core/living-docs/module-analyzer.js +123 -19
  166. package/dist/src/core/living-docs/module-analyzer.js.map +1 -1
  167. package/dist/src/core/llm/provider-factory.js +2 -2
  168. package/dist/src/core/llm/provider-factory.js.map +1 -1
  169. package/dist/src/core/llm/providers/anthropic-provider.js +1 -1
  170. package/dist/src/core/llm/providers/bedrock-provider.d.ts.map +1 -1
  171. package/dist/src/core/llm/providers/bedrock-provider.js +8 -4
  172. package/dist/src/core/llm/providers/bedrock-provider.js.map +1 -1
  173. package/dist/src/core/sync/spec-increment-mapper.js +3 -3
  174. package/dist/src/core/sync/spec-increment-mapper.js.map +1 -1
  175. package/dist/src/importers/item-converter.d.ts +25 -0
  176. package/dist/src/importers/item-converter.d.ts.map +1 -1
  177. package/dist/src/importers/item-converter.js +135 -5
  178. package/dist/src/importers/item-converter.js.map +1 -1
  179. package/dist/src/importers/jira-importer.d.ts +14 -0
  180. package/dist/src/importers/jira-importer.d.ts.map +1 -1
  181. package/dist/src/importers/jira-importer.js +75 -0
  182. package/dist/src/importers/jira-importer.js.map +1 -1
  183. package/dist/src/init/architecture/types.d.ts +33 -140
  184. package/dist/src/init/architecture/types.d.ts.map +1 -1
  185. package/dist/src/init/compliance/types.d.ts +30 -27
  186. package/dist/src/init/compliance/types.d.ts.map +1 -1
  187. package/dist/src/init/repo/types.d.ts +11 -34
  188. package/dist/src/init/repo/types.d.ts.map +1 -1
  189. package/dist/src/init/research/src/config/types.d.ts +15 -82
  190. package/dist/src/init/research/src/config/types.d.ts.map +1 -1
  191. package/dist/src/init/research/types.d.ts +38 -93
  192. package/dist/src/init/research/types.d.ts.map +1 -1
  193. package/dist/src/init/team/types.d.ts +4 -42
  194. package/dist/src/init/team/types.d.ts.map +1 -1
  195. package/dist/src/integrations/jira/jira-token-provider.d.ts +93 -0
  196. package/dist/src/integrations/jira/jira-token-provider.d.ts.map +1 -0
  197. package/dist/src/integrations/jira/jira-token-provider.js +160 -0
  198. package/dist/src/integrations/jira/jira-token-provider.js.map +1 -0
  199. package/dist/src/sync/ado-reconciler.d.ts +92 -0
  200. package/dist/src/sync/ado-reconciler.d.ts.map +1 -0
  201. package/dist/src/sync/ado-reconciler.js +335 -0
  202. package/dist/src/sync/ado-reconciler.js.map +1 -0
  203. package/dist/src/sync/jira-reconciler.d.ts +106 -0
  204. package/dist/src/sync/jira-reconciler.d.ts.map +1 -0
  205. package/dist/src/sync/jira-reconciler.js +405 -0
  206. package/dist/src/sync/jira-reconciler.js.map +1 -0
  207. package/dist/src/types/dashboard-cache.d.ts +181 -0
  208. package/dist/src/types/dashboard-cache.d.ts.map +1 -0
  209. package/dist/src/types/dashboard-cache.js +65 -0
  210. package/dist/src/types/dashboard-cache.js.map +1 -0
  211. package/dist/src/types/model-selection.d.ts +6 -4
  212. package/dist/src/types/model-selection.d.ts.map +1 -1
  213. package/dist/src/types/model-selection.js +3 -1
  214. package/dist/src/types/model-selection.js.map +1 -1
  215. package/dist/src/utils/docs-validator.d.ts +131 -0
  216. package/dist/src/utils/docs-validator.d.ts.map +1 -0
  217. package/dist/src/utils/docs-validator.js +529 -0
  218. package/dist/src/utils/docs-validator.js.map +1 -0
  219. package/dist/src/utils/external-tool-drift-detector.d.ts +1 -1
  220. package/dist/src/utils/external-tool-drift-detector.d.ts.map +1 -1
  221. package/dist/src/utils/external-tool-drift-detector.js +5 -4
  222. package/dist/src/utils/external-tool-drift-detector.js.map +1 -1
  223. package/dist/src/utils/feature-id-collision.js +1 -1
  224. package/dist/src/utils/feature-id-collision.js.map +1 -1
  225. package/dist/src/utils/feature-id-derivation.d.ts +8 -3
  226. package/dist/src/utils/feature-id-derivation.d.ts.map +1 -1
  227. package/dist/src/utils/feature-id-derivation.js +14 -6
  228. package/dist/src/utils/feature-id-derivation.js.map +1 -1
  229. package/dist/src/utils/html-to-mdx.d.ts +1 -0
  230. package/dist/src/utils/html-to-mdx.d.ts.map +1 -1
  231. package/dist/src/utils/html-to-mdx.js +43 -5
  232. package/dist/src/utils/html-to-mdx.js.map +1 -1
  233. package/dist/src/utils/model-selection.d.ts +3 -4
  234. package/dist/src/utils/model-selection.d.ts.map +1 -1
  235. package/dist/src/utils/model-selection.js +3 -4
  236. package/dist/src/utils/model-selection.js.map +1 -1
  237. package/package.json +1 -1
  238. package/plugins/specweave/agents/code-standards-detective/AGENT.md +48 -0
  239. package/plugins/specweave/agents/pm/AGENT.md +10 -7
  240. package/plugins/specweave/commands/specweave-archive-features.md +5 -7
  241. package/plugins/specweave/commands/specweave-archive.md +2 -1
  242. package/plugins/specweave/commands/specweave-costs.md +4 -4
  243. package/plugins/specweave/commands/specweave-do.md +44 -10
  244. package/plugins/specweave/commands/specweave-done.md +109 -0
  245. package/plugins/specweave/commands/specweave-import-external.md +45 -18
  246. package/plugins/specweave/commands/specweave-increment.md +331 -33
  247. package/plugins/specweave/commands/specweave-jobs.md +2 -2
  248. package/plugins/specweave/commands/specweave-progress.md +4 -4
  249. package/plugins/specweave/commands/specweave-restore-feature.md +5 -4
  250. package/plugins/specweave/commands/specweave-sync-docs.md +1 -1
  251. package/plugins/specweave/commands/specweave-sync-specs.md +216 -322
  252. package/plugins/specweave/commands/specweave-validate-features.md +13 -8
  253. package/plugins/specweave/commands/specweave-validate.md +27 -1
  254. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  255. package/plugins/specweave/hooks/hooks.json +43 -4
  256. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  257. package/plugins/specweave/hooks/lib/common-setup.sh +375 -0
  258. package/plugins/specweave/hooks/lib/crash-prevention.sh +336 -0
  259. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  260. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  261. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  262. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  263. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  264. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  265. package/plugins/specweave/hooks/post-task-completion.sh +4 -23
  266. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  267. package/plugins/specweave/hooks/pre-command-deduplication.sh +1 -6
  268. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  269. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  270. package/plugins/specweave/hooks/pre-task-completion.sh +8 -37
  271. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  272. package/plugins/specweave/hooks/pre-tool-use.sh +2 -11
  273. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  274. package/plugins/specweave/hooks/spec-project-validator.sh +80 -25
  275. package/plugins/specweave/hooks/universal/dispatcher.mjs +135 -42
  276. package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +183 -0
  277. package/plugins/specweave/hooks/user-prompt-submit.sh +140 -38
  278. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  279. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +12 -0
  280. package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +89 -0
  281. package/plugins/specweave/hooks/v2/guards/bash-file-guard.sh +211 -0
  282. package/plugins/specweave/hooks/v2/guards/bash-file-guard.test.sh +163 -0
  283. package/plugins/specweave/hooks/v2/guards/completion-guard.sh +26 -28
  284. package/plugins/specweave/hooks/v2/guards/features-folder-guard.sh +50 -0
  285. package/plugins/specweave/hooks/v2/guards/increment-duplicate-guard.sh +135 -0
  286. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +2 -2
  287. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -1
  288. package/plugins/specweave/scripts/README.md +166 -0
  289. package/plugins/specweave/scripts/cleanup-state.sh +142 -0
  290. package/plugins/specweave/scripts/force-kill.sh +142 -0
  291. package/plugins/specweave/scripts/jobs.js +171 -0
  292. package/plugins/specweave/scripts/progress.js +170 -0
  293. package/plugins/specweave/scripts/read-costs.sh +132 -0
  294. package/plugins/specweave/scripts/read-jobs.sh +324 -0
  295. package/plugins/specweave/scripts/read-progress.sh +185 -0
  296. package/plugins/specweave/scripts/read-status.sh +146 -0
  297. package/plugins/specweave/scripts/read-workflow.sh +173 -0
  298. package/plugins/specweave/scripts/rebuild-dashboard-cache.sh +327 -0
  299. package/plugins/specweave/scripts/session-watchdog.sh +192 -0
  300. package/plugins/specweave/scripts/status.js +154 -0
  301. package/plugins/specweave/scripts/update-dashboard-cache.sh +281 -0
  302. package/plugins/specweave/skills/code-standards-analyzer/SKILL.md +58 -6
  303. package/plugins/specweave/skills/increment-planner/SKILL.md +388 -48
  304. package/plugins/specweave/skills/increment-planner/templates/spec-multi-project.md +17 -7
  305. package/plugins/specweave/skills/increment-planner/templates/spec-single-project.md +6 -1
  306. package/plugins/specweave/skills/increment-planner/templates/tasks-multi-project.md +1 -1
  307. package/plugins/specweave/skills/increment-planner/templates/tasks-single-project.md +1 -1
  308. package/plugins/specweave/skills/instant-status/SKILL.md +70 -0
  309. package/plugins/specweave-ado/commands/cleanup-duplicates.md +212 -0
  310. package/plugins/specweave-ado/commands/reconcile.md +120 -0
  311. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  312. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  313. package/plugins/specweave-ado/lib/ado-duplicate-detector.js +279 -0
  314. package/plugins/specweave-ado/lib/ado-duplicate-detector.ts +407 -0
  315. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  316. package/plugins/specweave-docs/commands/build.md +32 -4
  317. package/plugins/specweave-docs/commands/preview.md +43 -1
  318. package/plugins/specweave-docs/commands/validate.md +250 -0
  319. package/plugins/specweave-github/agents/github-manager/AGENT.md +2 -2
  320. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1262 -0
  321. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  322. package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
  323. package/plugins/specweave-infrastructure/skills/hetzner-provisioner/README.md +1 -1
  324. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +1 -1
  325. package/plugins/specweave-jira/agents/jira-multi-project-mapper/AGENT.md +530 -0
  326. package/plugins/specweave-jira/agents/jira-sync-judge/AGENT.md +438 -0
  327. package/plugins/specweave-jira/commands/cleanup-duplicates.md +219 -0
  328. package/plugins/specweave-jira/commands/close.md +297 -0
  329. package/plugins/specweave-jira/commands/create.md +198 -0
  330. package/plugins/specweave-jira/commands/reconcile.md +123 -0
  331. package/plugins/specweave-jira/commands/status.md +215 -0
  332. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  333. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
  334. package/plugins/specweave-jira/lib/jira-duplicate-detector.js +296 -0
  335. package/plugins/specweave-jira/lib/jira-duplicate-detector.ts +434 -0
  336. package/plugins/specweave-jira/lib/jira-permission-gate.js +160 -0
  337. package/plugins/specweave-jira/lib/jira-permission-gate.ts +276 -0
  338. package/plugins/specweave-jira/lib/jira-profile-resolver.js +222 -0
  339. package/plugins/specweave-jira/lib/jira-profile-resolver.ts +427 -0
  340. package/plugins/specweave-jira/reference/jira-specweave-mapping.md +16 -11
  341. package/plugins/specweave-release/commands/specweave-release-npm.md +140 -14
  342. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1254 -0
  343. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  344. package/plugins/specweave/hooks/post-edit-spec.sh +0 -265
  345. package/plugins/specweave/hooks/post-write-spec.sh +0 -267
  346. package/plugins/specweave/hooks/pre-edit-spec.sh +0 -151
  347. package/plugins/specweave/hooks/pre-write-spec.sh +0 -151
@@ -89,6 +89,19 @@ status was set to "completed" without ACs being checked or user approval.
89
89
  ```typescript
90
90
  import { IncrementCompletionValidator } from '../../../src/core/increment/completion-validator.js';
91
91
  import { DesyncDetector } from '../../../src/core/increment/desync-detector.js';
92
+ import { ACStatusManager } from '../../../src/core/increment/ac-status-manager.js';
93
+
94
+ // **NEW (2025-12-08)**: Sync ACs BEFORE validation to prevent race conditions
95
+ // The background hook (post-task-completion.sh) may not have completed yet
96
+ // This ensures spec.md ACs are up-to-date with tasks.md completion status
97
+ console.log('🔄 Syncing AC status before validation...');
98
+ const acManager = new ACStatusManager(projectRoot);
99
+ const acSyncResult = await acManager.syncACStatus(incrementId);
100
+ if (acSyncResult.synced && acSyncResult.updated.length > 0) {
101
+ console.log(`✅ Updated ${acSyncResult.updated.length} ACs: ${acSyncResult.updated.join(', ')}`);
102
+ } else {
103
+ console.log('✅ AC status already in sync');
104
+ }
92
105
 
93
106
  // **NEW (2025-11-20)**: Validate no status desync exists
94
107
  // This prevents closing increments with inconsistent metadata.json and spec.md
@@ -622,6 +635,102 @@ const syncEnabled = config.hooks?.post_increment_done?.sync_to_github_project ==
622
635
  ℹ️ No GitHub issue linked to this increment
623
636
  ```
624
637
 
638
+ #### B.2) Auto-Close External-Origin GitHub Issue (NEW - v0.32.2+)
639
+
640
+ **For increments with E-suffix (external origin), auto-close the source issue:**
641
+
642
+ **This is different from section B** which handles issues created BY SpecWeave. Section B.2 handles issues that SpecWeave increments were CREATED FROM (imported from GitHub).
643
+
644
+ **Check metadata** (`.specweave/increments/0118E-name/metadata.json`):
645
+ ```json
646
+ {
647
+ "origin": "external",
648
+ "external_ref": "github#anton-abyzov/specweave#786"
649
+ }
650
+ ```
651
+
652
+ **If external_ref exists AND starts with "github#"**:
653
+
654
+ 1. **Parse the external_ref format**:
655
+ ```typescript
656
+ const externalRef = metadata.external_ref;
657
+
658
+ if (externalRef && externalRef.startsWith('github#')) {
659
+ // Parse: github#owner/repo#issue_number
660
+ const match = externalRef.match(/^github#([^#]+)#(\d+)$/);
661
+ if (match) {
662
+ const [, ownerRepo, issueNumber] = match;
663
+ // ownerRepo = "anton-abyzov/specweave"
664
+ // issueNumber = "786"
665
+ }
666
+ }
667
+ ```
668
+
669
+ 2. **Check canUpdateStatus permission**:
670
+ ```typescript
671
+ const configPath = path.join(projectRoot, '.specweave/config.json');
672
+ const config = await readJson(configPath);
673
+
674
+ if (!config.sync?.settings?.canUpdateStatus) {
675
+ console.log('⚠️ Skipping external issue closure - canUpdateStatus is disabled');
676
+ console.log('💡 Enable in .specweave/config.json: sync.settings.canUpdateStatus: true');
677
+ return;
678
+ }
679
+ ```
680
+
681
+ 3. **Close issue via gh CLI with completion summary**:
682
+ ```bash
683
+ gh issue close 786 -R anton-abyzov/specweave --comment "$(cat <<'EOF'
684
+ ✅ **Fixed in SpecWeave increment 0118E**
685
+
686
+ ## PM Validation Passed
687
+ - ✅ Gate 1: All tasks completed
688
+ - ✅ Gate 2: Tests passing
689
+ - ✅ Gate 3: Documentation updated
690
+
691
+ ## Deliverables
692
+ [Summary of key deliverables from increment]
693
+
694
+ ## Duration
695
+ Started: 2025-12-07
696
+ Completed: 2025-12-07
697
+ Duration: 1 day
698
+
699
+ 🔗 Closed automatically by `/specweave:done`
700
+ EOF
701
+ )"
702
+ ```
703
+
704
+ 4. **Handle errors gracefully**:
705
+ - If `gh` CLI not installed: `⚠️ GitHub CLI not installed. Install: brew install gh`
706
+ - If `gh` not authenticated: `⚠️ GitHub auth failed. Run: gh auth login`
707
+ - If issue already closed: `ℹ️ Issue #786 already closed`
708
+ - If rate limited: `⚠️ GitHub rate limit. Retry later or close manually: gh issue close 786`
709
+
710
+ **Expected output (success)**:
711
+ ```
712
+ 🐙 External Issue Closure:
713
+ ✓ Detected external_ref: github#anton-abyzov/specweave#786
714
+ ✓ Permission check passed (canUpdateStatus: true)
715
+ ✓ Closing GitHub issue #786...
716
+ ✓ Issue #786 closed with completion summary
717
+ ```
718
+
719
+ **Expected output (permission denied)**:
720
+ ```
721
+ 🐙 External Issue Closure:
722
+ ✓ Detected external_ref: github#anton-abyzov/specweave#786
723
+ ⚠️ Skipping - canUpdateStatus is disabled in config
724
+ 💡 Enable in .specweave/config.json to auto-close external issues
725
+ ```
726
+
727
+ **Expected output (no external ref)**:
728
+ ```
729
+ ℹ️ No external_ref in metadata (not an external-origin increment)
730
+ ```
731
+
732
+ **IMPORTANT**: This section runs ONLY for external-origin increments (E-suffix). Regular increments (without E-suffix) skip this section entirely.
733
+
625
734
  #### C) Sync Status to External Tools (NEW in Phase 2)
626
735
 
627
736
  **CRITICAL**: After increment completes, automatically sync status to all linked external tools (GitHub, JIRA, Azure DevOps).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: specweave:import-external
3
- description: Pull external work items from GitHub, JIRA, or Azure DevOps into living docs as READ-ONLY REFERENCES (not increments). To implement imported items, manually create an increment. Supports time range filtering and dry-run mode.
3
+ description: AUTO-EXECUTE import of external work items (GitHub/JIRA/ADO) since last import. NO PROMPTS - immediately runs with defaults. Creates READ-ONLY references in living docs. Options available but NOT required.
4
4
  ---
5
5
 
6
6
  # Import External Work Items (Reference Import)
@@ -9,6 +9,29 @@ Import work items from GitHub (issues/milestones), JIRA (epics/stories), or Azur
9
9
 
10
10
  > **Important**: This command creates a **reference catalog**, NOT increments. Imported items have E-suffix IDs (US-001E, FS-042E). To implement an imported item, you must **manually create an increment** that references it.
11
11
 
12
+ ## CRITICAL: Default Behavior (NO PROMPTS!)
13
+
14
+ **When user runs `/specweave:import-external` with NO arguments:**
15
+ 1. **IMMEDIATELY execute** with default settings - DO NOT show menus or ask questions
16
+ 2. **Default = "since last import"** - auto-detects from `.specweave/sync-metadata.json`
17
+ 3. **If first import ever** - defaults to last 1 month
18
+ 4. **Import from ALL configured platforms** (GitHub, JIRA, ADO - whichever are configured)
19
+
20
+ **WRONG behavior** (DO NOT DO THIS):
21
+ ```
22
+ ❌ "What would you like to import?"
23
+ ❌ "Which option would you like?"
24
+ ❌ "Should I run a dry run first?"
25
+ ❌ Showing a menu of options
26
+ ```
27
+
28
+ **CORRECT behavior**:
29
+ ```
30
+ ✅ Immediately start importing
31
+ ✅ Show progress: "🔄 Importing from GitHub... [25/150]"
32
+ ✅ Show summary when done
33
+ ```
34
+
12
35
  ## What This Does
13
36
 
14
37
  1. **Detects configured external tools** (GitHub, JIRA, ADO) from environment/config
@@ -25,10 +48,10 @@ Import work items from GitHub (issues/milestones), JIRA (epics/stories), or Azur
25
48
  /specweave:import-external [options]
26
49
  ```
27
50
 
28
- ### Options
51
+ ### Options (ALL OPTIONAL - defaults work without them)
29
52
 
30
53
  - `--since=<range>` - Time range filter (default: since last import)
31
- - `last` - Since last import (uses sync metadata)
54
+ - `last` - Since last import (uses sync metadata) **← DEFAULT**
32
55
  - `1m`, `3m`, `6m` - Last 1/3/6 months
33
56
  - `all` - All items (no time filter)
34
57
  - Custom: `2025-01-01` - Since specific date (ISO format)
@@ -39,25 +62,28 @@ Import work items from GitHub (issues/milestones), JIRA (epics/stories), or Azur
39
62
 
40
63
  ## Examples
41
64
 
42
- ### Example 1: Import New Items (Default)
65
+ ### Example 1: Import New Items (Default - NO PROMPTS!)
43
66
 
44
67
  ```bash
45
68
  /specweave:import-external
46
69
 
47
- # Uses default behavior:
48
- # - Imports from ALL configured platforms (GitHub, JIRA, ADO)
49
- # - Since last import timestamp (from .specweave/sync-metadata.json)
50
- # - Creates living docs files
51
- # - Updates sync metadata
70
+ # IMMEDIATELY executes with defaults:
71
+ # - Since last import (or 1 month if first import)
72
+ # - All configured platforms
52
73
 
53
- # Result:
54
- # 🔄 Importing from GitHub... [30/30] ✓
55
- # 🔄 Importing from JIRA... [12/12] ✓
74
+ # Output (NO QUESTIONS ASKED):
75
+ # 📥 Import External Work Items
76
+ #
77
+ # 📋 Import Configuration:
78
+ # Platforms: GITHUB
79
+ # Time range: last
80
+ # Dry run: No
81
+ #
82
+ # 🔗 Imported from GITHUB: 15 items
83
+ #
56
84
  # 📊 Import Summary:
57
- # Total imported: 42 items
58
- # - GitHub: 30 items (US-201E to US-230E)
59
- # - JIRA: 12 items (US-231E to US-242E)
60
- # Duplicates skipped: 5 items
85
+ # Total imported: 15 items
86
+ # 🔗 GITHUB: 15 items
61
87
  # ✅ Import complete!
62
88
  ```
63
89
 
@@ -359,10 +385,11 @@ No tasks defined.
359
385
  | Feature | `specweave init` | `/specweave:import-external` |
360
386
  |---------|------------------|------------------------------|
361
387
  | When to use | First-time setup | Ongoing imports after init |
362
- | User prompts | Interactive setup | Minimal prompts (confirmation only) |
363
- | Time range | Configurable (default: 1 month) | Since last import (default) |
388
+ | User prompts | Interactive setup | **NONE** (auto-execute with defaults) |
389
+ | Time range | Configurable (default: 1 month) | Since last import (auto-detected) |
364
390
  | Config update | Creates `.specweave/config.json` | Uses existing config |
365
391
  | Primary use case | Brownfield onboarding | Stay in sync with external tools |
392
+ | Execution | Step-by-step wizard | **Immediate** (no questions asked) |
366
393
 
367
394
  ## Troubleshooting
368
395
 
@@ -395,53 +395,265 @@ const structureConfig = detectStructureLevel(projectRoot);
395
395
  6. Multi-project config (`multiProject.enabled`)
396
396
  7. Existing folder structure (fallback)
397
397
 
398
- **For 1-Level Structure** (projects only):
398
+ **Project/Board Selection - ULTRA-SMART LOGIC:**
399
+
400
+ **⚠️ CORE PRINCIPLE: Each User Story belongs to exactly ONE project (1-level) or ONE project+board (2-level). An increment can contain USs spanning MULTIPLE projects/boards.**
401
+
402
+ ---
403
+
404
+ #### SMART SELECTION RULES
405
+
406
+ **RULE 1: NO QUESTION IF ONLY 1 OPTION**
407
+ ```
408
+ IF 1-level AND only 1 project → AUTO-SELECT silently, NO question
409
+ IF 2-level AND only 1 project AND only 1 board → AUTO-SELECT silently, NO question
410
+ ```
411
+
412
+ **RULE 2: KEYWORD-BASED AUTO-DETECTION**
413
+
414
+ Analyze feature description for keywords before asking:
415
+
416
+ **Project-Level Keywords (1-level and 2-level):**
417
+ ```
418
+ Frontend (FE): UI, form, button, page, component, React, Vue, Angular,
419
+ Next.js, CSS, style, responsive, chart, dashboard, view,
420
+ modal, widget, Tailwind, Material-UI, Recharts
421
+
422
+ Backend (BE): API, endpoint, REST, GraphQL, database, query, migration,
423
+ service, controller, authentication, JWT, session, middleware,
424
+ CRUD, Redis, PostgreSQL, MongoDB, microservice
425
+
426
+ Mobile: mobile, iOS, Android, React Native, Flutter, Expo, app, native,
427
+ push notification, offline, AsyncStorage, screen, touch, gesture
428
+
429
+ Infrastructure: deploy, CI/CD, Docker, Kubernetes, terraform, monitoring,
430
+ logging, pipeline, AWS, Azure, GCP, nginx, Helm, ArgoCD
431
+
432
+ Shared: types, interfaces, utilities, validators, shared, common, library,
433
+ SDK, models, constants, helpers
434
+ ```
435
+
436
+ **Board-Level Keywords (2-level structures only):**
437
+ ```
438
+ When project has multiple boards, also match board-specific keywords:
439
+
440
+ analytics/reporting: analytics, metrics, KPI, dashboard, report, chart, graph
441
+ user-management: user, auth, login, registration, profile, permissions, roles
442
+ integrations: integration, webhook, API, third-party, sync, import, export
443
+ payments: payment, billing, subscription, invoice, stripe, checkout
444
+ notifications: notification, alert, email, SMS, push, messaging
445
+ devops/platform: deploy, infrastructure, monitoring, CI/CD, pipeline
446
+ ```
447
+
448
+ **RULE 3: CONFIDENCE CALCULATION FORMULA**
449
+ ```
450
+ confidence = (matched_keywords / total_feature_keywords) × 100
451
+
452
+ Example: "Add React login form with JWT authentication"
453
+ Keywords found: React (FE), login (FE), form (FE), JWT (BE), authentication (BE)
454
+ FE matches: 3, BE matches: 2
455
+ FE confidence: 3/5 = 60%
456
+ BE confidence: 2/5 = 40%
457
+ → Primary: FE (60%), Secondary: BE (40%)
458
+ → SUGGEST: "Frontend (60%), but also touches Backend (40%)"
459
+
460
+ If multiple projects have similar confidence (within 15%):
461
+ → Treat as MULTI-PROJECT feature
462
+ → Auto-split USs by detected keywords
463
+ ```
464
+
465
+ **RULE 4: CONFIDENCE-BASED DECISION**
466
+ ```
467
+ >80% single project → AUTO-SELECT with notification (no question)
468
+ 50-80% single project → SUGGEST with quick confirm option
469
+ Multiple projects within 15% → AUTO-SPLIT across projects
470
+ <50% OR ambiguous → ASK user with ALL options listed
471
+ ```
472
+
473
+ **RULE 5: FALLBACK TO DEFAULTS**
474
+ ```
475
+ IF US has explicit **Project**: field → USE IT
476
+ ELSE IF frontmatter has default_project → USE default_project
477
+ ELSE → ASK user (should not happen if flow followed correctly)
478
+
479
+ Same logic applies to **Board**: and default_board for 2-level
399
480
  ```
400
- 📁 Structure Level: 1 (projects only)
401
- Available projects: web-app, mobile-app, platform-infra
402
481
 
403
- Which project should this increment target?
404
- > web-app
482
+ ---
483
+
484
+ #### DECISION FLOWCHART
485
+
486
+ ```
487
+ START
488
+
489
+
490
+ ┌─────────────────────────────────────┐
491
+ │ 1. Detect structure level (1 or 2) │
492
+ │ 2. Count available projects/boards │
493
+ └─────────────────────────────────────┘
494
+
495
+
496
+ ┌─────────────────────────────────────┐
497
+ │ ONLY 1 OPTION? │
498
+ │ (1-level: 1 project) │
499
+ │ (2-level: 1 project + 1 board) │
500
+ └─────────────────────────────────────┘
501
+
502
+ ├── YES ──► AUTO-SELECT SILENTLY
503
+ │ "✅ Project: {name} (auto-selected)"
504
+ │ NO QUESTION ASKED
505
+
506
+ ▼ NO
507
+ ┌─────────────────────────────────────┐
508
+ │ ANALYZE KEYWORDS in feature desc │
509
+ │ Calculate confidence per project │
510
+ └─────────────────────────────────────┘
511
+
512
+ ├── HIGH (>80% single) ──► AUTO-SELECT + NOTIFY
513
+ │ "✅ Detected: {project} (keywords: React, form)"
514
+
515
+ ├── MULTI-PROJECT (within 15%) ──► AUTO-SPLIT USs
516
+ │ "🔀 Multi-project detected:
517
+ │ • US-001 (Login UI) → web-app (60%)
518
+ │ • US-002 (Auth API) → api-service (55%)
519
+ │ Proceed? (Y/n)"
520
+
521
+ ├── MEDIUM (50-80%) ──► SUGGEST + CONFIRM
522
+ │ "📍 Suggested: {project}. Confirm? (Y/n)"
523
+
524
+ ▼ LOW (<50%)
525
+ ┌─────────────────────────────────────┐
526
+ │ ASK with ALL options (multiSelect) │
527
+ │ Never truncate, never hide options │
528
+ └─────────────────────────────────────┘
529
+ ```
530
+
531
+ ---
532
+
533
+ #### PER-USER-STORY ASSIGNMENT
534
+
535
+ **CRITICAL: Assignment is at USER STORY level, not increment level!**
536
+
537
+ Each US has its own project (and board for 2-level):
538
+ ```markdown
539
+ ### US-001: Login Form UI
540
+ **Project**: web-app
541
+ **Board**: frontend <!-- 2-level only -->
542
+
543
+ ### US-002: Auth API Endpoints
544
+ **Project**: api-service
545
+ **Board**: backend <!-- 2-level only -->
546
+
547
+ ### US-003: Mobile Login
548
+ **Project**: mobile-app
549
+ **Board**: mobile-team <!-- 2-level only -->
550
+ ```
551
+
552
+ **User can manually edit project/board per US in spec.md anytime!**
405
553
 
406
- ✅ spec.md will include: project: web-app
407
- ✅ Sync path: internal/specs/web-app/FS-XXX/
554
+ ---
555
+
556
+ #### EXAMPLE SCENARIOS
557
+
558
+ **Scenario 1: Single Project (NO QUESTION)**
408
559
  ```
560
+ Config: 1 project (my-app)
561
+ Feature: "Add dark mode toggle"
409
562
 
410
- **For 2-Level Structure** (projects + boards):
563
+ AUTO-SELECT: my-app
564
+ → Output: "✅ Project: my-app (single project - auto-selected)"
565
+ → NO question asked
411
566
  ```
412
- 📁 Structure Level: 2 (projects + boards)
413
- Available projects: acme-corp
414
567
 
415
- 📁 Project: acme-corp
416
- Boards: clinical-insights, platform-engineering, digital-operations
568
+ **Scenario 2: Multiple Projects, Clear Keywords (AUTO-DETECT)**
569
+ ```
570
+ Config: 3 projects (web-app, api-service, mobile-app)
571
+ Feature: "Add React dashboard with charts"
417
572
 
418
- Which board should this increment sync to?
419
- > clinical-insights
573
+ Keywords: "React" (FE), "dashboard" (FE), "charts" (FE)
574
+ Confidence: 95% → web-app
575
+ → Output: "✅ Detected: web-app (keywords: React, dashboard, charts)"
576
+ → NO question (high confidence)
577
+ ```
420
578
 
421
- spec.md will include:
422
- project: acme-corp
423
- board: clinical-insights
424
- ✅ Sync path: internal/specs/acme-corp/clinical-insights/FS-XXX/
579
+ **Scenario 3: Multi-Area Feature (SMART SPLIT)**
425
580
  ```
581
+ Config: 3 projects (web-app, api-service, shared-lib)
582
+ Feature: "User authentication with JWT"
583
+
584
+ → This spans FE (login form) + BE (auth API) + shared (types)
585
+ → Output:
586
+ "🔍 This feature spans multiple projects. Auto-assigning:
587
+ • US-001: Login UI → web-app
588
+ • US-002: Auth API → api-service
589
+ • US-003: Auth types → shared-lib
426
590
 
427
- **Multi-Project User Stories** (if umbrella detected):
591
+ Proceed? You can modify per-US in spec.md"
428
592
  ```
429
- 📁 Multi-Project Mode Detected!
430
593
 
431
- Child Repos:
432
- • FE: sw-thumbnail-ab-fe
433
- • BE: sw-thumbnail-ab-be
434
- • SHARED: sw-thumbnail-ab-shared
594
+ **Scenario 4: 2-Level, Single Project, Multiple Boards**
595
+ ```
596
+ Config: 1 project (enterprise-corp), 5 boards
597
+ Feature: "Add reporting dashboard"
598
+
599
+ → Project: AUTO-SELECT (only 1)
600
+ → Board keywords: "reporting" + "dashboard"
601
+ → Output:
602
+ "✅ Project: enterprise-corp (auto-selected)
603
+ 📍 Suggested board: analytics (keyword: reporting)
604
+ Confirm or select: [1] analytics [2] frontend [3] backend..."
605
+ ```
435
606
 
436
- User stories will be generated with project prefixes:
437
- • US-FE-001, US-FE-002 (Frontend stories)
438
- US-BE-001, US-BE-002 (Backend stories)
439
- US-SHARED-001 (Shared library stories)
607
+ **Scenario 5: Ambiguous (ASK WITH ALL OPTIONS)**
608
+ ```
609
+ Config: 4 projects
610
+ Feature: "Improve system performance"
440
611
 
441
- Each story will include "Related Repo" field for clarity.
612
+ No clear keyword match
613
+ → ASK with ALL options listed (multiSelect: true)
614
+ → Never hide behind "see all"
442
615
  ```
443
616
 
444
- **Pass project/board values to increment-planner skill!**
617
+ ---
618
+
619
+ #### VALIDATION RULES
620
+
621
+ ```
622
+ ❌ FORBIDDEN: Asking when only 1 project/board exists
623
+ ❌ FORBIDDEN: Hiding options behind "Let me see all"
624
+ ❌ FORBIDDEN: Truncating project/board lists
625
+ ❌ FORBIDDEN: Assigning ALL USs to same project when content differs
626
+ ✅ REQUIRED: Auto-select when only 1 option
627
+ ✅ REQUIRED: Use keyword matching before asking
628
+ ✅ REQUIRED: Each US has explicit project/board assignment
629
+ ✅ REQUIRED: When asking, show ALL options with descriptions
630
+ ✅ REQUIRED: Allow user to modify per-US in spec.md
631
+ ```
632
+
633
+ ---
634
+
635
+ #### SPEC.MD YAML FORMAT
636
+
637
+ **1-Level Structure:**
638
+ ```yaml
639
+ ---
640
+ increment: 0045-user-auth
641
+ title: "User Authentication"
642
+ default_project: web-app # Optional default for USs that don't specify
643
+ ---
644
+ ```
645
+
646
+ **2-Level Structure:**
647
+ ```yaml
648
+ ---
649
+ increment: 0045-user-auth
650
+ title: "User Authentication"
651
+ default_project: enterprise-corp
652
+ default_board: backend # Optional defaults
653
+ ---
654
+ ```
655
+
656
+ **Pass detected/selected values to increment-planner skill!**
445
657
 
446
658
  ### Step 2: Detect tech stack (CRITICAL - framework-agnostic)
447
659
  - Settings auto-detected
@@ -659,12 +871,98 @@ This will:
659
871
 
660
872
  ```
661
873
  ✅ Strategic documentation synchronized!
874
+ ```
875
+
876
+ ### Step 10: Trigger Living Docs & External Tool Sync (v0.32.2+)
877
+
878
+ **🔄 CRITICAL: After increment files are created, sync to living docs AND external tools:**
879
+
880
+ ```
881
+ 🔄 Syncing increment to living docs...
882
+ 📡 Syncing to external tools (GitHub/JIRA/ADO)...
883
+ ```
884
+
885
+ **This step uses the existing sync infrastructure:**
886
+
887
+ Run `/specweave:sync-specs {increment-id}` to trigger the full sync cascade:
888
+
889
+ ```bash
890
+ /specweave:sync-specs {increment-id}
891
+ ```
892
+
893
+ OR call LivingDocsSync directly in TypeScript implementations:
894
+
895
+ ```typescript
896
+ import { LivingDocsSync } from './src/core/living-docs/living-docs-sync.js';
897
+
898
+ const sync = new LivingDocsSync(projectRoot);
899
+ const result = await sync.syncIncrement(incrementId, { dryRun: false });
900
+
901
+ if (result.success) {
902
+ console.log(`✅ Living docs synced: ${result.featureId}`);
903
+ console.log(` Created: ${result.filesCreated.length} files`);
904
+ } else {
905
+ console.log(`⚠️ Living docs sync had errors (non-blocking): ${result.errors.join(', ')}`);
906
+ }
907
+ ```
908
+
909
+ **What `syncIncrement()` does automatically (Step 7 in the sync flow):**
910
+
911
+ 1. Creates living docs (FS-XXX folder with FEATURE.md and us-*.md files)
912
+ 2. Calls `syncToExternalTools()` which detects GitHub/JIRA/ADO from config
913
+ 3. Checks permissions (`canUpsertInternalItems`) before creating issues
914
+ 4. Creates issues in external tools via existing sync infrastructure:
915
+ - GitHub: `GitHubFeatureSync.syncFeatureToGitHub(featureId)`
916
+ - JIRA: `JiraFeatureSync.syncFeatureToJira(featureId)`
917
+ - ADO: `ADOFeatureSync.syncFeatureToADO(featureId)`
918
+
919
+ **Expected output:**
920
+
921
+ ```
922
+ 🔄 Syncing increment to living docs...
923
+ ✅ Living docs synced: FS-118E
924
+ Created: 4 files (FEATURE.md, us-001.md, us-002.md, us-003.md)
925
+
926
+ 📡 Syncing to external tools: github
927
+ 📋 Permissions: upsert=true, update=true, status=true
928
+ ✅ Synced to GitHub: 0 updated, 3 created
929
+ ```
930
+
931
+ **Permission-aware sync (v0.32.2+):**
932
+
933
+ Before calling external sync, `syncToExternalTools()` checks permissions from `.specweave/config.json`:
934
+
935
+ | Permission | Controls | When Required |
936
+ |------------|----------|---------------|
937
+ | `canUpsertInternalItems` | CREATE new issues for SpecWeave-created items | Creating increment issues |
938
+ | `canUpdateExternalItems` | UPDATE issues imported from external tools | Updating imported items |
939
+ | `canUpdateStatus` | UPDATE issue status (open/closed) | Closing completed items |
940
+
941
+ If `canUpsertInternalItems: false`:
942
+ ```
943
+ ⚠️ Skipping external sync - canUpsertInternalItems is disabled in config
944
+ 💡 Enable in .specweave/config.json: sync.settings.canUpsertInternalItems: true
945
+ ```
946
+
947
+ **Error handling:**
948
+
949
+ External tool sync failures are **NON-BLOCKING** (increment creation succeeds):
950
+
951
+ ```
952
+ ⚠️ External sync failed: Rate limit exceeded
953
+ 💡 Run /specweave:sync-specs {increment-id} to retry
954
+ ```
955
+
956
+ **After Step 10 completes:**
957
+
958
+ ```
959
+ ✅ Increment created and synced!
662
960
 
663
961
  Next steps:
664
962
  1. Review the increment plan and strategic docs
665
- 2. Start implementation: /specweave:do 0003
666
- 3. (Optional) Sync to GitHub: /sync-github
667
- ```
963
+ 2. Start implementation: /specweave:do {increment-id}
964
+ 3. Monitor external tool status: /specweave:status {increment-id}
965
+ ```
668
966
 
669
967
  ## Frontmatter Format (spec.md):
670
968
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: specweave:jobs
3
- description: Monitor background jobs (repo cloning, issue import). Shows progress, allows pause/resume/kill.
4
- usage: /specweave:jobs [--active|--all|--id <job-id>] [--resume <job-id>] [--kill <job-id>] [--follow <job-id>] [--logs <job-id>]
3
+ description: Show current work status (active increments, progress) and background jobs (imports, cloning). Even with no jobs, shows increment summary and helpful context.
4
+ usage: /specweave:jobs [--all] [--id <job-id>] [--resume <job-id>] [--kill <job-id>] [--follow <job-id>] [--logs <job-id>]
5
5
  ---
6
6
 
7
7
  # Background Jobs Monitor
@@ -18,12 +18,12 @@ Simple, fast progress check for all active increments.
18
18
  ```bash
19
19
  #!/bin/bash
20
20
  #
21
- # Enhanced progress tracking with User Story grouping (v0.23.0+)
22
- # Uses TypeScript script for accurate task parsing and US-level progress
21
+ # Instant progress tracking (v0.32.0+)
22
+ # Uses pre-computed dashboard cache for <10ms response time
23
23
  #
24
24
 
25
- # Call TypeScript progress script
26
- npx tsx "$(dirname "${BASH_SOURCE[0]}")"/../../../scripts/show-progress.ts "$@"
25
+ # Call instant bash script (reads from cache, no Node.js needed)
26
+ bash "$(dirname "${BASH_SOURCE[0]}")"/../scripts/read-progress.sh "$@"
27
27
  ```
28
28
 
29
29
  ## Example Output
@@ -25,10 +25,11 @@ Restore an archived feature or epic back to its active location. This also resto
25
25
 
26
26
  ## What Gets Restored
27
27
 
28
- ### For Features:
29
- 1. `_features/_archive/FS-XXX/` → `_features/FS-XXX/`
30
- 2. `{project}/_archive/FS-XXX/` `{project}/FS-XXX/` (all projects)
31
- 3. All links updated from archive paths back to active paths
28
+ ### For Features (v5.0.0+):
29
+ 1. `{project}/_archive/FS-XXX/` → `{project}/FS-XXX/`
30
+ 2. All links updated from archive paths back to active paths
31
+
32
+ **Note**: The `_features/` folder is OBSOLETE. Features live in `{project}/FS-XXX/`.
32
33
 
33
34
  ### For Epics:
34
35
  1. `_epics/_archive/EPIC-XXX/` → `_epics/EPIC-XXX/`
@@ -597,7 +597,7 @@ Status: {status} → Documentation Updated
597
597
  ✅ User Stories: {count} created/updated in .specweave/docs/internal/specs/
598
598
  ✅ Acceptance Criteria: Synchronized with completion status from spec.md
599
599
  ✅ Tasks: Linked to user stories with completion tracking
600
- ✅ Feature Files: Created/updated in .specweave/docs/internal/specs/_features/
600
+ ✅ Feature Files: Created/updated in .specweave/docs/internal/specs/{project}/
601
601
 
602
602
  ───────────────────────────────────────────────────────
603
603
  📊 STRATEGIC DOCS CHANGES (Steps 1-5)