specweave 0.22.13 → 0.23.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 (312) hide show
  1. package/.claude-plugin/README.md +2 -2
  2. package/CLAUDE.md +447 -52
  3. package/README.md +33 -10
  4. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +1 -1
  5. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  6. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  7. package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-spec-content-sync.d.ts.map +1 -1
  9. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js +4 -1
  10. package/dist/plugins/specweave-github/lib/github-spec-content-sync.js.map +1 -1
  11. package/dist/plugins/specweave-github/lib/github-spec-sync.d.ts +1 -1
  12. package/dist/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  13. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts +9 -0
  14. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.d.ts.map +1 -1
  15. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +10 -1
  16. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
  17. package/dist/plugins/specweave-github/lib/progress-comment-builder.js +2 -2
  18. package/dist/plugins/specweave-github/lib/progress-comment-builder.js.map +1 -1
  19. package/dist/plugins/specweave-github/lib/types.d.ts +1 -1
  20. package/dist/src/cli/commands/import-external.d.ts +22 -0
  21. package/dist/src/cli/commands/import-external.d.ts.map +1 -0
  22. package/dist/src/cli/commands/import-external.js +282 -0
  23. package/dist/src/cli/commands/import-external.js.map +1 -0
  24. package/dist/src/cli/commands/init.d.ts.map +1 -1
  25. package/dist/src/cli/commands/init.js +359 -1
  26. package/dist/src/cli/commands/init.js.map +1 -1
  27. package/dist/src/cli/helpers/github-repo-selector.d.ts +59 -0
  28. package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -0
  29. package/dist/src/cli/helpers/github-repo-selector.js +265 -0
  30. package/dist/src/cli/helpers/github-repo-selector.js.map +1 -0
  31. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  32. package/dist/src/cli/helpers/issue-tracker/index.js +41 -24
  33. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  34. package/dist/src/config/import-config.d.ts +69 -0
  35. package/dist/src/config/import-config.d.ts.map +1 -0
  36. package/dist/src/config/import-config.js +136 -0
  37. package/dist/src/config/import-config.js.map +1 -0
  38. package/dist/src/config/types.d.ts +26 -26
  39. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
  40. package/dist/src/core/increment/ac-status-manager.js +4 -2
  41. package/dist/src/core/increment/ac-status-manager.js.map +1 -1
  42. package/dist/src/core/increment/completion-validator.d.ts +30 -1
  43. package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
  44. package/dist/src/core/increment/completion-validator.js +151 -3
  45. package/dist/src/core/increment/completion-validator.js.map +1 -1
  46. package/dist/src/core/increment/increment-archiver.d.ts +25 -0
  47. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  48. package/dist/src/core/increment/increment-archiver.js +130 -3
  49. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  50. package/dist/src/core/living-docs/feature-archiver.d.ts +37 -0
  51. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  52. package/dist/src/core/living-docs/feature-archiver.js +262 -18
  53. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  54. package/dist/src/core/living-docs/feature-id-manager.d.ts +17 -0
  55. package/dist/src/core/living-docs/feature-id-manager.d.ts.map +1 -1
  56. package/dist/src/core/living-docs/feature-id-manager.js +25 -0
  57. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  58. package/dist/src/core/living-docs/living-docs-sync.d.ts +16 -0
  59. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  60. package/dist/src/core/living-docs/living-docs-sync.js +56 -1
  61. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  62. package/dist/src/core/living-docs/task-project-specific-generator.d.ts +2 -2
  63. package/dist/src/core/living-docs/task-project-specific-generator.js +2 -2
  64. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +2 -2
  65. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  66. package/dist/src/core/repo-structure/prompt-consolidator.js +3 -15
  67. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  68. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +1 -1
  69. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  70. package/dist/src/core/repo-structure/repo-structure-manager.js +3 -6
  71. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  72. package/dist/src/core/spec-content-sync.d.ts +4 -1
  73. package/dist/src/core/spec-content-sync.d.ts.map +1 -1
  74. package/dist/src/core/spec-content-sync.js +139 -4
  75. package/dist/src/core/spec-content-sync.js.map +1 -1
  76. package/dist/src/core/spec-task-mapper.d.ts.map +1 -1
  77. package/dist/src/core/spec-task-mapper.js +9 -8
  78. package/dist/src/core/spec-task-mapper.js.map +1 -1
  79. package/dist/src/core/status-line-validator.d.ts +63 -0
  80. package/dist/src/core/status-line-validator.d.ts.map +1 -0
  81. package/dist/src/core/status-line-validator.js +253 -0
  82. package/dist/src/core/status-line-validator.js.map +1 -0
  83. package/dist/src/core/sync/bidirectional-engine.d.ts +10 -1
  84. package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
  85. package/dist/src/core/sync/bidirectional-engine.js +10 -1
  86. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  87. package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
  88. package/dist/src/core/sync/profile-manager.js +3 -0
  89. package/dist/src/core/sync/profile-manager.js.map +1 -1
  90. package/dist/src/core/sync/project-context.d.ts.map +1 -1
  91. package/dist/src/core/sync/project-context.js +3 -0
  92. package/dist/src/core/sync/project-context.js.map +1 -1
  93. package/dist/src/core/sync/status-sync-engine.d.ts +1 -1
  94. package/dist/src/core/sync/status-sync-engine.js +1 -1
  95. package/dist/src/core/sync/sync-event-logger.d.ts +15 -1
  96. package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -1
  97. package/dist/src/core/sync/sync-event-logger.js +39 -1
  98. package/dist/src/core/sync/sync-event-logger.js.map +1 -1
  99. package/dist/src/core/types/origin-metadata.d.ts +153 -0
  100. package/dist/src/core/types/origin-metadata.d.ts.map +1 -0
  101. package/dist/src/core/types/origin-metadata.js +166 -0
  102. package/dist/src/core/types/origin-metadata.js.map +1 -0
  103. package/dist/src/core/types/sync-config-validator.d.ts +57 -0
  104. package/dist/src/core/types/sync-config-validator.d.ts.map +1 -0
  105. package/dist/src/core/types/sync-config-validator.js +116 -0
  106. package/dist/src/core/types/sync-config-validator.js.map +1 -0
  107. package/dist/src/core/types/sync-profile.d.ts +8 -2
  108. package/dist/src/core/types/sync-profile.d.ts.map +1 -1
  109. package/dist/src/core/types/sync-profile.js.map +1 -1
  110. package/dist/src/core/types/sync-settings.d.ts +73 -0
  111. package/dist/src/core/types/sync-settings.d.ts.map +1 -0
  112. package/dist/src/core/types/sync-settings.js +90 -0
  113. package/dist/src/core/types/sync-settings.js.map +1 -0
  114. package/dist/src/core/utils/permission-checker.d.ts +100 -0
  115. package/dist/src/core/utils/permission-checker.d.ts.map +1 -0
  116. package/dist/src/core/utils/permission-checker.js +166 -0
  117. package/dist/src/core/utils/permission-checker.js.map +1 -0
  118. package/dist/src/generators/spec/spec-parser.js +3 -3
  119. package/dist/src/generators/spec/spec-parser.js.map +1 -1
  120. package/dist/src/generators/spec/task-parser.js +4 -4
  121. package/dist/src/generators/spec/task-parser.js.map +1 -1
  122. package/dist/src/id-generators/task-id-generator.d.ts +96 -0
  123. package/dist/src/id-generators/task-id-generator.d.ts.map +1 -0
  124. package/dist/src/id-generators/task-id-generator.js +143 -0
  125. package/dist/src/id-generators/task-id-generator.js.map +1 -0
  126. package/dist/src/id-generators/us-id-generator.d.ts +96 -0
  127. package/dist/src/id-generators/us-id-generator.d.ts.map +1 -0
  128. package/dist/src/id-generators/us-id-generator.js +143 -0
  129. package/dist/src/id-generators/us-id-generator.js.map +1 -0
  130. package/dist/src/importers/ado-importer.d.ts +43 -0
  131. package/dist/src/importers/ado-importer.d.ts.map +1 -0
  132. package/dist/src/importers/ado-importer.js +234 -0
  133. package/dist/src/importers/ado-importer.js.map +1 -0
  134. package/dist/src/importers/duplicate-detector.d.ts +107 -0
  135. package/dist/src/importers/duplicate-detector.d.ts.map +1 -0
  136. package/dist/src/importers/duplicate-detector.js +189 -0
  137. package/dist/src/importers/duplicate-detector.js.map +1 -0
  138. package/dist/src/importers/external-importer.d.ts +96 -0
  139. package/dist/src/importers/external-importer.d.ts.map +1 -0
  140. package/dist/src/importers/external-importer.js +13 -0
  141. package/dist/src/importers/external-importer.js.map +1 -0
  142. package/dist/src/importers/github-importer.d.ts +37 -0
  143. package/dist/src/importers/github-importer.d.ts.map +1 -0
  144. package/dist/src/importers/github-importer.js +161 -0
  145. package/dist/src/importers/github-importer.js.map +1 -0
  146. package/dist/src/importers/import-coordinator.d.ts +105 -0
  147. package/dist/src/importers/import-coordinator.d.ts.map +1 -0
  148. package/dist/src/importers/import-coordinator.js +224 -0
  149. package/dist/src/importers/import-coordinator.js.map +1 -0
  150. package/dist/src/importers/item-converter.d.ts +96 -0
  151. package/dist/src/importers/item-converter.d.ts.map +1 -0
  152. package/dist/src/importers/item-converter.js +246 -0
  153. package/dist/src/importers/item-converter.js.map +1 -0
  154. package/dist/src/importers/jira-importer.d.ts +42 -0
  155. package/dist/src/importers/jira-importer.d.ts.map +1 -0
  156. package/dist/src/importers/jira-importer.js +221 -0
  157. package/dist/src/importers/jira-importer.js.map +1 -0
  158. package/dist/src/importers/rate-limiter.d.ts +128 -0
  159. package/dist/src/importers/rate-limiter.d.ts.map +1 -0
  160. package/dist/src/importers/rate-limiter.js +200 -0
  161. package/dist/src/importers/rate-limiter.js.map +1 -0
  162. package/dist/src/init/compliance/types.d.ts +2 -2
  163. package/dist/src/init/repo/types.d.ts +2 -2
  164. package/dist/src/integrations/ado/ado-client.d.ts +6 -0
  165. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
  166. package/dist/src/integrations/ado/ado-client.js +23 -0
  167. package/dist/src/integrations/ado/ado-client.js.map +1 -1
  168. package/dist/src/integrations/jira/jira-client.d.ts +6 -0
  169. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  170. package/dist/src/integrations/jira/jira-client.js +38 -0
  171. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  172. package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
  173. package/dist/src/integrations/jira/jira-mapper.js +1 -1
  174. package/dist/src/living-docs/fs-id-allocator.d.ts +149 -0
  175. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -0
  176. package/dist/src/living-docs/fs-id-allocator.js +325 -0
  177. package/dist/src/living-docs/fs-id-allocator.js.map +1 -0
  178. package/dist/src/living-docs/id-registry.d.ts +124 -0
  179. package/dist/src/living-docs/id-registry.d.ts.map +1 -0
  180. package/dist/src/living-docs/id-registry.js +230 -0
  181. package/dist/src/living-docs/id-registry.js.map +1 -0
  182. package/dist/src/progress/us-progress-tracker.d.ts +68 -0
  183. package/dist/src/progress/us-progress-tracker.d.ts.map +1 -0
  184. package/dist/src/progress/us-progress-tracker.js +120 -0
  185. package/dist/src/progress/us-progress-tracker.js.map +1 -0
  186. package/dist/src/sync/external-item-sync-service.d.ts +150 -0
  187. package/dist/src/sync/external-item-sync-service.d.ts.map +1 -0
  188. package/dist/src/sync/external-item-sync-service.js +241 -0
  189. package/dist/src/sync/external-item-sync-service.js.map +1 -0
  190. package/dist/src/sync/format-preservation-sync.d.ts +90 -0
  191. package/dist/src/sync/format-preservation-sync.d.ts.map +1 -0
  192. package/dist/src/sync/format-preservation-sync.js +173 -0
  193. package/dist/src/sync/format-preservation-sync.js.map +1 -0
  194. package/dist/src/sync/index.d.ts +8 -0
  195. package/dist/src/sync/index.d.ts.map +1 -0
  196. package/dist/src/sync/index.js +6 -0
  197. package/dist/src/sync/index.js.map +1 -0
  198. package/dist/src/sync/sync-coordinator.d.ts +49 -0
  199. package/dist/src/sync/sync-coordinator.d.ts.map +1 -0
  200. package/dist/src/sync/sync-coordinator.js +248 -0
  201. package/dist/src/sync/sync-coordinator.js.map +1 -0
  202. package/dist/src/sync/sync-metadata.d.ts +75 -0
  203. package/dist/src/sync/sync-metadata.d.ts.map +1 -0
  204. package/dist/src/sync/sync-metadata.js +100 -0
  205. package/dist/src/sync/sync-metadata.js.map +1 -0
  206. package/dist/src/types/living-docs-us-file.d.ts +63 -0
  207. package/dist/src/types/living-docs-us-file.d.ts.map +1 -0
  208. package/dist/src/types/living-docs-us-file.js +27 -0
  209. package/dist/src/types/living-docs-us-file.js.map +1 -0
  210. package/dist/src/validators/format-preservation-validator.d.ts +127 -0
  211. package/dist/src/validators/format-preservation-validator.d.ts.map +1 -0
  212. package/dist/src/validators/format-preservation-validator.js +187 -0
  213. package/dist/src/validators/format-preservation-validator.js.map +1 -0
  214. package/package.json +3 -2
  215. package/plugins/specweave/.claude-plugin/plugin.json +36 -2
  216. package/plugins/specweave/agents/architect/AGENT.md +11 -2
  217. package/plugins/specweave/agents/test-aware-planner/AGENT.md +81 -25
  218. package/plugins/specweave/commands/specweave-archive-features.md +11 -1
  219. package/plugins/specweave/commands/specweave-import-external.md +407 -0
  220. package/plugins/specweave/commands/specweave-progress.md +45 -97
  221. package/plugins/specweave/hooks/post-edit-spec.sh +41 -0
  222. package/plugins/specweave/hooks/post-increment-completion.sh +168 -26
  223. package/plugins/specweave/hooks/post-increment-planning.sh +148 -4
  224. package/plugins/specweave/hooks/post-spec-update.sh +0 -0
  225. package/plugins/specweave/hooks/post-task-completion.sh +75 -5
  226. package/plugins/specweave/hooks/post-write-spec.sh +37 -0
  227. package/plugins/specweave/lib/hooks/auto-transition.js +1 -1
  228. package/plugins/specweave/lib/hooks/auto-transition.ts +1 -1
  229. package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
  230. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
  231. package/plugins/specweave/lib/hooks/sync-cache.js +294 -0
  232. package/plugins/specweave/lib/hooks/sync-living-docs.js +67 -2
  233. package/plugins/specweave/lib/hooks/sync-us-tasks.js +200 -14
  234. package/plugins/specweave/lib/hooks/translate-file.js +1 -1
  235. package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
  236. package/plugins/specweave/lib/hooks/update-ac-status.js +1 -1
  237. package/plugins/specweave/lib/hooks/update-ac-status.ts +1 -1
  238. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.d.ts +115 -0
  239. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +345 -0
  240. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -0
  241. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.d.ts +106 -0
  242. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +220 -0
  243. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -0
  244. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +60 -0
  245. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +192 -0
  246. package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -0
  247. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.d.ts +52 -0
  248. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +276 -0
  249. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -0
  250. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.d.ts +163 -0
  251. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +541 -0
  252. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -0
  253. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +157 -0
  254. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js +191 -0
  255. package/plugins/specweave/lib/vendor/core/types/increment-metadata.js.map +1 -0
  256. package/plugins/specweave/lib/vendor/generators/spec/task-parser.d.ts +95 -0
  257. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js +301 -0
  258. package/plugins/specweave/lib/vendor/generators/spec/task-parser.js.map +1 -0
  259. package/plugins/specweave/lib/vendor/utils/logger.d.ts +48 -0
  260. package/plugins/specweave/lib/vendor/utils/logger.js +53 -0
  261. package/plugins/specweave/lib/vendor/utils/logger.js.map +1 -0
  262. package/plugins/specweave/lib/vendor/utils/translation.d.ts +187 -0
  263. package/plugins/specweave/lib/vendor/utils/translation.js +414 -0
  264. package/plugins/specweave/lib/vendor/utils/translation.js.map +1 -0
  265. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  266. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  267. package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
  268. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +1 -1
  269. package/plugins/specweave-backend/.claude-plugin/plugin.json +1 -1
  270. package/plugins/specweave-confluent/.claude-plugin/plugin.json +1 -1
  271. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +1 -1
  272. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  273. package/plugins/specweave-docs/.claude-plugin/plugin.json +1 -1
  274. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  275. package/plugins/specweave-figma/.claude-plugin/plugin.json +1 -1
  276. package/plugins/specweave-frontend/.claude-plugin/plugin.json +1 -1
  277. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  278. package/plugins/specweave-github/commands/specweave-github-update-user-story.md +1 -1
  279. package/plugins/specweave-github/hooks/post-task-completion.sh +37 -22
  280. package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
  281. package/plugins/specweave-github/lib/enhanced-github-sync.js +1 -1
  282. package/plugins/specweave-github/lib/enhanced-github-sync.ts +1 -1
  283. package/plugins/specweave-github/lib/github-spec-content-sync.js +2 -1
  284. package/plugins/specweave-github/lib/github-spec-content-sync.ts +4 -1
  285. package/plugins/specweave-github/lib/github-spec-sync.js +1 -1
  286. package/plugins/specweave-github/lib/github-spec-sync.ts +1 -1
  287. package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  288. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +10 -1
  289. package/plugins/specweave-github/lib/progress-comment-builder.js +1 -1
  290. package/plugins/specweave-github/lib/progress-comment-builder.ts +2 -2
  291. package/plugins/specweave-github/lib/types.ts +1 -1
  292. package/plugins/specweave-github/skills/github-issue-standard/SKILL.md +1 -1
  293. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  294. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  295. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  296. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  297. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  298. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +1 -1
  299. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  300. package/plugins/specweave-mobile/.claude-plugin/plugin.json +1 -1
  301. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  302. package/plugins/specweave-payments/.claude-plugin/plugin.json +1 -1
  303. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  304. package/plugins/specweave-testing/.claude-plugin/plugin.json +1 -1
  305. package/plugins/specweave-tooling/.claude-plugin/plugin.json +1 -1
  306. package/plugins/specweave-ui/.claude-plugin/plugin.json +1 -1
  307. package/src/templates/.env.example +5 -0
  308. package/src/templates/config-permissions-guide.md +413 -0
  309. package/src/templates/config.json.template +68 -0
  310. package/src/templates/tasks.md.template +180 -201
  311. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  312. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -5442
@@ -37,31 +37,33 @@ fi
37
37
  ISSUE_NUMBER=$(jq -r '.github.issue // empty' "$METADATA_FILE" 2>/dev/null)
38
38
 
39
39
  if [ -z "$ISSUE_NUMBER" ] || [ "$ISSUE_NUMBER" = "null" ]; then
40
- # No GitHub issue linked - skip GitHub closure but still update status line
41
- HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
42
- bash "$HOOK_DIR/lib/update-status-line.sh" 2>/dev/null || true
43
- exit 0
44
- fi
45
-
46
- # Check if gh CLI is available
47
- if ! command -v gh &> /dev/null; then
48
- echo "âš ī¸ $HOOK_NAME: GitHub CLI (gh) not found - skipping issue closure" >&2
49
- exit 0
40
+ # No GitHub issue linked - skip GitHub closure but continue with sync
41
+ echo "â„šī¸ No GitHub issue linked to increment $INCREMENT_ID"
42
+ SKIP_GITHUB_CLOSURE=true
43
+ else
44
+ SKIP_GITHUB_CLOSURE=false
50
45
  fi
51
46
 
52
- # Check if issue is already closed
53
- ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --json state --jq '.state' 2>/dev/null || echo "")
47
+ # ============================================================================
48
+ # GITHUB ISSUE CLOSURE (if linked)
49
+ # ============================================================================
54
50
 
55
- if [ "$ISSUE_STATE" = "CLOSED" ]; then
56
- echo "✓ GitHub issue #$ISSUE_NUMBER already closed"
57
- exit 0
58
- fi
51
+ if [ "$SKIP_GITHUB_CLOSURE" = "false" ]; then
52
+ # Check if gh CLI is available
53
+ if ! command -v gh &> /dev/null; then
54
+ echo "âš ī¸ $HOOK_NAME: GitHub CLI (gh) not found - skipping issue closure" >&2
55
+ else
56
+ # Check if issue is already closed
57
+ ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --json state --jq '.state' 2>/dev/null || echo "")
59
58
 
60
- # Close the GitHub issue with completion message
61
- echo "🔗 Closing GitHub issue #$ISSUE_NUMBER for increment $INCREMENT_ID..."
59
+ if [ "$ISSUE_STATE" = "CLOSED" ]; then
60
+ echo "✓ GitHub issue #$ISSUE_NUMBER already closed"
61
+ else
62
+ # Close the GitHub issue with completion message
63
+ echo "🔗 Closing GitHub issue #$ISSUE_NUMBER for increment $INCREMENT_ID..."
62
64
 
63
- # Create completion comment
64
- COMPLETION_COMMENT="## ✅ Increment Complete
65
+ # Create completion comment
66
+ COMPLETION_COMMENT="## ✅ Increment Complete
65
67
 
66
68
  Increment \`$INCREMENT_ID\` has been marked as complete.
67
69
 
@@ -74,16 +76,156 @@ Increment \`$INCREMENT_ID\` has been marked as complete.
74
76
  ---
75
77
  🤖 Auto-closed by SpecWeave post-increment-completion hook"
76
78
 
77
- # Close issue with comment
78
- gh issue close "$ISSUE_NUMBER" --comment "$COMPLETION_COMMENT" 2>/dev/null || {
79
- echo "âš ī¸ Failed to close issue #$ISSUE_NUMBER" >&2
80
- exit 0
81
- }
79
+ # Close issue with comment
80
+ gh issue close "$ISSUE_NUMBER" --comment "$COMPLETION_COMMENT" 2>/dev/null || {
81
+ echo "âš ī¸ Failed to close issue #$ISSUE_NUMBER" >&2
82
+ }
82
83
 
83
- echo "✅ GitHub issue #$ISSUE_NUMBER closed successfully"
84
+ echo "✅ GitHub issue #$ISSUE_NUMBER closed successfully"
85
+ fi
86
+ fi
87
+ fi
84
88
 
85
89
  # Update status line cache (increment no longer open)
86
90
  HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
87
91
  bash "$HOOK_DIR/lib/update-status-line.sh" 2>/dev/null || true
88
92
 
93
+ # ============================================================================
94
+ # SYNC LIVING DOCS (NEW in v0.24.0 - Critical Missing Feature)
95
+ # ============================================================================
96
+ # After increment completes, perform FULL living docs sync to ensure:
97
+ # - Feature specs finalized with all user stories marked complete
98
+ # - ADRs created/updated with final architecture decisions
99
+ # - Architecture docs updated with implementation details
100
+ # - Delivery docs updated with what was shipped
101
+ # - Internal/public docs reflect completed work
102
+ #
103
+ # This is the FINAL, COMPREHENSIVE sync that happens once per increment.
104
+ # (Task-level sync in post-task-completion.sh handles incremental updates)
105
+ #
106
+ # Architecture Decision: Non-blocking execution
107
+ # - If sync fails, log error but don't crash hook (GitHub issue already closed)
108
+ # - Living docs can be manually synced later with /specweave:sync-docs
109
+ # - Failure mode: Graceful degradation (increment still completes)
110
+
111
+ if command -v node &> /dev/null; then
112
+ echo ""
113
+ echo "📚 Performing final living docs sync for increment $INCREMENT_ID..."
114
+
115
+ # ========================================================================
116
+ # EXTRACT FEATURE ID (v0.23.0+)
117
+ # ========================================================================
118
+ # Extract epic field from spec.md frontmatter (e.g., epic: FS-047)
119
+ # This ensures sync uses the explicitly defined feature ID rather than
120
+ # auto-generating one, maintaining traceability with living docs structure.
121
+
122
+ FEATURE_ID=""
123
+ SPEC_MD_PATH="$INCREMENT_DIR/spec.md"
124
+
125
+ if [ -f "$SPEC_MD_PATH" ]; then
126
+ # Extract epic field from YAML frontmatter
127
+ FEATURE_ID=$(awk '
128
+ BEGIN { in_frontmatter=0 }
129
+ /^---$/ {
130
+ if (in_frontmatter == 0) {
131
+ in_frontmatter=1; next
132
+ } else {
133
+ exit
134
+ }
135
+ }
136
+ in_frontmatter == 1 && /^epic:/ {
137
+ gsub(/^epic:[ \t]*/, "");
138
+ gsub(/["'\'']/, "");
139
+ print;
140
+ exit
141
+ }
142
+ ' "$SPEC_MD_PATH" | tr -d '\r\n')
143
+
144
+ if [ -n "$FEATURE_ID" ]; then
145
+ echo " 📎 Using feature ID from spec.md: $FEATURE_ID"
146
+ else
147
+ echo " â„šī¸ No epic field found in spec.md - will auto-generate feature ID"
148
+ fi
149
+ else
150
+ echo " âš ī¸ spec.md not found at $SPEC_MD_PATH" >&2
151
+ fi
152
+
153
+ # ========================================================================
154
+ # EXTRACT PROJECT ID (v0.20.0+)
155
+ # ========================================================================
156
+ # Extract activeProject from config.json (defaults to "default")
157
+ # Supports multi-project mode where specs are organized by project.
158
+
159
+ PROJECT_ID="default"
160
+ CONFIG_PATH="$PROJECT_ROOT/.specweave/config.json"
161
+
162
+ if [ -f "$CONFIG_PATH" ]; then
163
+ if command -v jq >/dev/null 2>&1; then
164
+ ACTIVE_PROJECT=$(jq -r '.activeProject // "default"' "$CONFIG_PATH" 2>/dev/null || echo "default")
165
+ if [ -n "$ACTIVE_PROJECT" ] && [ "$ACTIVE_PROJECT" != "null" ]; then
166
+ PROJECT_ID="$ACTIVE_PROJECT"
167
+ fi
168
+ fi
169
+ fi
170
+ echo " 📁 Project ID: $PROJECT_ID"
171
+
172
+ # ========================================================================
173
+ # LOCATE SYNC SCRIPT
174
+ # ========================================================================
175
+ # Find sync-living-docs.js in order of preference:
176
+ # 1. In-place compiled (development, esbuild output)
177
+ # 2. Local dist (development, tsc output)
178
+ # 3. node_modules (installed as dependency)
179
+ # 4. Plugin marketplace (Claude Code global installation)
180
+
181
+ SYNC_SCRIPT=""
182
+ if [ -f "$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
183
+ # Development: Use in-place compiled hooks (esbuild, not tsc)
184
+ SYNC_SCRIPT="$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js"
185
+ echo " 🔧 Using in-place compiled hook (development mode)"
186
+ elif [ -f "$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
187
+ # Development: Use project's compiled files (has node_modules)
188
+ SYNC_SCRIPT="$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
189
+ echo " 🔧 Using local dist (development mode)"
190
+ elif [ -f "$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
191
+ # Installed as dependency: Use node_modules version
192
+ SYNC_SCRIPT="$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
193
+ echo " đŸ“Ļ Using node_modules version"
194
+ elif [ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js" ]; then
195
+ # Fallback: Plugin marketplace (may fail if deps missing)
196
+ SYNC_SCRIPT="${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js"
197
+ echo " 🌐 Using plugin marketplace version"
198
+ fi
199
+
200
+ # ========================================================================
201
+ # EXECUTE SYNC
202
+ # ========================================================================
203
+ # Run living docs sync with feature ID and project ID
204
+ # Non-blocking: Errors logged but don't crash hook
205
+
206
+ if [ -n "$SYNC_SCRIPT" ]; then
207
+ # Pass FEATURE_ID and PROJECT_ID as environment variables if available
208
+ if [ -n "$FEATURE_ID" ]; then
209
+ (cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
210
+ echo " âš ī¸ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
211
+ }
212
+ else
213
+ # No explicit feature ID - sync will auto-generate
214
+ (cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$INCREMENT_ID") 2>&1 || {
215
+ echo " âš ī¸ Failed to sync living docs (non-blocking - you can run /specweave:sync-docs manually)" >&2
216
+ }
217
+ fi
218
+ echo " ✅ Living docs sync complete"
219
+ echo ""
220
+ else
221
+ echo " âš ī¸ sync-living-docs.js not found in any location - skipping living docs sync" >&2
222
+ echo " 💡 To manually sync: /specweave:sync-docs update" >&2
223
+ echo ""
224
+ fi
225
+ else
226
+ echo " âš ī¸ Node.js not found - skipping living docs sync" >&2
227
+ echo " 💡 Install Node.js to enable automatic living docs sync" >&2
228
+ echo ""
229
+ fi
230
+
89
231
  exit 0
@@ -684,16 +684,44 @@ EOF
684
684
 
685
685
  translate_living_docs_specs "$increment_id"
686
686
 
687
- # 7. Increment-level GitHub issue creation (for single-repo projects)
687
+ # ============================================================================
688
+ # INCREMENT-LEVEL GITHUB ISSUE CREATION (DEPRECATED v0.24.0+)
689
+ # ============================================================================
690
+ #
691
+ # âš ī¸ DEPRECATED: SpecWeave now syncs ONLY at User Story level.
692
+ #
693
+ # Feature/Increment-level issues like "[FS-047] Title" are NO LONGER created.
694
+ # Instead, use:
695
+ # /specweave-github:sync FS-047
696
+ #
697
+ # This creates PROPER User Story-level issues:
698
+ # [FS-047][US-001] User Story Title
699
+ # [FS-047][US-002] User Story Title
700
+ # etc.
701
+ #
702
+ # @see .specweave/increments/0047-us-task-linkage/reports/GITHUB-TITLE-FORMAT-FIX-PLAN.md
703
+ # ============================================================================
704
+
705
+ # 7. Increment-level GitHub issue creation (DEPRECATED - disabled by default)
688
706
  log_info ""
689
707
  log_info "🔗 Checking GitHub issue auto-creation..."
690
708
 
691
- # Check if auto-create is enabled in config
692
- local auto_create=$(cat "$CONFIG_FILE" 2>/dev/null | grep -A 5 '"sync"' | grep -A 2 '"settings"' | grep -o '"autoCreateIssue"[[:space:]]*:[[:space:]]*\(true\|false\)' | grep -o '\(true\|false\)' || echo "false")
709
+ # Check if upsert permission is enabled in config (v0.24.0+: Three-Permission Architecture)
710
+ local can_upsert=$(cat "$CONFIG_FILE" 2>/dev/null | grep -A 5 '"sync"' | grep -A 5 '"settings"' | grep -o '"canUpsertInternalItems"[[:space:]]*:[[:space:]]*\(true\|false\)' | grep -o '\(true\|false\)' || echo "false")
693
711
 
694
- log_debug "Auto-create GitHub issue: $auto_create"
712
+ # DEPRECATED: Override to false unless explicitly enabled via env var
713
+ # This entire section is deprecated - use /specweave-github:sync for User Story-level issues
714
+ if [ "$SPECWEAVE_ENABLE_INCREMENT_GITHUB_SYNC" != "true" ]; then
715
+ can_upsert="false"
716
+ log_debug "Increment GitHub sync disabled (use /specweave-github:sync for User Story-level issues)"
717
+ fi
718
+
719
+ log_debug "Can upsert internal items (deprecated increment sync): $can_upsert"
720
+ local auto_create="$can_upsert" # Backward compatibility alias
695
721
 
696
722
  if [ "$auto_create" = "true" ]; then
723
+ log_info " âš ī¸ WARNING: Increment-level sync is DEPRECATED"
724
+ log_info " ✅ Use /specweave-github:sync for [FS-XXX][US-YYY] format"
697
725
  log_info " đŸ“Ļ Auto-create enabled, checking for GitHub CLI..."
698
726
 
699
727
  # ============================================================================
@@ -830,6 +858,122 @@ EOF_MINIMAL
830
858
  fi
831
859
  fi
832
860
 
861
+ # ============================================================================
862
+ # LIVING DOCS SYNC (NEW - v0.23.0+, Increment 0047)
863
+ # ============================================================================
864
+ # CRITICAL: Sync increment spec to living docs structure IMMEDIATELY
865
+ # after increment creation (not just on task completion)
866
+ #
867
+ # Why this matters:
868
+ # - Creates FS-XXX feature folder with User Story files
869
+ # - Syncs acceptance criteria and task linkages
870
+ # - Enables traceability from the moment increment is planned
871
+ #
872
+ # Previous behavior (BROKEN):
873
+ # - Living docs only synced AFTER first task completion
874
+ # - New increments had empty living docs until tasks marked complete
875
+ # - Manual /specweave:sync-docs required for every new increment
876
+ #
877
+ # New behavior (FIXED):
878
+ # - Living docs auto-sync during increment creation
879
+ # - FS-XXX folder created with all User Stories immediately
880
+ # - No manual intervention needed
881
+ #
882
+ # @see .specweave/increments/0047-us-task-linkage/ (US-Task Linkage)
883
+ # ============================================================================
884
+
885
+ log_info ""
886
+ log_info "📚 Syncing living docs for new increment..."
887
+
888
+ if command -v node &> /dev/null && [ -n "$increment_id" ]; then
889
+ # Extract feature ID from spec.md frontmatter (epic: FS-047)
890
+ local FEATURE_ID=""
891
+ local spec_md_path="$increment_dir/spec.md"
892
+
893
+ if [ -f "$spec_md_path" ]; then
894
+ FEATURE_ID=$(awk '
895
+ BEGIN { in_frontmatter=0 }
896
+ /^---$/ {
897
+ if (in_frontmatter == 0) {
898
+ in_frontmatter=1; next
899
+ } else {
900
+ exit
901
+ }
902
+ }
903
+ in_frontmatter == 1 && /^epic:/ {
904
+ gsub(/^epic:[ \t]*/, "");
905
+ gsub(/["'\'']/, "");
906
+ print;
907
+ exit
908
+ }
909
+ ' "$spec_md_path" | tr -d '\r\n')
910
+
911
+ if [ -n "$FEATURE_ID" ]; then
912
+ log_debug " 📎 Extracted feature ID: $FEATURE_ID"
913
+ else
914
+ log_debug " âš ī¸ No epic field in spec.md, sync will auto-generate ID"
915
+ fi
916
+ fi
917
+
918
+ # Extract project ID from config (defaults to "default")
919
+ local PROJECT_ID="default"
920
+ if [ -f "$CONFIG_FILE" ]; then
921
+ if command -v jq >/dev/null 2>&1; then
922
+ local active_project=$(jq -r '.multiProject.activeProject // .project.name // "default"' "$CONFIG_FILE" 2>/dev/null)
923
+ if [ -n "$active_project" ] && [ "$active_project" != "null" ]; then
924
+ PROJECT_ID="$active_project"
925
+ fi
926
+ fi
927
+ fi
928
+ log_debug " 📁 Project ID: $PROJECT_ID"
929
+
930
+ # Determine sync script location (same logic as post-task-completion.sh)
931
+ local SYNC_SCRIPT=""
932
+ if [ -f "$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
933
+ SYNC_SCRIPT="$PROJECT_ROOT/plugins/specweave/lib/hooks/sync-living-docs.js"
934
+ log_debug " Using in-place compiled hook: $SYNC_SCRIPT"
935
+ elif [ -f "$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
936
+ SYNC_SCRIPT="$PROJECT_ROOT/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
937
+ log_debug " Using local dist: $SYNC_SCRIPT"
938
+ elif [ -f "$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js" ]; then
939
+ SYNC_SCRIPT="$PROJECT_ROOT/node_modules/specweave/dist/plugins/specweave/lib/hooks/sync-living-docs.js"
940
+ log_debug " Using node_modules: $SYNC_SCRIPT"
941
+ elif [ -n "${CLAUDE_PLUGIN_ROOT}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js" ]; then
942
+ SYNC_SCRIPT="${CLAUDE_PLUGIN_ROOT}/lib/hooks/sync-living-docs.js"
943
+ log_debug " Using plugin marketplace: $SYNC_SCRIPT"
944
+ fi
945
+
946
+ if [ -n "$SYNC_SCRIPT" ]; then
947
+ log_info " 🔄 Syncing $increment_id to living docs..."
948
+
949
+ # Run living docs sync (non-blocking, best-effort)
950
+ if [ -n "$FEATURE_ID" ]; then
951
+ (cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$increment_id") 2>&1 | \
952
+ grep -E "✅|❌|âš ī¸|📚" | while read -r line; do echo " $line"; done || {
953
+ log_info " âš ī¸ Living docs sync failed (non-blocking)"
954
+ log_debug "Sync error, but continuing hook execution"
955
+ }
956
+ else
957
+ (cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$increment_id") 2>&1 | \
958
+ grep -E "✅|❌|âš ī¸|📚" | while read -r line; do echo " $line"; done || {
959
+ log_info " âš ī¸ Living docs sync failed (non-blocking)"
960
+ log_debug "Sync error, but continuing hook execution"
961
+ }
962
+ fi
963
+
964
+ log_info " ✅ Living docs sync complete!"
965
+ else
966
+ log_info " âš ī¸ sync-living-docs.js not found, skipping auto-sync"
967
+ log_info " 💡 Run /specweave:sync-docs manually to sync living docs"
968
+ fi
969
+ else
970
+ if ! command -v node &> /dev/null; then
971
+ log_debug " âš ī¸ Node.js not found, skipping living docs sync"
972
+ else
973
+ log_debug " âš ī¸ No increment ID, skipping living docs sync"
974
+ fi
975
+ fi
976
+
833
977
  # Note: Spec-level sync (SPECS → GitHub Projects/JIRA Epics) is handled separately
834
978
  # See: /specweave-github:sync-spec, /specweave-jira:sync-spec, /specweave-ado:sync-spec
835
979
 
File without changes
@@ -200,7 +200,68 @@ fi
200
200
 
201
201
  if command -v node &> /dev/null; then
202
202
  if [ -n "$CURRENT_INCREMENT" ]; then
203
- echo "[$(date)] 📚 Checking living docs sync for $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
203
+ # ========================================================================
204
+ # SKIP ARCHIVED INCREMENTS (CRITICAL - prevents folder recreation)
205
+ # ========================================================================
206
+ # If increment is archived, skip living docs sync entirely
207
+ # This prevents recreating archived feature folders in active location
208
+ # See: ULTRATHINK-ARCHIVE-REORGANIZATION-BUG.md for full analysis
209
+ if [ -d ".specweave/increments/_archive/$CURRENT_INCREMENT" ]; then
210
+ echo "[$(date)] â­ī¸ Skipping living docs sync for archived increment $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
211
+ else
212
+ echo "[$(date)] 📚 Checking living docs sync for $CURRENT_INCREMENT" >> "$DEBUG_LOG" 2>/dev/null || true
213
+
214
+ # ========================================================================
215
+ # EXTRACT FEATURE ID (NEW in v0.23.0 - Increment 0047: US-Task Linkage)
216
+ # ========================================================================
217
+ # Extract epic field from spec.md frontmatter (e.g., epic: FS-047)
218
+ # This ensures sync uses the explicitly defined feature ID rather than
219
+ # auto-generating one, maintaining traceability with living docs structure.
220
+
221
+ FEATURE_ID=""
222
+ SPEC_MD_PATH=".specweave/increments/$CURRENT_INCREMENT/spec.md"
223
+
224
+ if [ -f "$SPEC_MD_PATH" ]; then
225
+ # Extract epic field from YAML frontmatter
226
+ FEATURE_ID=$(awk '
227
+ BEGIN { in_frontmatter=0 }
228
+ /^---$/ {
229
+ if (in_frontmatter == 0) {
230
+ in_frontmatter=1; next
231
+ } else {
232
+ exit
233
+ }
234
+ }
235
+ in_frontmatter == 1 && /^epic:/ {
236
+ gsub(/^epic:[ \t]*/, "");
237
+ gsub(/["'\'']/, "");
238
+ print;
239
+ exit
240
+ }
241
+ ' "$SPEC_MD_PATH" | tr -d '\r\n')
242
+
243
+ if [ -n "$FEATURE_ID" ]; then
244
+ echo "[$(date)] 📎 Extracted feature ID from spec.md: $FEATURE_ID" >> "$DEBUG_LOG" 2>/dev/null || true
245
+ else
246
+ echo "[$(date)] âš ī¸ No epic field found in spec.md frontmatter" >> "$DEBUG_LOG" 2>/dev/null || true
247
+ echo "[$(date)] â„šī¸ Sync will auto-generate feature ID from increment number" >> "$DEBUG_LOG" 2>/dev/null || true
248
+ fi
249
+ else
250
+ echo "[$(date)] âš ī¸ spec.md not found at $SPEC_MD_PATH" >> "$DEBUG_LOG" 2>/dev/null || true
251
+ fi
252
+
253
+ # Extract project ID from config or metadata (defaults to "default")
254
+ PROJECT_ID="default"
255
+ if [ -f ".specweave/config.json" ]; then
256
+ # Try to extract activeProject from config
257
+ if command -v jq >/dev/null 2>&1; then
258
+ ACTIVE_PROJECT=$(jq -r '.activeProject // "default"' ".specweave/config.json" 2>/dev/null || echo "default")
259
+ if [ -n "$ACTIVE_PROJECT" ] && [ "$ACTIVE_PROJECT" != "null" ]; then
260
+ PROJECT_ID="$ACTIVE_PROJECT"
261
+ fi
262
+ fi
263
+ fi
264
+ echo "[$(date)] 📁 Project ID: $PROJECT_ID" >> "$DEBUG_LOG" 2>/dev/null || true
204
265
 
205
266
  # Determine which sync script to use (project local or global)
206
267
  SYNC_SCRIPT=""
@@ -223,13 +284,22 @@ if command -v node &> /dev/null; then
223
284
  fi
224
285
 
225
286
  if [ -n "$SYNC_SCRIPT" ]; then
226
- # Run living docs sync (non-blocking, best-effort)
227
- (cd "$PROJECT_ROOT" && node "$SYNC_SCRIPT" "$CURRENT_INCREMENT") 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
228
- echo "[$(date)] âš ī¸ Failed to sync living docs (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
229
- }
287
+ # Run living docs sync with feature ID (non-blocking, best-effort)
288
+ # Pass FEATURE_ID and PROJECT_ID as environment variables if available
289
+ if [ -n "$FEATURE_ID" ]; then
290
+ (cd "$PROJECT_ROOT" && FEATURE_ID="$FEATURE_ID" PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$CURRENT_INCREMENT") 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
291
+ echo "[$(date)] âš ī¸ Failed to sync living docs (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
292
+ }
293
+ else
294
+ # No explicit feature ID - sync will auto-generate
295
+ (cd "$PROJECT_ROOT" && PROJECT_ID="$PROJECT_ID" node "$SYNC_SCRIPT" "$CURRENT_INCREMENT") 2>&1 | tee -a "$DEBUG_LOG" >/dev/null || {
296
+ echo "[$(date)] âš ī¸ Failed to sync living docs (non-blocking)" >> "$DEBUG_LOG" 2>/dev/null || true
297
+ }
298
+ fi
230
299
  else
231
300
  echo "[$(date)] âš ī¸ sync-living-docs.js not found in any location" >> "$DEBUG_LOG" 2>/dev/null || true
232
301
  fi
302
+ fi # Close the archive check 'else' block
233
303
  fi
234
304
  fi
235
305
 
@@ -0,0 +1,37 @@
1
+ #!/bin/bash
2
+ #
3
+ # Post-Write Hook: Update Status Line After spec.md or tasks.md Writes
4
+ #
5
+ # Triggers: After Write tool creates/replaces spec.md or tasks.md
6
+ # Action: Updates status line cache to reflect latest AC/task progress
7
+
8
+ set -e
9
+
10
+ # Find project root
11
+ find_project_root() {
12
+ local dir="$PWD"
13
+ while [[ "$dir" != "/" ]]; do
14
+ if [[ -d "$dir/.specweave" ]]; then
15
+ echo "$dir"
16
+ return 0
17
+ fi
18
+ dir=$(dirname "$dir")
19
+ done
20
+ echo "$PWD"
21
+ }
22
+
23
+ PROJECT_ROOT=$(find_project_root)
24
+
25
+ # Get the file that was written from TOOL_USE_CONTENT environment variable
26
+ WRITTEN_FILE="${TOOL_USE_CONTENT:-}"
27
+
28
+ # Only update status line if spec.md or tasks.md was written
29
+ if [[ "$WRITTEN_FILE" == *"/spec.md"* ]] || [[ "$WRITTEN_FILE" == *"/tasks.md"* ]]; then
30
+ # Check if the write is in an increment folder
31
+ if [[ "$WRITTEN_FILE" == *"/.specweave/increments/"* ]]; then
32
+ # Run status line update
33
+ "$PROJECT_ROOT/plugins/specweave/hooks/lib/update-status-line.sh" &>/dev/null || true
34
+ fi
35
+ fi
36
+
37
+ exit 0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { AutoTransitionManager } from "../../../../dist/src/core/increment/auto-transition-manager.js";
2
+ import { AutoTransitionManager } from "../vendor/core/increment/auto-transition-manager.js";
3
3
  async function main() {
4
4
  const event = process.argv[2];
5
5
  const incrementId = process.argv[3];
@@ -19,7 +19,7 @@
19
19
  * node auto-transition.ts auto-correct 0039-ultra-smart-next-command
20
20
  */
21
21
 
22
- import { AutoTransitionManager } from '../../../../dist/src/core/increment/auto-transition-manager.js';
22
+ import { AutoTransitionManager } from '../vendor/core/increment/auto-transition-manager.js';
23
23
 
24
24
  async function main() {
25
25
  const event = process.argv[2];
@@ -4,7 +4,7 @@ import {
4
4
  prepareTranslation,
5
5
  postProcessTranslation,
6
6
  getLanguageName
7
- } from "../../../../dist/src/utils/translation.js";
7
+ } from "../vendor/utils/translation.js";
8
8
  async function invokeTranslatorSkill(content, sourceLang, targetLang = "en") {
9
9
  try {
10
10
  const prepared = prepareTranslation(content, sourceLang, targetLang);
@@ -16,7 +16,7 @@ import {
16
16
  postProcessTranslation,
17
17
  getLanguageName,
18
18
  type SupportedLanguage,
19
- } from '../../../../dist/src/utils/translation.js';
19
+ } from '../vendor/utils/translation.js';
20
20
 
21
21
  /**
22
22
  * Translation result