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
@@ -0,0 +1,407 @@
1
+ ---
2
+ name: specweave:import-external
3
+ description: Manually pull external work items from GitHub, JIRA, or Azure DevOps into living docs. Supports time range filtering, platform selection, and dry-run mode for ongoing imports after initial setup.
4
+ ---
5
+
6
+ # Import External Work Items
7
+
8
+ Import work items from GitHub (issues/milestones), JIRA (epics/stories), or Azure DevOps (work items) into SpecWeave living docs.
9
+
10
+ ## What This Does
11
+
12
+ 1. **Detects configured external tools** (GitHub, JIRA, ADO) from environment/config
13
+ 2. **Fetches work items** based on time range filter (since last import by default)
14
+ 3. **Assigns IDs** with E suffix (US-001E, T-001E) to indicate external origin
15
+ 4. **Creates living docs files** in `.specweave/docs/internal/specs/FS-XXXE/`
16
+ 5. **Updates sync metadata** (`.specweave/sync-metadata.json`) with import timestamp
17
+ 6. **Skips duplicates** automatically (checks existing external IDs)
18
+ 7. **Shows progress** indicator and summary report
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ /specweave:import-external [options]
24
+ ```
25
+
26
+ ### Options
27
+
28
+ - `--since=<range>` - Time range filter (default: since last import)
29
+ - `last` - Since last import (uses sync metadata)
30
+ - `1m`, `3m`, `6m` - Last 1/3/6 months
31
+ - `all` - All items (no time filter)
32
+ - Custom: `2025-01-01` - Since specific date (ISO format)
33
+ - `--github-only` - Import from GitHub only
34
+ - `--jira-only` - Import from JIRA only
35
+ - `--ado-only` - Import from Azure DevOps only
36
+ - `--dry-run` - Preview what would be imported without creating files
37
+
38
+ ## Examples
39
+
40
+ ### Example 1: Import New Items (Default)
41
+
42
+ ```bash
43
+ /specweave:import-external
44
+
45
+ # Uses default behavior:
46
+ # - Imports from ALL configured platforms (GitHub, JIRA, ADO)
47
+ # - Since last import timestamp (from .specweave/sync-metadata.json)
48
+ # - Creates living docs files
49
+ # - Updates sync metadata
50
+
51
+ # Result:
52
+ # πŸ”„ Importing from GitHub... [30/30] βœ“
53
+ # πŸ”„ Importing from JIRA... [12/12] βœ“
54
+ # πŸ“Š Import Summary:
55
+ # Total imported: 42 items
56
+ # - GitHub: 30 items (US-201E to US-230E)
57
+ # - JIRA: 12 items (US-231E to US-242E)
58
+ # Duplicates skipped: 5 items
59
+ # βœ… Import complete!
60
+ ```
61
+
62
+ ### Example 2: GitHub Only (Last 3 Months)
63
+
64
+ ```bash
65
+ /specweave:import-external --github-only --since=3m
66
+
67
+ # Imports only from GitHub
68
+ # Items created in last 3 months
69
+ ```
70
+
71
+ ### Example 3: Dry Run (Preview)
72
+
73
+ ```bash
74
+ /specweave:import-external --dry-run --since=1m
75
+
76
+ # Shows what would be imported without creating files
77
+ # Useful for checking item counts before actual import
78
+
79
+ # Result:
80
+ # πŸ” Dry run - no files will be created
81
+ # πŸ“Š Preview:
82
+ # GitHub: 25 items (5 duplicates skipped)
83
+ # JIRA: 10 items (2 duplicates skipped)
84
+ # Total: 35 new items, 7 existing
85
+ # ⚠️ Remove --dry-run to perform actual import
86
+ ```
87
+
88
+ ### Example 4: JIRA Only (All Items)
89
+
90
+ ```bash
91
+ /specweave:import-external --jira-only --since=all
92
+
93
+ # Imports all JIRA items (no time filter)
94
+ # ⚠️ Warning shown if > 100 items detected
95
+ ```
96
+
97
+ ## Time Range Filters
98
+
99
+ ### Since Last Import (Default)
100
+
101
+ ```bash
102
+ /specweave:import-external
103
+
104
+ # Reads last import timestamp from:
105
+ # .specweave/sync-metadata.json
106
+ # {
107
+ # "github": { "lastImport": "2025-11-15T10:30:00Z" },
108
+ # "jira": { "lastImport": "2025-11-10T14:20:00Z" }
109
+ # }
110
+ #
111
+ # GitHub: imports items created after 2025-11-15T10:30:00Z
112
+ # JIRA: imports items created after 2025-11-10T14:20:00Z
113
+ ```
114
+
115
+ ### Relative Time Ranges
116
+
117
+ ```bash
118
+ --since=1m # Last 1 month
119
+ --since=3m # Last 3 months
120
+ --since=6m # Last 6 months
121
+ ```
122
+
123
+ ### Absolute Date
124
+
125
+ ```bash
126
+ --since=2025-01-01 # Since January 1, 2025 (ISO format: YYYY-MM-DD)
127
+ ```
128
+
129
+ ### All Items
130
+
131
+ ```bash
132
+ --since=all # Import all items (no time filter)
133
+ # ⚠️ Warning: May import hundreds of items
134
+ ```
135
+
136
+ ## Configured Platforms
137
+
138
+ The command auto-detects configured platforms from:
139
+
140
+ ### GitHub
141
+ - **Detection**: `.git/config` remote URL
142
+ - **Auth**: `GITHUB_TOKEN` environment variable
143
+ - **Format**: `github.com/{owner}/{repo}`
144
+
145
+ ### JIRA
146
+ - **Detection**: `JIRA_HOST` environment variable
147
+ - **Auth**: `JIRA_EMAIL` + `JIRA_API_TOKEN`
148
+ - **Format**: `https://{company}.atlassian.net`
149
+
150
+ ### Azure DevOps
151
+ - **Detection**: `ADO_ORG_URL` environment variable
152
+ - **Auth**: `ADO_PAT` (Personal Access Token)
153
+ - **Format**: `https://dev.azure.com/{org}` + `ADO_PROJECT`
154
+
155
+ ## Progress Indicator
156
+
157
+ During import, you'll see real-time progress:
158
+
159
+ ```
160
+ πŸ”„ Importing from GitHub... [25/150] β ‹
161
+ ⚠️ GitHub rate limit low: 42/5000 remaining. Resets at 10:45 AM (in 300s).
162
+ πŸ”„ Importing from GitHub... [150/150] βœ“
163
+
164
+ πŸ”„ Importing from JIRA... [12/12] βœ“
165
+ ```
166
+
167
+ - **Spinner**: Shows active import
168
+ - **Counter**: `[current/total]` items processed
169
+ - **Rate limit warnings**: Shown if remaining requests drop below threshold
170
+ - **Checkmark**: `βœ“` when platform import completes
171
+
172
+ ## Summary Report
173
+
174
+ After import, a detailed summary is shown:
175
+
176
+ ```
177
+ πŸ“Š Import Summary:
178
+ Total imported: 162 items
179
+ - GitHub: 150 items (US-201E to US-350E)
180
+ - JIRA: 12 items (US-351E to US-362E)
181
+
182
+ Duplicates skipped: 8 items
183
+ - GitHub: 5 items (already imported)
184
+ - JIRA: 3 items (already imported)
185
+
186
+ Rate limit status:
187
+ - GitHub: 3842/5000 remaining (resets at 11:00 AM)
188
+ - JIRA: Estimated 950/1000 remaining
189
+
190
+ βœ… Import complete!
191
+ Living docs updated: .specweave/docs/internal/specs/
192
+ Sync metadata updated: .specweave/sync-metadata.json
193
+ ```
194
+
195
+ ## Duplicate Detection
196
+
197
+ The command automatically skips items that have already been imported:
198
+
199
+ - Scans all `us-*.md` files in living docs
200
+ - Checks `external_id` frontmatter field
201
+ - Skips if external ID already exists (e.g., `GH-#638`, `JIRA-PROJ-123`)
202
+ - Reports skipped count in summary
203
+
204
+ ## Rate Limiting
205
+
206
+ The command monitors API rate limits and handles them gracefully:
207
+
208
+ ### Warning Threshold (100 requests remaining)
209
+
210
+ ```
211
+ ⚠️ GitHub rate limit low: 42/5000 remaining. Resets at 10:45 AM (in 300s).
212
+ ```
213
+
214
+ - Import continues normally
215
+ - Warning shown to user
216
+
217
+ ### Pause Threshold (10 requests remaining)
218
+
219
+ ```
220
+ ⚠️ GitHub rate limit critically low. Waiting 60s before continuing...
221
+ ```
222
+
223
+ - Import pauses automatically
224
+ - Resumes after wait period
225
+ - No user action required
226
+
227
+ ### Retry Suggestions (Rate limit exceeded)
228
+
229
+ ```
230
+ ❌ GitHub rate limit exceeded.
231
+ Remaining: 0/5000
232
+ Resets at: 10:45 AM (in 300 seconds)
233
+
234
+ πŸ’‘ Suggestions:
235
+ - Wait 5 minutes and retry
236
+ - Use --github-only next time to avoid hitting limit
237
+ - Increase time range to reduce item count (--since=1m instead of --since=all)
238
+ ```
239
+
240
+ ## Large Import Confirmation
241
+
242
+ If import detects > 100 items, you'll be prompted:
243
+
244
+ ```
245
+ ⚠️ Found 250 items to import:
246
+ - GitHub: 200 items
247
+ - JIRA: 50 items
248
+
249
+ This may take 5-10 minutes and use significant API quota.
250
+
251
+ Continue? (Y/n) _
252
+ ```
253
+
254
+ - Press `Y` or `Enter` to proceed
255
+ - Press `n` to cancel
256
+ - Use `--since=1m` to reduce item count
257
+
258
+ ## Sync Metadata
259
+
260
+ After successful import, sync metadata is updated:
261
+
262
+ **File**: `.specweave/sync-metadata.json`
263
+
264
+ ```json
265
+ {
266
+ "github": {
267
+ "lastImport": "2025-11-19T10:30:00Z",
268
+ "lastImportCount": 150,
269
+ "lastSkippedCount": 5,
270
+ "lastSyncResult": "success"
271
+ },
272
+ "jira": {
273
+ "lastImport": "2025-11-19T10:32:00Z",
274
+ "lastImportCount": 12,
275
+ "lastSkippedCount": 3,
276
+ "lastSyncResult": "success"
277
+ }
278
+ }
279
+ ```
280
+
281
+ - `lastImport`: Timestamp of most recent successful import
282
+ - `lastImportCount`: Number of items imported in last sync
283
+ - `lastSkippedCount`: Number of duplicates skipped
284
+ - `lastSyncResult`: `success`, `partial`, or `failed`
285
+
286
+ ## Living Docs Structure
287
+
288
+ Imported items create living docs files with E suffix:
289
+
290
+ ```
291
+ .specweave/docs/internal/specs/
292
+ β”œβ”€β”€ FS-042E/ ← Feature (external)
293
+ β”‚ β”œβ”€β”€ README.md ← Feature metadata
294
+ β”‚ β”œβ”€β”€ us-001e-login.md ← User Story (external)
295
+ β”‚ └── us-002e-signup.md ← User Story (external)
296
+ └── FS-043E/ ← Feature (external)
297
+ └── us-001e-api-auth.md ← User Story (external)
298
+ ```
299
+
300
+ ### User Story File Format
301
+
302
+ ```markdown
303
+ ---
304
+ us_id: US-001E
305
+ title: "User Login"
306
+ feature_id: FS-042E
307
+ origin: external
308
+ external_platform: github
309
+ external_id: GH-#638
310
+ external_url: https://github.com/owner/repo/issues/638
311
+ imported_at: 2025-11-19T10:30:00Z
312
+ status: open
313
+ ---
314
+
315
+ # US-001E: User Login
316
+
317
+ **Origin**: πŸ”— GitHub (GH-#638)
318
+
319
+ ## Description
320
+
321
+ [Original GitHub issue description]
322
+
323
+ ## Acceptance Criteria
324
+
325
+ [Parsed from GitHub issue body or comments]
326
+
327
+ ## Tasks
328
+
329
+ No tasks defined.
330
+
331
+ ## Implementation Notes
332
+
333
+ [Original labels, comments, metadata from GitHub]
334
+ ```
335
+
336
+ ## When to Use
337
+
338
+ - **After initial setup**: Import new external items created after `specweave init`
339
+ - **Periodic sync**: Weekly/monthly imports to stay in sync with external tools
340
+ - **Brownfield onboarding**: Import historical items missed during initialization
341
+ - **Cross-team collaboration**: Pull work items from other teams' external tools
342
+
343
+ ## Limitations
344
+
345
+ - **NO automatic increment creation**: Imported items live in living docs ONLY
346
+ - User must manually create increment when ready to work on external item
347
+ - **Read-only snapshot**: External items are imported as static snapshots
348
+ - No bidirectional sync (external tool β†’ SpecWeave only)
349
+ - **Pagination**: Large imports (500+ items) may take several minutes
350
+ - **API quota**: Uses GitHub/JIRA/ADO API quota
351
+ - GitHub: 5000 requests/hour (authenticated)
352
+ - JIRA: ~1000 requests/hour (Cloud estimate)
353
+ - ADO: 200 requests/minute
354
+
355
+ ## Differences from `specweave init`
356
+
357
+ | Feature | `specweave init` | `/specweave:import-external` |
358
+ |---------|------------------|------------------------------|
359
+ | When to use | First-time setup | Ongoing imports after init |
360
+ | User prompts | Interactive setup | Minimal prompts (confirmation only) |
361
+ | Time range | Configurable (default: 1 month) | Since last import (default) |
362
+ | Config update | Creates `.specweave/config.json` | Uses existing config |
363
+ | Primary use case | Brownfield onboarding | Stay in sync with external tools |
364
+
365
+ ## Troubleshooting
366
+
367
+ ### Error: "No platforms configured"
368
+
369
+ ```
370
+ ❌ No external platforms configured.
371
+
372
+ πŸ’‘ Ensure one of these is set:
373
+ - GitHub: GITHUB_TOKEN + .git/config remote
374
+ - JIRA: JIRA_HOST + JIRA_EMAIL + JIRA_API_TOKEN
375
+ - Azure DevOps: ADO_ORG_URL + ADO_PROJECT + ADO_PAT
376
+ ```
377
+
378
+ **Solution**: Set environment variables for at least one platform
379
+
380
+ ### Error: "Rate limit exceeded"
381
+
382
+ ```
383
+ ❌ GitHub rate limit exceeded (0/5000 remaining).
384
+ Resets at: 10:45 AM (in 300 seconds)
385
+ ```
386
+
387
+ **Solution**: Wait for rate limit reset, or use platform filter (`--jira-only`) to avoid GitHub
388
+
389
+ ### Warning: "Found 0 items to import"
390
+
391
+ ```
392
+ ⚠️ No new items found since last import (2025-11-19T10:30:00Z).
393
+ ```
394
+
395
+ **Solution**: This is expected if no new work items created since last import. Use `--since=all` to re-import all items (will skip duplicates).
396
+
397
+ ## See Also
398
+
399
+ - `specweave init` - Initial project setup with external tool import
400
+ - [External Import Guide](https://docs.spec-weave.com/guides/external-import)
401
+ - [GitHub Integration](https://docs.spec-weave.com/integrations/github)
402
+ - [JIRA Integration](https://docs.spec-weave.com/integrations/jira)
403
+ - [Azure DevOps Integration](https://docs.spec-weave.com/integrations/ado)
404
+
405
+ ---
406
+
407
+ **Implementation**: `src/cli/commands/import-external.ts`
@@ -17,120 +17,68 @@ Simple, fast progress check for all active increments.
17
17
 
18
18
  ```bash
19
19
  #!/bin/bash
20
+ #
21
+ # Enhanced progress tracking with User Story grouping (v0.23.0+)
22
+ # Uses TypeScript script for accurate task parsing and US-level progress
23
+ #
20
24
 
21
- echo ""
22
- echo "πŸ“Š Increment Progress"
23
- echo "================================"
24
- echo ""
25
-
26
- # Counters
27
- active_count=0
28
- other_count=0
29
-
30
- # Scan all increments
31
- for dir in .specweave/increments/*/; do
32
- [ ! -d "$dir" ] && continue
33
-
34
- increment=$(basename "$dir")
35
- metadata="$dir/metadata.json"
36
-
37
- # Skip if no metadata
38
- [ ! -f "$metadata" ] && continue
39
-
40
- # Get status
41
- inc_status=$(jq -r '.status' "$metadata" 2>/dev/null)
42
-
43
- # Skip completed/archived
44
- [ "$inc_status" = "completed" ] && continue
45
- [ "$inc_status" = "archived" ] && continue
46
-
47
- # Count for summary
48
- if [ "$inc_status" = "in-progress" ]; then
49
- active_count=$((active_count + 1))
50
- else
51
- other_count=$((other_count + 1))
52
- fi
53
-
54
- # Get task stats from tasks.md
55
- tasks_file="$dir/tasks.md"
56
- if [ -f "$tasks_file" ]; then
57
- # Count tasks (headers with T-NNN format - both ### and ####)
58
- total=$(grep -cE '^#{3,4}\s*T-[0-9]' "$tasks_file" 2>/dev/null | tr -d '\n' || echo "0")
59
- # Count completed (various formats)
60
- completed=$(grep -cE '(βœ… COMPLETE|\[COMPLETED\]|\[x\] Completed)' "$tasks_file" 2>/dev/null | tr -d '\n' || echo "0")
61
-
62
- # Ensure we have valid numbers (fallback to 0 if empty)
63
- total=${total:-0}
64
- completed=${completed:-0}
65
-
66
- if [ "$total" -gt 0 ] 2>/dev/null; then
67
- percent=$((completed * 100 / total))
68
- else
69
- percent=0
70
- fi
71
- else
72
- total=0
73
- completed=0
74
- percent=0
75
- fi
76
-
77
- # Display based on status
78
- if [ "$inc_status" = "in-progress" ]; then
79
- echo "🟒 ACTIVE: $increment"
80
- echo " Status: $inc_status"
81
- echo " Tasks: $completed/$total completed ($percent%)"
82
- echo " Next: /specweave:do $increment"
83
- echo ""
84
- else
85
- echo "⏸️ $inc_status: $increment"
86
- echo " Tasks: $completed/$total ($percent%)"
87
- echo ""
88
- fi
89
- done
90
-
91
- echo "================================"
92
- echo "Summary:"
93
- echo " Active increments: $active_count"
94
- echo " Other non-completed: $other_count"
95
-
96
- if [ "$active_count" -eq 0 ]; then
97
- echo ""
98
- echo "πŸ’‘ No active work. Run /specweave:increment to start new work"
99
- elif [ "$active_count" -gt 0 ]; then
100
- echo ""
101
- echo "πŸ’‘ Continue with /specweave:do"
102
- fi
103
-
104
- echo ""
25
+ # Call TypeScript progress script
26
+ npx tsx "$(dirname "${BASH_SOURCE[0]}")"/../../../scripts/show-progress.ts "$@"
105
27
  ```
106
28
 
107
29
  ## Example Output
108
30
 
31
+ ### Legacy Format (no User Stories)
109
32
  ```
110
33
  πŸ“Š Increment Progress
111
- ================================
34
+ ============================================================
112
35
 
113
36
  🟒 ACTIVE: 0037-project-specific-tasks
114
- Status: in-progress
115
- Tasks: 72/85 completed (84%)
116
- Next: /specweave:do 0037-project-specific-tasks
37
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘ 84% (72/85 tasks)
117
38
 
118
- ⏸️ planning: 0039-ultra-smart-next-command
119
- Tasks: 0/45 (0%)
39
+ Next: /specweave:do 0037-project-specific-tasks
120
40
 
121
- ================================
41
+ ============================================================
122
42
  Summary:
123
43
  Active increments: 1
124
- Other non-completed: 1
44
+ Other non-completed: 0
125
45
 
126
46
  πŸ’‘ Continue with /specweave:do
127
47
  ```
128
48
 
49
+ ### Enhanced Format (with User Story grouping)
50
+ ```
51
+ πŸ“Š Increment Progress
52
+ ============================================================
53
+
54
+ ⏸️ ACTIVE: 0047-us-task-linkage
55
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 59% (13/22 tasks)
56
+
57
+ Progress by User Story:
58
+ βœ… US-001: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (4/4)
59
+ βœ… US-002: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (3/3)
60
+ β”œβ”€ US-003: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 60% (3/5)
61
+ βœ… US-004: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (3/3)
62
+ β”œβ”€ US-005: β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0% (0/4)
63
+ β”œβ”€ US-006: β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0% (0/3)
64
+
65
+ Resume: /specweave:resume 0047-us-task-linkage
66
+
67
+ ============================================================
68
+ Summary:
69
+ Active increments: 0
70
+ Other non-completed: 1
71
+
72
+ πŸ’‘ No active work. Run /specweave:increment to start new work
73
+ ```
74
+
129
75
  ## What It Shows
130
76
 
131
- - **Active increments** (in-progress): Shown first with green indicator
132
- - **Other non-completed**: planning, paused, blocked, etc.
133
- - **Task completion**: X/Y completed (Z%)
134
- - **Next action**: Which command to run
77
+ - **Overall progress**: Visual bar + percentage + task count
78
+ - **Per-User Story progress** (if US linkage exists): Completion status for each US
79
+ - **Progress bars**: Color-coded (green β‰₯80%, yellow 50-79%, red <50%)
80
+ - **Completion indicators**: βœ… for 100% complete USs
81
+ - **Orphan tasks warning**: If tasks exist without User Story linkage
82
+ - **Next action**: Command to continue work
135
83
 
136
- **Note**: Skips completed and archived increments.
84
+ **Note**: Skips completed and archived increments. Automatically detects and displays US-level progress for increments using US-task linkage (v0.23.0+).
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ #
3
+ # Post-Edit Hook: Update Status Line After spec.md or tasks.md Edits
4
+ #
5
+ # Triggers: After Edit tool modifies spec.md (AC updates) or tasks.md (task completion)
6
+ # Action: Updates status line cache to reflect latest AC/task progress
7
+ #
8
+ # This ensures status line stays in sync when ACs are marked complete via Edit tool
9
+ # (not just TodoWrite, which only tracks internal todo lists)
10
+
11
+ set -e
12
+
13
+ # Find project root
14
+ find_project_root() {
15
+ local dir="$PWD"
16
+ while [[ "$dir" != "/" ]]; do
17
+ if [[ -d "$dir/.specweave" ]]; then
18
+ echo "$dir"
19
+ return 0
20
+ fi
21
+ dir=$(dirname "$dir")
22
+ done
23
+ echo "$PWD"
24
+ }
25
+
26
+ PROJECT_ROOT=$(find_project_root)
27
+
28
+ # Get the file that was edited from TOOL_USE_CONTENT environment variable
29
+ # Claude Code provides this in the hook context
30
+ EDITED_FILE="${TOOL_USE_CONTENT:-}"
31
+
32
+ # Only update status line if spec.md or tasks.md was edited
33
+ if [[ "$EDITED_FILE" == *"/spec.md"* ]] || [[ "$EDITED_FILE" == *"/tasks.md"* ]]; then
34
+ # Check if the edit is in an increment folder
35
+ if [[ "$EDITED_FILE" == *"/.specweave/increments/"* ]]; then
36
+ # Run status line update
37
+ "$PROJECT_ROOT/plugins/specweave/hooks/lib/update-status-line.sh" &>/dev/null || true
38
+ fi
39
+ fi
40
+
41
+ exit 0