specweave 0.24.13 → 0.26.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 (447) hide show
  1. package/CLAUDE.md +586 -18
  2. package/bin/specweave.js +14 -0
  3. package/dist/plugins/specweave-github/lib/CodeValidator.js +2 -2
  4. package/dist/plugins/specweave-github/lib/CodeValidator.js.map +1 -1
  5. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  6. package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js.map +1 -1
  7. package/dist/plugins/specweave-github/lib/github-client-v2.d.ts.map +1 -1
  8. package/dist/plugins/specweave-github/lib/github-client-v2.js +17 -1
  9. package/dist/plugins/specweave-github/lib/github-client-v2.js.map +1 -1
  10. package/dist/plugins/specweave-github/lib/github-issue-updater.js +1 -1
  11. package/dist/plugins/specweave-github/lib/github-issue-updater.js.map +1 -1
  12. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  13. package/dist/plugins/specweave-github/lib/github-sync-bidirectional.js.map +1 -1
  14. package/dist/plugins/specweave-github/lib/github-sync-increment-changes.js +1 -1
  15. package/dist/plugins/specweave-github/lib/github-sync-increment-changes.js.map +1 -1
  16. package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
  17. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +7 -6
  18. package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
  19. package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +1 -1
  20. package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -1
  21. package/dist/src/adapters/adapter-base.js +1 -1
  22. package/dist/src/adapters/adapter-base.js.map +1 -1
  23. package/dist/src/adapters/adapter-loader.js +1 -1
  24. package/dist/src/adapters/adapter-loader.js.map +1 -1
  25. package/dist/src/adapters/agents-md-generator.js +1 -1
  26. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  27. package/dist/src/adapters/claude/adapter.js +1 -1
  28. package/dist/src/adapters/claude/adapter.js.map +1 -1
  29. package/dist/src/adapters/claude-md-generator.js +1 -1
  30. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  31. package/dist/src/adapters/codex/adapter.js +1 -1
  32. package/dist/src/adapters/codex/adapter.js.map +1 -1
  33. package/dist/src/adapters/cursor/adapter.js +1 -1
  34. package/dist/src/adapters/cursor/adapter.js.map +1 -1
  35. package/dist/src/adapters/doc-generator.js +1 -1
  36. package/dist/src/adapters/doc-generator.js.map +1 -1
  37. package/dist/src/adapters/gemini/adapter.js +1 -1
  38. package/dist/src/adapters/gemini/adapter.js.map +1 -1
  39. package/dist/src/adapters/generic/adapter.js +1 -1
  40. package/dist/src/adapters/generic/adapter.js.map +1 -1
  41. package/dist/src/cli/commands/cicd-monitor.js +1 -1
  42. package/dist/src/cli/commands/cicd-monitor.js.map +1 -1
  43. package/dist/src/cli/commands/delete-feature.d.ts +14 -0
  44. package/dist/src/cli/commands/delete-feature.d.ts.map +1 -0
  45. package/dist/src/cli/commands/delete-feature.js +87 -0
  46. package/dist/src/cli/commands/delete-feature.js.map +1 -0
  47. package/dist/src/cli/commands/detect-specs.js +1 -1
  48. package/dist/src/cli/commands/detect-specs.js.map +1 -1
  49. package/dist/src/cli/commands/import-external.js +1 -1
  50. package/dist/src/cli/commands/import-external.js.map +1 -1
  51. package/dist/src/cli/commands/init.d.ts.map +1 -1
  52. package/dist/src/cli/commands/init.js +39 -49
  53. package/dist/src/cli/commands/init.js.map +1 -1
  54. package/dist/src/cli/commands/install.js +1 -1
  55. package/dist/src/cli/commands/install.js.map +1 -1
  56. package/dist/src/cli/commands/list.js +1 -1
  57. package/dist/src/cli/commands/list.js.map +1 -1
  58. package/dist/src/cli/commands/migrate-to-multiproject.js +1 -1
  59. package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
  60. package/dist/src/cli/commands/migrate-to-profiles.js +1 -1
  61. package/dist/src/cli/commands/migrate-to-profiles.js.map +1 -1
  62. package/dist/src/cli/commands/plan/agent-invoker.js +1 -1
  63. package/dist/src/cli/commands/repair-status-desync.js +1 -1
  64. package/dist/src/cli/commands/repair-status-desync.js.map +1 -1
  65. package/dist/src/cli/commands/revert-wip-limit.js +1 -1
  66. package/dist/src/cli/commands/revert-wip-limit.js.map +1 -1
  67. package/dist/src/cli/commands/sync-specs.js +1 -1
  68. package/dist/src/cli/commands/sync-specs.js.map +1 -1
  69. package/dist/src/cli/helpers/init/initial-increment-generator.js +1 -1
  70. package/dist/src/cli/helpers/init/initial-increment-generator.js.map +1 -1
  71. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
  72. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +13 -46
  73. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
  74. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  75. package/dist/src/cli/helpers/issue-tracker/index.js +12 -31
  76. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  77. package/dist/src/cli/helpers/issue-tracker/types.d.ts +6 -1
  78. package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -1
  79. package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -1
  80. package/dist/src/config/import-config.js +1 -1
  81. package/dist/src/config/import-config.js.map +1 -1
  82. package/dist/src/core/ac-test-validator-cli.js +1 -1
  83. package/dist/src/core/ac-test-validator-cli.js.map +1 -1
  84. package/dist/src/core/ac-test-validator.js +1 -1
  85. package/dist/src/core/ac-test-validator.js.map +1 -1
  86. package/dist/src/core/brownfield/analyzer.js +1 -1
  87. package/dist/src/core/brownfield/analyzer.js.map +1 -1
  88. package/dist/src/core/brownfield/importer.js +1 -1
  89. package/dist/src/core/brownfield/importer.js.map +1 -1
  90. package/dist/src/core/cicd/config-loader.js +1 -1
  91. package/dist/src/core/cicd/config-loader.js.map +1 -1
  92. package/dist/src/core/cicd/notifier.js +1 -1
  93. package/dist/src/core/cicd/notifier.js.map +1 -1
  94. package/dist/src/core/cicd/parent-repo-validator.js +1 -1
  95. package/dist/src/core/cicd/parent-repo-validator.js.map +1 -1
  96. package/dist/src/core/cicd/state-manager.js +1 -1
  97. package/dist/src/core/cicd/state-manager.js.map +1 -1
  98. package/dist/src/core/config-manager.js +1 -1
  99. package/dist/src/core/config-manager.js.map +1 -1
  100. package/dist/src/core/cost-tracker.js +1 -1
  101. package/dist/src/core/cost-tracker.js.map +1 -1
  102. package/dist/src/core/deduplication/command-deduplicator.js +1 -1
  103. package/dist/src/core/deduplication/command-deduplicator.js.map +1 -1
  104. package/dist/src/core/feature-deleter/audit-logger.d.ts +30 -0
  105. package/dist/src/core/feature-deleter/audit-logger.d.ts.map +1 -0
  106. package/dist/src/core/feature-deleter/audit-logger.js +77 -0
  107. package/dist/src/core/feature-deleter/audit-logger.js.map +1 -0
  108. package/dist/src/core/feature-deleter/confirmation-manager.d.ts +39 -0
  109. package/dist/src/core/feature-deleter/confirmation-manager.d.ts.map +1 -0
  110. package/dist/src/core/feature-deleter/confirmation-manager.js +89 -0
  111. package/dist/src/core/feature-deleter/confirmation-manager.js.map +1 -0
  112. package/dist/src/core/feature-deleter/deletion-transaction.d.ts +51 -0
  113. package/dist/src/core/feature-deleter/deletion-transaction.d.ts.map +1 -0
  114. package/dist/src/core/feature-deleter/deletion-transaction.js +185 -0
  115. package/dist/src/core/feature-deleter/deletion-transaction.js.map +1 -0
  116. package/dist/src/core/feature-deleter/git-service.d.ts +43 -0
  117. package/dist/src/core/feature-deleter/git-service.d.ts.map +1 -0
  118. package/dist/src/core/feature-deleter/git-service.js +127 -0
  119. package/dist/src/core/feature-deleter/git-service.js.map +1 -0
  120. package/dist/src/core/feature-deleter/github-service.d.ts +36 -0
  121. package/dist/src/core/feature-deleter/github-service.d.ts.map +1 -0
  122. package/dist/src/core/feature-deleter/github-service.js +102 -0
  123. package/dist/src/core/feature-deleter/github-service.js.map +1 -0
  124. package/dist/src/core/feature-deleter/index.d.ts +35 -0
  125. package/dist/src/core/feature-deleter/index.d.ts.map +1 -0
  126. package/dist/src/core/feature-deleter/index.js +199 -0
  127. package/dist/src/core/feature-deleter/index.js.map +1 -0
  128. package/dist/src/core/feature-deleter/types.d.ts +179 -0
  129. package/dist/src/core/feature-deleter/types.d.ts.map +1 -0
  130. package/dist/src/core/feature-deleter/types.js +7 -0
  131. package/dist/src/core/feature-deleter/types.js.map +1 -0
  132. package/dist/src/core/feature-deleter/validator.d.ts +46 -0
  133. package/dist/src/core/feature-deleter/validator.d.ts.map +1 -0
  134. package/dist/src/core/feature-deleter/validator.js +231 -0
  135. package/dist/src/core/feature-deleter/validator.js.map +1 -0
  136. package/dist/src/core/hooks/HealthReporter.js +1 -1
  137. package/dist/src/core/hooks/HealthReporter.js.map +1 -1
  138. package/dist/src/core/hooks/HookAutoFixer.js +1 -1
  139. package/dist/src/core/hooks/HookAutoFixer.js.map +1 -1
  140. package/dist/src/core/hooks/HookScanner.js +1 -1
  141. package/dist/src/core/hooks/HookScanner.js.map +1 -1
  142. package/dist/src/core/i18n/language-manager.js +1 -1
  143. package/dist/src/core/i18n/language-manager.js.map +1 -1
  144. package/dist/src/core/i18n/locale-manager.js +1 -1
  145. package/dist/src/core/i18n/locale-manager.js.map +1 -1
  146. package/dist/src/core/i18n/system-prompt-injector.js +1 -1
  147. package/dist/src/core/i18n/system-prompt-injector.js.map +1 -1
  148. package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -1
  149. package/dist/src/core/increment/ac-status-manager.js +18 -4
  150. package/dist/src/core/increment/ac-status-manager.js.map +1 -1
  151. package/dist/src/core/increment/active-increment-manager.js +1 -1
  152. package/dist/src/core/increment/active-increment-manager.js.map +1 -1
  153. package/dist/src/core/increment/completion-validator.js +1 -1
  154. package/dist/src/core/increment/completion-validator.js.map +1 -1
  155. package/dist/src/core/increment/conflict-resolver.js +1 -1
  156. package/dist/src/core/increment/conflict-resolver.js.map +1 -1
  157. package/dist/src/core/increment/desync-detector.js +1 -1
  158. package/dist/src/core/increment/desync-detector.js.map +1 -1
  159. package/dist/src/core/increment/discipline-checker.js +1 -1
  160. package/dist/src/core/increment/discipline-checker.js.map +1 -1
  161. package/dist/src/core/increment/duplicate-detector.js +1 -1
  162. package/dist/src/core/increment/duplicate-detector.js.map +1 -1
  163. package/dist/src/core/increment/increment-archiver.js +1 -1
  164. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  165. package/dist/src/core/increment/increment-reopener.js +1 -1
  166. package/dist/src/core/increment/increment-reopener.js.map +1 -1
  167. package/dist/src/core/increment/metadata-manager.js +1 -1
  168. package/dist/src/core/increment/metadata-manager.js.map +1 -1
  169. package/dist/src/core/increment/metadata-validator.js +1 -1
  170. package/dist/src/core/increment/metadata-validator.js.map +1 -1
  171. package/dist/src/core/increment/recent-work-scanner.js +1 -1
  172. package/dist/src/core/increment/recent-work-scanner.js.map +1 -1
  173. package/dist/src/core/increment/spec-frontmatter-updater.js +1 -1
  174. package/dist/src/core/increment/spec-frontmatter-updater.js.map +1 -1
  175. package/dist/src/core/increment/status-auto-transition.js +1 -1
  176. package/dist/src/core/increment/status-auto-transition.js.map +1 -1
  177. package/dist/src/core/increment-status.js +1 -1
  178. package/dist/src/core/increment-status.js.map +1 -1
  179. package/dist/src/core/living-docs/content-distributor.js +1 -1
  180. package/dist/src/core/living-docs/content-distributor.js.map +1 -1
  181. package/dist/src/core/living-docs/cross-linker.js +1 -1
  182. package/dist/src/core/living-docs/cross-linker.js.map +1 -1
  183. package/dist/src/core/living-docs/feature-archiver.js +1 -1
  184. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  185. package/dist/src/core/living-docs/feature-id-manager.js +1 -1
  186. package/dist/src/core/living-docs/feature-id-manager.js.map +1 -1
  187. package/dist/src/core/living-docs/hierarchy-mapper.js +1 -1
  188. package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
  189. package/dist/src/core/living-docs/living-docs-sync.d.ts +14 -0
  190. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  191. package/dist/src/core/living-docs/living-docs-sync.js +72 -13
  192. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  193. package/dist/src/core/living-docs/project-detector.js +1 -1
  194. package/dist/src/core/living-docs/project-detector.js.map +1 -1
  195. package/dist/src/core/living-docs/task-project-specific-generator.js +1 -1
  196. package/dist/src/core/living-docs/task-project-specific-generator.js.map +1 -1
  197. package/dist/src/core/logging/prompt-logger.js +1 -1
  198. package/dist/src/core/logging/prompt-logger.js.map +1 -1
  199. package/dist/src/core/plugin-loader.js +1 -1
  200. package/dist/src/core/plugin-loader.js.map +1 -1
  201. package/dist/src/core/project-manager.js +1 -1
  202. package/dist/src/core/project-manager.js.map +1 -1
  203. package/dist/src/core/qa/qa-runner.js +1 -1
  204. package/dist/src/core/qa/qa-runner.js.map +1 -1
  205. package/dist/src/core/repo-structure/folder-detector.js +1 -1
  206. package/dist/src/core/repo-structure/folder-detector.js.map +1 -1
  207. package/dist/src/core/repo-structure/setup-state-manager.js +1 -1
  208. package/dist/src/core/repo-structure/setup-state-manager.js.map +1 -1
  209. package/dist/src/core/spec-detector.js +1 -1
  210. package/dist/src/core/spec-detector.js.map +1 -1
  211. package/dist/src/core/specs/spec-metadata-manager.js +1 -1
  212. package/dist/src/core/specs/spec-metadata-manager.js.map +1 -1
  213. package/dist/src/core/status-line/status-line-updater.js +1 -1
  214. package/dist/src/core/status-line/status-line-updater.js.map +1 -1
  215. package/dist/src/core/status-line-validator.js +1 -1
  216. package/dist/src/core/status-line-validator.js.map +1 -1
  217. package/dist/src/core/sync/bidirectional-engine.js +1 -1
  218. package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
  219. package/dist/src/core/sync/profile-manager.js +1 -1
  220. package/dist/src/core/sync/profile-manager.js.map +1 -1
  221. package/dist/src/core/sync/project-context.js +1 -1
  222. package/dist/src/core/sync/project-context.js.map +1 -1
  223. package/dist/src/core/sync/sync-event-logger.js +1 -1
  224. package/dist/src/core/sync/sync-event-logger.js.map +1 -1
  225. package/dist/src/core/types/config.js +1 -1
  226. package/dist/src/core/types/config.js.map +1 -1
  227. package/dist/src/core/us-completion-detector.d.ts +124 -0
  228. package/dist/src/core/us-completion-detector.d.ts.map +1 -0
  229. package/dist/src/core/us-completion-detector.js +270 -0
  230. package/dist/src/core/us-completion-detector.js.map +1 -0
  231. package/dist/src/core/utils/permission-checker.js +1 -1
  232. package/dist/src/core/utils/permission-checker.js.map +1 -1
  233. package/dist/src/core/workflow/autonomous-executor.js +1 -1
  234. package/dist/src/core/workflow/autonomous-executor.js.map +1 -1
  235. package/dist/src/core/workflow/backlog-scanner.js +1 -1
  236. package/dist/src/core/workflow/backlog-scanner.js.map +1 -1
  237. package/dist/src/core/workflow/cost-estimator.js +1 -1
  238. package/dist/src/core/workflow/cost-estimator.js.map +1 -1
  239. package/dist/src/core/workflow/state-manager.js +1 -1
  240. package/dist/src/core/workflow/state-manager.js.map +1 -1
  241. package/dist/src/importers/duplicate-detector.js +1 -1
  242. package/dist/src/importers/duplicate-detector.js.map +1 -1
  243. package/dist/src/importers/item-converter.js +1 -1
  244. package/dist/src/importers/item-converter.js.map +1 -1
  245. package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +1 -1
  246. package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
  247. package/dist/src/integrations/jira/jira-incremental-mapper.js +3 -3
  248. package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
  249. package/dist/src/living-docs/fs-id-allocator.js +1 -1
  250. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  251. package/dist/src/living-docs/id-registry.js +1 -1
  252. package/dist/src/living-docs/id-registry.js.map +1 -1
  253. package/dist/src/sync/external-item-sync-service.js +1 -1
  254. package/dist/src/sync/external-item-sync-service.js.map +1 -1
  255. package/dist/src/sync/sync-metadata.js +1 -1
  256. package/dist/src/sync/sync-metadata.js.map +1 -1
  257. package/dist/src/utils/agents-md-compiler.js +1 -1
  258. package/dist/src/utils/agents-md-compiler.js.map +1 -1
  259. package/dist/src/utils/auto-install.js +1 -1
  260. package/dist/src/utils/auto-install.js.map +1 -1
  261. package/dist/src/utils/cost-reporter.js +1 -1
  262. package/dist/src/utils/cost-reporter.js.map +1 -1
  263. package/dist/src/utils/docs-preview/config-generator.js +1 -1
  264. package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
  265. package/dist/src/utils/docs-preview/docusaurus-setup.js +1 -1
  266. package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
  267. package/dist/src/utils/docs-preview/package-installer.js +1 -1
  268. package/dist/src/utils/docs-preview/package-installer.js.map +1 -1
  269. package/dist/src/utils/docs-preview/sidebar-builder.js +1 -1
  270. package/dist/src/utils/docs-preview/sidebar-builder.js.map +1 -1
  271. package/dist/src/utils/env-file-generator.js +1 -1
  272. package/dist/src/utils/env-file-generator.js.map +1 -1
  273. package/dist/src/utils/external-resource-validator.js +1 -1
  274. package/dist/src/utils/external-resource-validator.js.map +1 -1
  275. package/dist/src/utils/fs-native.d.ts +51 -5
  276. package/dist/src/utils/fs-native.d.ts.map +1 -1
  277. package/dist/src/utils/fs-native.js +100 -5
  278. package/dist/src/utils/fs-native.js.map +1 -1
  279. package/dist/src/utils/plugin-validator.js +1 -1
  280. package/dist/src/utils/plugin-validator.js.map +1 -1
  281. package/dist/src/utils/project-detection.js +1 -1
  282. package/dist/src/utils/project-detection.js.map +1 -1
  283. package/dist/src/utils/project-validator.js +1 -1
  284. package/dist/src/utils/project-validator.js.map +1 -1
  285. package/dist/src/utils/spec-parser.js +1 -1
  286. package/dist/src/utils/spec-parser.js.map +1 -1
  287. package/dist/src/utils/spec-splitter.js +1 -1
  288. package/dist/src/utils/spec-splitter.js.map +1 -1
  289. package/dist/src/validators/ac-coverage-validator.js +1 -1
  290. package/dist/src/validators/ac-coverage-validator.js.map +1 -1
  291. package/package.json +5 -6
  292. package/plugins/specweave/agents/code-standards-detective/AGENT.md +47 -0
  293. package/plugins/specweave/agents/docs-writer/AGENT.md +134 -1
  294. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +1 -0
  295. package/plugins/specweave/agents/infrastructure/AGENT.md +48 -1
  296. package/plugins/specweave/agents/performance/AGENT.md +46 -0
  297. package/plugins/specweave/agents/pm/AGENT.md +115 -3
  298. package/plugins/specweave/agents/qa-lead/AGENT.md +40 -1
  299. package/plugins/specweave/agents/reflective-reviewer/AGENT.md +5 -0
  300. package/plugins/specweave/agents/security/AGENT.md +45 -0
  301. package/plugins/specweave/agents/tdd-orchestrator/AGENT.md +128 -1
  302. package/plugins/specweave/agents/tech-lead/AGENT.md +138 -1
  303. package/plugins/specweave/agents/translator/AGENT.md +132 -0
  304. package/plugins/specweave/commands/specweave-sync-progress.md +616 -0
  305. package/plugins/specweave/hooks/hooks.json +0 -9
  306. package/plugins/specweave/hooks/post-increment-completion.sh +133 -0
  307. package/plugins/specweave/hooks/post-metadata-change.sh +28 -23
  308. package/plugins/specweave/hooks/post-task-completion.sh +7 -0
  309. package/plugins/specweave/hooks/pre-edit-write-consolidated.sh +44 -7
  310. package/plugins/specweave/hooks/shared/bulk-operation-detector.sh +167 -0
  311. package/plugins/specweave/lib/hooks/consolidated-sync.js +19 -2
  312. package/plugins/specweave/lib/hooks/us-completion-orchestrator.js +135 -0
  313. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js +18 -4
  314. package/plugins/specweave/lib/vendor/core/increment/ac-status-manager.js.map +1 -1
  315. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js +1 -1
  316. package/plugins/specweave/lib/vendor/core/increment/active-increment-manager.js.map +1 -1
  317. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js +1 -1
  318. package/plugins/specweave/lib/vendor/core/increment/duplicate-detector.js.map +1 -1
  319. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +1 -1
  320. package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
  321. package/plugins/specweave/skills/code-reviewer/SKILL.md +1 -1
  322. package/plugins/specweave/skills/progress-sync/SKILL.md +405 -0
  323. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  324. package/plugins/specweave-ado/lib/ado-project-detector.js +1 -1
  325. package/plugins/specweave-ado/lib/ado-project-detector.ts +1 -1
  326. package/plugins/specweave-ado/lib/conflict-resolver.js +1 -1
  327. package/plugins/specweave-ado/lib/conflict-resolver.ts +1 -1
  328. package/plugins/specweave-backend/agents/database-optimizer/AGENT.md +1 -1
  329. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +5 -0
  330. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -15
  331. package/plugins/specweave-github/hooks/README.md +34 -25
  332. package/plugins/specweave-github/lib/CodeValidator.js +1 -1
  333. package/plugins/specweave-github/lib/CodeValidator.ts +2 -2
  334. package/plugins/specweave-github/lib/ThreeLayerSyncManager.js +1 -1
  335. package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +1 -1
  336. package/plugins/specweave-github/lib/github-client-v2.js +13 -1
  337. package/plugins/specweave-github/lib/github-client-v2.ts +17 -1
  338. package/plugins/specweave-github/lib/github-issue-updater.js +1 -1
  339. package/plugins/specweave-github/lib/github-issue-updater.ts +1 -1
  340. package/plugins/specweave-github/lib/github-sync-bidirectional.js +1 -1
  341. package/plugins/specweave-github/lib/github-sync-bidirectional.ts +1 -1
  342. package/plugins/specweave-github/lib/github-sync-increment-changes.js +1 -1
  343. package/plugins/specweave-github/lib/github-sync-increment-changes.ts +1 -1
  344. package/plugins/specweave-github/lib/user-story-issue-builder.js +4 -4
  345. package/plugins/specweave-github/lib/user-story-issue-builder.ts +7 -6
  346. package/plugins/specweave-infrastructure/agents/devops/AGENT.md +48 -1
  347. package/plugins/specweave-infrastructure/agents/network-engineer/AGENT.md +6 -1
  348. package/plugins/specweave-infrastructure/agents/observability-engineer/AGENT.md +6 -1
  349. package/plugins/specweave-infrastructure/agents/performance-engineer/AGENT.md +6 -1
  350. package/plugins/specweave-infrastructure/agents/sre/AGENT.md +5 -0
  351. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  352. package/plugins/specweave-jira/lib/jira-epic-sync.js +1 -1
  353. package/plugins/specweave-jira/lib/jira-epic-sync.ts +1 -1
  354. package/plugins/specweave-kafka/agents/kafka-architect/AGENT.md +5 -0
  355. package/plugins/specweave-kubernetes/agents/kubernetes-architect/AGENT.md +47 -2
  356. package/plugins/specweave-ml/agents/data-scientist/AGENT.md +1 -1
  357. package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +5 -0
  358. package/plugins/specweave-ml/agents/mlops-engineer/AGENT.md +6 -1
  359. package/plugins/specweave-payments/agents/payment-integration/AGENT.md +1 -1
  360. package/plugins/specweave/agents/pm/AGENT.md.bak +0 -1893
  361. package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
  362. package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
  363. package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +0 -245
  364. package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +0 -149
  365. package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +0 -163
  366. package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
  367. package/plugins/specweave/hooks/post-first-increment.sh.bak +0 -61
  368. package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
  369. package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
  370. package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
  371. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
  372. package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
  373. package/plugins/specweave/hooks/post-spec-update.sh.bak +0 -158
  374. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
  375. package/plugins/specweave/hooks/post-user-story-complete.sh.bak +0 -179
  376. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
  377. package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +0 -83
  378. package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
  379. package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
  380. package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
  381. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
  382. package/plugins/specweave/hooks/user-prompt-submit.sh.bak +0 -386
  383. package/plugins/specweave/lib/hooks/auto-transition.js.bak +0 -50
  384. package/plugins/specweave/lib/hooks/auto-transition.ts.bak +0 -84
  385. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.js.bak +0 -0
  386. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.bak +0 -89
  387. package/plugins/specweave/lib/hooks/git-diff-analyzer.js.bak +0 -142
  388. package/plugins/specweave/lib/hooks/git-diff-analyzer.ts.bak +0 -269
  389. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.js.bak +0 -0
  390. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.bak +0 -60
  391. package/plugins/specweave/lib/hooks/invoke-translator-skill.js.bak +0 -155
  392. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts.bak +0 -264
  393. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.js.bak +0 -0
  394. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.bak +0 -42
  395. package/plugins/specweave/lib/hooks/prepare-reflection-context.js.bak +0 -110
  396. package/plugins/specweave/lib/hooks/prepare-reflection-context.ts.bak +0 -178
  397. package/plugins/specweave/lib/hooks/reflection-config-loader.d.js.bak +0 -0
  398. package/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.bak +0 -45
  399. package/plugins/specweave/lib/hooks/reflection-config-loader.js.bak +0 -92
  400. package/plugins/specweave/lib/hooks/reflection-config-loader.ts.bak +0 -156
  401. package/plugins/specweave/lib/hooks/reflection-parser.d.js.bak +0 -0
  402. package/plugins/specweave/lib/hooks/reflection-parser.d.ts.bak +0 -33
  403. package/plugins/specweave/lib/hooks/reflection-parser.js.bak +0 -301
  404. package/plugins/specweave/lib/hooks/reflection-parser.ts.bak +0 -484
  405. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.js.bak +0 -0
  406. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.bak +0 -56
  407. package/plugins/specweave/lib/hooks/reflection-prompt-builder.js.bak +0 -182
  408. package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts.bak +0 -306
  409. package/plugins/specweave/lib/hooks/reflection-storage.d.js.bak +0 -0
  410. package/plugins/specweave/lib/hooks/reflection-storage.d.ts.bak +0 -64
  411. package/plugins/specweave/lib/hooks/reflection-storage.js.bak +0 -231
  412. package/plugins/specweave/lib/hooks/reflection-storage.ts.bak +0 -369
  413. package/plugins/specweave/lib/hooks/run-self-reflection.d.js.bak +0 -0
  414. package/plugins/specweave/lib/hooks/run-self-reflection.d.ts.bak +0 -43
  415. package/plugins/specweave/lib/hooks/run-self-reflection.js.bak +0 -132
  416. package/plugins/specweave/lib/hooks/run-self-reflection.ts.bak +0 -258
  417. package/plugins/specweave/lib/hooks/sync-cache.js.bak +0 -294
  418. package/plugins/specweave/lib/hooks/sync-living-docs.d.js.bak +0 -1
  419. package/plugins/specweave/lib/hooks/sync-living-docs.d.ts.bak +0 -27
  420. package/plugins/specweave/lib/hooks/sync-living-docs.js.bak +0 -339
  421. package/plugins/specweave/lib/hooks/sync-us-tasks.js.bak +0 -476
  422. package/plugins/specweave/lib/hooks/translate-file.d.js.bak +0 -0
  423. package/plugins/specweave/lib/hooks/translate-file.d.ts.bak +0 -59
  424. package/plugins/specweave/lib/hooks/translate-file.js.bak +0 -289
  425. package/plugins/specweave/lib/hooks/translate-file.ts.bak +0 -428
  426. package/plugins/specweave/lib/hooks/translate-living-docs.d.js.bak +0 -0
  427. package/plugins/specweave/lib/hooks/translate-living-docs.d.ts.bak +0 -13
  428. package/plugins/specweave/lib/hooks/translate-living-docs.js.bak +0 -119
  429. package/plugins/specweave/lib/hooks/translate-living-docs.ts.bak +0 -224
  430. package/plugins/specweave/lib/hooks/update-ac-status.js.bak +0 -51
  431. package/plugins/specweave/lib/hooks/update-ac-status.ts.bak +0 -103
  432. package/plugins/specweave/lib/hooks/update-tasks-md.d.js.bak +0 -1
  433. package/plugins/specweave/lib/hooks/update-tasks-md.d.ts.bak +0 -29
  434. package/plugins/specweave/lib/hooks/update-tasks-md.js.bak +0 -296
  435. package/plugins/specweave/lib/hooks/update-tasks-md.ts.bak +0 -489
  436. package/plugins/specweave-ado/hooks/hooks.json +0 -15
  437. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
  438. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
  439. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  440. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -718
  441. package/plugins/specweave-github/hooks/hooks.json +0 -15
  442. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
  443. package/plugins/specweave-jira/hooks/hooks.json +0 -15
  444. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
  445. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -600
  446. package/plugins/specweave-release/hooks/hooks.json +0 -15
  447. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
@@ -1,142 +0,0 @@
1
- import { execSync } from "child_process";
2
- import fs from "fs-extra";
3
- import path from "path";
4
- function executeGitCommand(command, cwd) {
5
- try {
6
- return execSync(command, {
7
- cwd: cwd || process.cwd(),
8
- encoding: "utf-8",
9
- stdio: ["pipe", "pipe", "pipe"]
10
- });
11
- } catch (error) {
12
- throw new Error(`Git command failed: ${command}. ${error.message}`);
13
- }
14
- }
15
- function isGitRepository(dir = process.cwd()) {
16
- try {
17
- executeGitCommand("git rev-parse --git-dir", dir);
18
- return true;
19
- } catch {
20
- return false;
21
- }
22
- }
23
- function getModifiedFilesList(cwd) {
24
- if (!isGitRepository(cwd)) {
25
- return [];
26
- }
27
- try {
28
- const output = executeGitCommand("git diff --name-only HEAD", cwd);
29
- if (!output.trim()) {
30
- return [];
31
- }
32
- return output.trim().split("\n").filter((file) => file.length > 0).filter((file) => !file.startsWith(".git/"));
33
- } catch {
34
- return [];
35
- }
36
- }
37
- function parseNumstat(numstatOutput) {
38
- const stats = /* @__PURE__ */ new Map();
39
- if (!numstatOutput.trim()) {
40
- return stats;
41
- }
42
- const lines = numstatOutput.trim().split("\n");
43
- for (const line of lines) {
44
- const parts = line.split(" ");
45
- if (parts.length < 3) continue;
46
- const added = parts[0] === "-" ? 0 : parseInt(parts[0], 10);
47
- const removed = parts[1] === "-" ? 0 : parseInt(parts[1], 10);
48
- const filename = parts[2];
49
- stats.set(filename, { added, removed });
50
- }
51
- return stats;
52
- }
53
- function getFileDiff(file, cwd) {
54
- if (!isGitRepository(cwd)) {
55
- return "";
56
- }
57
- try {
58
- const output = executeGitCommand(`git diff HEAD -- "${file}"`, cwd);
59
- return output;
60
- } catch {
61
- return "";
62
- }
63
- }
64
- function getFileContent(file, cwd) {
65
- try {
66
- const workingDir = cwd || process.cwd();
67
- const absolutePath = path.isAbsolute(file) ? file : path.join(workingDir, file);
68
- if (!fs.existsSync(absolutePath)) {
69
- return "";
70
- }
71
- return fs.readFileSync(absolutePath, "utf-8");
72
- } catch {
73
- return "";
74
- }
75
- }
76
- function getModifiedFiles(cwd, maxFiles = 100) {
77
- if (!isGitRepository(cwd)) {
78
- return [];
79
- }
80
- const workingDir = cwd || process.cwd();
81
- const modifiedFiles = getModifiedFilesList(workingDir);
82
- if (modifiedFiles.length === 0) {
83
- return [];
84
- }
85
- const filesToAnalyze = modifiedFiles.slice(0, maxFiles);
86
- let numstatOutput = "";
87
- try {
88
- numstatOutput = executeGitCommand("git diff --numstat HEAD", workingDir);
89
- } catch {
90
- }
91
- const stats = parseNumstat(numstatOutput);
92
- const result = [];
93
- for (const file of filesToAnalyze) {
94
- const fileStat = stats.get(file) || { added: 0, removed: 0 };
95
- const diffContent = getFileDiff(file, workingDir);
96
- if (fileStat.added > 0 || fileStat.removed > 0 || diffContent.length > 0) {
97
- result.push({
98
- file,
99
- linesAdded: fileStat.added,
100
- linesRemoved: fileStat.removed,
101
- content: diffContent
102
- });
103
- }
104
- }
105
- return result;
106
- }
107
- function getModifiedFilesSummary(modifiedFiles) {
108
- return {
109
- count: modifiedFiles.length,
110
- linesAdded: modifiedFiles.reduce((sum, file) => sum + file.linesAdded, 0),
111
- linesRemoved: modifiedFiles.reduce((sum, file) => sum + file.linesRemoved, 0),
112
- totalChanges: modifiedFiles.reduce(
113
- (sum, file) => sum + file.linesAdded + file.linesRemoved,
114
- 0
115
- )
116
- };
117
- }
118
- function filterFilesByExtension(modifiedFiles, extensions) {
119
- return modifiedFiles.filter((file) => {
120
- const ext = path.extname(file.file).toLowerCase();
121
- return extensions.some((allowedExt) => ext === allowedExt.toLowerCase());
122
- });
123
- }
124
- function excludeFilesByPattern(modifiedFiles, patterns) {
125
- return modifiedFiles.filter((file) => {
126
- return !patterns.some((pattern) => {
127
- const regex = new RegExp("^" + pattern.replace(/\*/g, ".*") + "$");
128
- return regex.test(file.file);
129
- });
130
- });
131
- }
132
- export {
133
- excludeFilesByPattern,
134
- filterFilesByExtension,
135
- getFileContent,
136
- getFileDiff,
137
- getModifiedFiles,
138
- getModifiedFilesList,
139
- getModifiedFilesSummary,
140
- isGitRepository,
141
- parseNumstat
142
- };
@@ -1,269 +0,0 @@
1
- /**
2
- * Git Diff Analyzer
3
- *
4
- * Extracts modified files from git diff for reflection analysis
5
- * Parses git diff output to get file changes, line counts, and content
6
- *
7
- * @module git-diff-analyzer
8
- */
9
-
10
- import { execSync } from 'child_process';
11
- import fs from 'fs-extra';
12
- import path from 'path';
13
- import { GitDiffInfo } from './types/reflection-types';
14
-
15
- /**
16
- * Execute git command safely
17
- * @param command Git command to execute
18
- * @param cwd Working directory (optional)
19
- * @returns Command output as string
20
- * @throws Error if command fails
21
- */
22
- function executeGitCommand(command: string, cwd?: string): string {
23
- try {
24
- return execSync(command, {
25
- cwd: cwd || process.cwd(),
26
- encoding: 'utf-8',
27
- stdio: ['pipe', 'pipe', 'pipe']
28
- });
29
- } catch (error: any) {
30
- throw new Error(`Git command failed: ${command}. ${error.message}`);
31
- }
32
- }
33
-
34
- /**
35
- * Check if directory is a git repository
36
- * @param dir Directory to check (defaults to cwd)
37
- * @returns True if directory is in a git repository
38
- */
39
- export function isGitRepository(dir: string = process.cwd()): boolean {
40
- try {
41
- executeGitCommand('git rev-parse --git-dir', dir);
42
- return true;
43
- } catch {
44
- return false;
45
- }
46
- }
47
-
48
- /**
49
- * Get list of modified files in the working directory
50
- * Includes both staged and unstaged changes
51
- *
52
- * @param cwd Working directory (optional, defaults to process.cwd())
53
- * @returns Array of file paths relative to git root
54
- */
55
- export function getModifiedFilesList(cwd?: string): string[] {
56
- if (!isGitRepository(cwd)) {
57
- return [];
58
- }
59
-
60
- try {
61
- // Get both staged and unstaged changes
62
- const output = executeGitCommand('git diff --name-only HEAD', cwd);
63
-
64
- if (!output.trim()) {
65
- return [];
66
- }
67
-
68
- return output
69
- .trim()
70
- .split('\n')
71
- .filter(file => file.length > 0)
72
- .filter(file => !file.startsWith('.git/')); // Exclude .git directory
73
- } catch {
74
- return [];
75
- }
76
- }
77
-
78
- /**
79
- * Parse git diff numstat output to get line counts
80
- * Format: <added>\t<removed>\t<filename>
81
- *
82
- * @param numstatOutput Output from git diff --numstat
83
- * @returns Map of filename to {added, removed} counts
84
- */
85
- export function parseNumstat(numstatOutput: string): Map<string, { added: number; removed: number }> {
86
- const stats = new Map<string, { added: number; removed: number }>();
87
-
88
- if (!numstatOutput.trim()) {
89
- return stats;
90
- }
91
-
92
- const lines = numstatOutput.trim().split('\n');
93
-
94
- for (const line of lines) {
95
- const parts = line.split('\t');
96
- if (parts.length < 3) continue;
97
-
98
- const added = parts[0] === '-' ? 0 : parseInt(parts[0], 10);
99
- const removed = parts[1] === '-' ? 0 : parseInt(parts[1], 10);
100
- const filename = parts[2];
101
-
102
- stats.set(filename, { added, removed });
103
- }
104
-
105
- return stats;
106
- }
107
-
108
- /**
109
- * Get diff content for a specific file
110
- * @param file File path relative to git root
111
- * @param cwd Working directory (optional)
112
- * @returns Diff content as string
113
- */
114
- export function getFileDiff(file: string, cwd?: string): string {
115
- if (!isGitRepository(cwd)) {
116
- return '';
117
- }
118
-
119
- try {
120
- // Get unified diff for the file
121
- const output = executeGitCommand(`git diff HEAD -- "${file}"`, cwd);
122
- return output;
123
- } catch {
124
- return '';
125
- }
126
- }
127
-
128
- /**
129
- * Get current file content
130
- * @param file File path (can be absolute or relative to cwd)
131
- * @param cwd Working directory (optional)
132
- * @returns File content as string, or empty string if file doesn't exist
133
- */
134
- export function getFileContent(file: string, cwd?: string): string {
135
- try {
136
- const workingDir = cwd || process.cwd();
137
- const absolutePath = path.isAbsolute(file) ? file : path.join(workingDir, file);
138
-
139
- if (!fs.existsSync(absolutePath)) {
140
- return '';
141
- }
142
-
143
- return fs.readFileSync(absolutePath, 'utf-8');
144
- } catch {
145
- return '';
146
- }
147
- }
148
-
149
- /**
150
- * Get modified files with diff information
151
- * Main function for reflection analysis
152
- *
153
- * @param cwd Working directory (optional, defaults to process.cwd())
154
- * @param maxFiles Maximum number of files to return (optional, defaults to 100)
155
- * @returns Array of GitDiffInfo objects with file changes
156
- */
157
- export function getModifiedFiles(
158
- cwd?: string,
159
- maxFiles: number = 100
160
- ): GitDiffInfo[] {
161
- if (!isGitRepository(cwd)) {
162
- return [];
163
- }
164
-
165
- const workingDir = cwd || process.cwd();
166
-
167
- // Get list of modified files
168
- const modifiedFiles = getModifiedFilesList(workingDir);
169
-
170
- if (modifiedFiles.length === 0) {
171
- return [];
172
- }
173
-
174
- // Limit number of files to prevent overwhelming the analysis
175
- const filesToAnalyze = modifiedFiles.slice(0, maxFiles);
176
-
177
- // Get line count statistics
178
- let numstatOutput = '';
179
- try {
180
- numstatOutput = executeGitCommand('git diff --numstat HEAD', workingDir);
181
- } catch {
182
- // If numstat fails, continue with empty stats
183
- }
184
-
185
- const stats = parseNumstat(numstatOutput);
186
-
187
- // Build GitDiffInfo array
188
- const result: GitDiffInfo[] = [];
189
-
190
- for (const file of filesToAnalyze) {
191
- const fileStat = stats.get(file) || { added: 0, removed: 0 };
192
- const diffContent = getFileDiff(file, workingDir);
193
-
194
- // Only include files with actual changes
195
- if (fileStat.added > 0 || fileStat.removed > 0 || diffContent.length > 0) {
196
- result.push({
197
- file,
198
- linesAdded: fileStat.added,
199
- linesRemoved: fileStat.removed,
200
- content: diffContent
201
- });
202
- }
203
- }
204
-
205
- return result;
206
- }
207
-
208
- /**
209
- * Get summary statistics for modified files
210
- * Useful for reflection metadata
211
- *
212
- * @param modifiedFiles Array of GitDiffInfo objects
213
- * @returns Summary with file count, total lines added/removed
214
- */
215
- export function getModifiedFilesSummary(modifiedFiles: GitDiffInfo[]): {
216
- count: number;
217
- linesAdded: number;
218
- linesRemoved: number;
219
- totalChanges: number;
220
- } {
221
- return {
222
- count: modifiedFiles.length,
223
- linesAdded: modifiedFiles.reduce((sum, file) => sum + file.linesAdded, 0),
224
- linesRemoved: modifiedFiles.reduce((sum, file) => sum + file.linesRemoved, 0),
225
- totalChanges: modifiedFiles.reduce(
226
- (sum, file) => sum + file.linesAdded + file.linesRemoved,
227
- 0
228
- )
229
- };
230
- }
231
-
232
- /**
233
- * Filter files by extension
234
- * Useful for focusing reflection on specific file types
235
- *
236
- * @param modifiedFiles Array of GitDiffInfo objects
237
- * @param extensions Array of file extensions (e.g., ['.ts', '.js'])
238
- * @returns Filtered array of GitDiffInfo objects
239
- */
240
- export function filterFilesByExtension(
241
- modifiedFiles: GitDiffInfo[],
242
- extensions: string[]
243
- ): GitDiffInfo[] {
244
- return modifiedFiles.filter(file => {
245
- const ext = path.extname(file.file).toLowerCase();
246
- return extensions.some(allowedExt => ext === allowedExt.toLowerCase());
247
- });
248
- }
249
-
250
- /**
251
- * Exclude files matching patterns
252
- * Useful for excluding generated files, test files, etc.
253
- *
254
- * @param modifiedFiles Array of GitDiffInfo objects
255
- * @param patterns Array of glob patterns to exclude
256
- * @returns Filtered array of GitDiffInfo objects
257
- */
258
- export function excludeFilesByPattern(
259
- modifiedFiles: GitDiffInfo[],
260
- patterns: string[]
261
- ): GitDiffInfo[] {
262
- return modifiedFiles.filter(file => {
263
- return !patterns.some(pattern => {
264
- // Simple pattern matching (supports * wildcard)
265
- const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
266
- return regex.test(file.file);
267
- });
268
- });
269
- }
@@ -1,60 +0,0 @@
1
- /**
2
- * Translator Skill Invocation Utility
3
- *
4
- * Provides programmatic invocation of the translator skill for automated translation.
5
- * Used by hooks and CLI scripts to translate content without manual intervention.
6
- *
7
- * @see plugins/specweave/skills/translator/SKILL.md
8
- * @see plugins/specweave/commands/translate.md
9
- */
10
- import { type SupportedLanguage } from '../../../../src/utils/translation.js';
11
- /**
12
- * Translation result
13
- */
14
- export interface TranslationResult {
15
- success: boolean;
16
- sourceLanguage: SupportedLanguage;
17
- targetLanguage: SupportedLanguage;
18
- originalContent: string;
19
- translatedContent?: string;
20
- error?: string;
21
- }
22
- /**
23
- * Invokes translator skill to translate content
24
- *
25
- * This function integrates with the translator skill by:
26
- * 1. Preparing translation prompt
27
- * 2. Writing prompt to a temp file
28
- * 3. Outputting instructions for Claude to process
29
- * 4. Returning the translated content
30
- *
31
- * In an automated context (hooks), this provides clear instructions.
32
- * In an interactive context, the translator skill can auto-activate.
33
- *
34
- * @param content - Content to translate
35
- * @param sourceLang - Source language
36
- * @param targetLang - Target language
37
- * @returns Translation result
38
- */
39
- export declare function invokeTranslatorSkill(content: string, sourceLang: SupportedLanguage, targetLang?: SupportedLanguage): Promise<TranslationResult>;
40
- /**
41
- * Translate a file using translator skill
42
- *
43
- * @param filePath - Path to file to translate
44
- * @param targetLang - Target language
45
- * @returns Translation result
46
- */
47
- export declare function translateFile(filePath: string, targetLang?: SupportedLanguage): Promise<TranslationResult & {
48
- filePath: string;
49
- }>;
50
- /**
51
- * Batch translate multiple files
52
- *
53
- * @param filePaths - Array of file paths
54
- * @param targetLang - Target language
55
- * @returns Array of translation results
56
- */
57
- export declare function batchTranslateFiles(filePaths: string[], targetLang?: SupportedLanguage): Promise<Array<TranslationResult & {
58
- filePath: string;
59
- }>>;
60
- //# sourceMappingURL=invoke-translator-skill.d.ts.map
@@ -1,155 +0,0 @@
1
- import fs from "fs-extra";
2
- import {
3
- detectLanguage,
4
- prepareTranslation,
5
- postProcessTranslation,
6
- getLanguageName
7
- } from "../../../../dist/src/utils/translation.js";
8
- async function invokeTranslatorSkill(content, sourceLang, targetLang = "en") {
9
- try {
10
- const prepared = prepareTranslation(content, sourceLang, targetLang);
11
- const result = {
12
- success: true,
13
- sourceLanguage: sourceLang,
14
- targetLanguage: targetLang,
15
- originalContent: content,
16
- translatedContent: await performTranslation(prepared.prompt, prepared.preserved)
17
- };
18
- return result;
19
- } catch (error) {
20
- const errorMessage = error instanceof Error ? error.message : String(error);
21
- return {
22
- success: false,
23
- sourceLanguage: sourceLang,
24
- targetLanguage: targetLang,
25
- originalContent: content,
26
- error: errorMessage
27
- };
28
- }
29
- }
30
- async function performTranslation(prompt, preserved) {
31
- const contentMatch = prompt.match(/SOURCE DOCUMENT[^\n]*:\n---\n([\s\S]*?)\n---/);
32
- const contentToTranslate = contentMatch ? contentMatch[1] : "";
33
- const apiKey = process.env.ANTHROPIC_API_KEY;
34
- if (apiKey) {
35
- console.log(`
36
- \u{1F916} Translating via Anthropic API (Haiku model)...`);
37
- try {
38
- const Anthropic = await import("@anthropic-ai/sdk").then((m) => m.default);
39
- const anthropic = new Anthropic({
40
- apiKey
41
- });
42
- const message = await anthropic.messages.create({
43
- model: "claude-3-haiku-20240307",
44
- max_tokens: 8e3,
45
- messages: [
46
- {
47
- role: "user",
48
- content: prompt
49
- }
50
- ]
51
- });
52
- const translatedContent = message.content[0].type === "text" ? message.content[0].text : contentToTranslate;
53
- console.log(`\u2705 Translation complete via API`);
54
- console.log(` Input tokens: ${message.usage.input_tokens}`);
55
- console.log(` Output tokens: ${message.usage.output_tokens}`);
56
- console.log(` Cost: ~$${((message.usage.input_tokens * 0.25 + message.usage.output_tokens * 1.25) / 1e6).toFixed(4)}
57
- `);
58
- return postProcessTranslation(translatedContent, preserved);
59
- } catch (error) {
60
- console.error(`
61
- \u274C API translation failed: ${error.message}`);
62
- console.error(` Falling back to manual translation instructions
63
- `);
64
- }
65
- }
66
- const isInteractive = process.env.CLAUDE_CODE_SESSION === "true";
67
- if (isInteractive) {
68
- console.log("\n" + "=".repeat(80));
69
- console.log("\u{1F310} TRANSLATION REQUEST (translator skill will auto-activate)");
70
- console.log("=".repeat(80));
71
- console.log(prompt);
72
- console.log("=".repeat(80));
73
- console.log("\u{1F4A1} Tip: Set ANTHROPIC_API_KEY for fully automatic translation\n");
74
- return postProcessTranslation(
75
- `<!-- \u26A0\uFE0F TRANSLATION REQUESTED - Awaiting translator skill activation -->
76
-
77
- ${contentToTranslate}`,
78
- preserved
79
- );
80
- } else {
81
- console.error("\n\u26A0\uFE0F AUTO-TRANSLATION REQUIRES ONE OF:");
82
- console.error(" Option A (Recommended): Set ANTHROPIC_API_KEY environment variable");
83
- console.error(" Option B: Run /specweave:translate <file-path>");
84
- console.error(" Option C: Manually translate the content\n");
85
- return postProcessTranslation(
86
- `<!-- \u26A0\uFE0F AUTO-TRANSLATION PENDING -->
87
- <!-- Set ANTHROPIC_API_KEY for automatic translation -->
88
- <!-- Or run: /specweave:translate to complete -->
89
- <!-- Original content below -->
90
-
91
- ${contentToTranslate}`,
92
- preserved
93
- );
94
- }
95
- }
96
- async function translateFile(filePath, targetLang = "en") {
97
- if (!await fs.pathExists(filePath)) {
98
- throw new Error(`File not found: ${filePath}`);
99
- }
100
- const content = await fs.readFile(filePath, "utf-8");
101
- const detection = detectLanguage(content);
102
- const sourceLang = detection.language;
103
- if (sourceLang === targetLang) {
104
- return {
105
- success: true,
106
- filePath,
107
- sourceLanguage: sourceLang,
108
- targetLanguage: targetLang,
109
- originalContent: content,
110
- translatedContent: content
111
- };
112
- }
113
- const result = await invokeTranslatorSkill(content, sourceLang, targetLang);
114
- if (result.success && result.translatedContent) {
115
- await fs.writeFile(filePath, result.translatedContent, "utf-8");
116
- console.log(`\u2705 Translated: ${filePath} (${getLanguageName(sourceLang)} \u2192 ${getLanguageName(targetLang)})`);
117
- }
118
- return {
119
- ...result,
120
- filePath
121
- };
122
- }
123
- async function batchTranslateFiles(filePaths, targetLang = "en") {
124
- const results = [];
125
- console.log(`
126
- \u{1F310} Batch translating ${filePaths.length} file(s) to ${getLanguageName(targetLang)}...
127
- `);
128
- for (const filePath of filePaths) {
129
- try {
130
- const result = await translateFile(filePath, targetLang);
131
- results.push(result);
132
- } catch (error) {
133
- const errorMessage = error instanceof Error ? error.message : String(error);
134
- console.error(`\u274C Failed to translate ${filePath}: ${errorMessage}`);
135
- results.push({
136
- success: false,
137
- filePath,
138
- sourceLanguage: "unknown",
139
- targetLanguage: targetLang,
140
- originalContent: "",
141
- error: errorMessage
142
- });
143
- }
144
- }
145
- const successful = results.filter((r) => r.success).length;
146
- console.log(`
147
- \u{1F4CA} Batch translation complete: ${successful}/${filePaths.length} files translated
148
- `);
149
- return results;
150
- }
151
- export {
152
- batchTranslateFiles,
153
- invokeTranslatorSkill,
154
- translateFile
155
- };