@paths.design/caws-cli 10.1.0 → 11.0.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 (419) hide show
  1. package/README.md +125 -374
  2. package/dist/index.js +43 -756
  3. package/dist/shell/binding/resolve-binding.d.ts +4 -0
  4. package/dist/shell/binding/resolve-binding.d.ts.map +1 -0
  5. package/dist/shell/binding/resolve-binding.js +228 -0
  6. package/dist/shell/binding/resolve-binding.js.map +1 -0
  7. package/dist/shell/binding/types.d.ts +42 -0
  8. package/dist/shell/binding/types.d.ts.map +1 -0
  9. package/dist/shell/binding/types.js +21 -0
  10. package/dist/shell/binding/types.js.map +1 -0
  11. package/dist/shell/commands/claim.d.ts +14 -0
  12. package/dist/shell/commands/claim.d.ts.map +1 -0
  13. package/dist/shell/commands/claim.js +197 -0
  14. package/dist/shell/commands/claim.js.map +1 -0
  15. package/dist/shell/commands/doctor.d.ts +13 -0
  16. package/dist/shell/commands/doctor.d.ts.map +1 -0
  17. package/dist/shell/commands/doctor.js +97 -0
  18. package/dist/shell/commands/doctor.js.map +1 -0
  19. package/dist/shell/commands/evidence.d.ts +28 -0
  20. package/dist/shell/commands/evidence.d.ts.map +1 -0
  21. package/dist/shell/commands/evidence.js +166 -0
  22. package/dist/shell/commands/evidence.js.map +1 -0
  23. package/dist/shell/commands/gates.d.ts +19 -0
  24. package/dist/shell/commands/gates.d.ts.map +1 -0
  25. package/dist/shell/commands/gates.js +181 -0
  26. package/dist/shell/commands/gates.js.map +1 -0
  27. package/dist/shell/commands/init.d.ts +8 -0
  28. package/dist/shell/commands/init.d.ts.map +1 -0
  29. package/dist/shell/commands/init.js +64 -0
  30. package/dist/shell/commands/init.js.map +1 -0
  31. package/dist/shell/commands/scope.d.ts +11 -0
  32. package/dist/shell/commands/scope.d.ts.map +1 -0
  33. package/dist/shell/commands/scope.js +92 -0
  34. package/dist/shell/commands/scope.js.map +1 -0
  35. package/dist/shell/commands/status.d.ts +15 -0
  36. package/dist/shell/commands/status.d.ts.map +1 -0
  37. package/dist/shell/commands/status.js +106 -0
  38. package/dist/shell/commands/status.js.map +1 -0
  39. package/dist/shell/commands/waiver.d.ts +38 -0
  40. package/dist/shell/commands/waiver.d.ts.map +1 -0
  41. package/dist/shell/commands/waiver.js +240 -0
  42. package/dist/shell/commands/waiver.js.map +1 -0
  43. package/dist/shell/gates/disposition.d.ts +23 -0
  44. package/dist/shell/gates/disposition.d.ts.map +1 -0
  45. package/dist/shell/gates/disposition.js +87 -0
  46. package/dist/shell/gates/disposition.js.map +1 -0
  47. package/dist/shell/gates/gate-result-contract.d.ts +39 -0
  48. package/dist/shell/gates/gate-result-contract.d.ts.map +1 -0
  49. package/dist/shell/gates/gate-result-contract.js +150 -0
  50. package/dist/shell/gates/gate-result-contract.js.map +1 -0
  51. package/dist/shell/gates/quality-gates-adapter.d.ts +55 -0
  52. package/dist/shell/gates/quality-gates-adapter.d.ts.map +1 -0
  53. package/dist/shell/gates/quality-gates-adapter.js +161 -0
  54. package/dist/shell/gates/quality-gates-adapter.js.map +1 -0
  55. package/dist/shell/gates/waiver-filter.d.ts +58 -0
  56. package/dist/shell/gates/waiver-filter.d.ts.map +1 -0
  57. package/dist/shell/gates/waiver-filter.js +119 -0
  58. package/dist/shell/gates/waiver-filter.js.map +1 -0
  59. package/dist/shell/index.d.ts +50 -0
  60. package/dist/shell/index.d.ts.map +1 -0
  61. package/dist/shell/index.js +73 -0
  62. package/dist/shell/index.js.map +1 -0
  63. package/dist/shell/register.d.ts +11 -0
  64. package/dist/shell/register.d.ts.map +1 -0
  65. package/dist/shell/register.js +274 -0
  66. package/dist/shell/register.js.map +1 -0
  67. package/dist/shell/render/claim.d.ts +22 -0
  68. package/dist/shell/render/claim.d.ts.map +1 -0
  69. package/dist/shell/render/claim.js +75 -0
  70. package/dist/shell/render/claim.js.map +1 -0
  71. package/dist/shell/render/decision.d.ts +15 -0
  72. package/dist/shell/render/decision.d.ts.map +1 -0
  73. package/dist/shell/render/decision.js +66 -0
  74. package/dist/shell/render/decision.js.map +1 -0
  75. package/dist/shell/render/diagnostic.d.ts +19 -0
  76. package/dist/shell/render/diagnostic.d.ts.map +1 -0
  77. package/dist/shell/render/diagnostic.js +76 -0
  78. package/dist/shell/render/diagnostic.js.map +1 -0
  79. package/dist/shell/render/finding.d.ts +15 -0
  80. package/dist/shell/render/finding.d.ts.map +1 -0
  81. package/dist/shell/render/finding.js +57 -0
  82. package/dist/shell/render/finding.js.map +1 -0
  83. package/dist/shell/render/gates.d.ts +3 -0
  84. package/dist/shell/render/gates.d.ts.map +1 -0
  85. package/dist/shell/render/gates.js +56 -0
  86. package/dist/shell/render/gates.js.map +1 -0
  87. package/dist/shell/render/init.d.ts +11 -0
  88. package/dist/shell/render/init.d.ts.map +1 -0
  89. package/dist/shell/render/init.js +32 -0
  90. package/dist/shell/render/init.js.map +1 -0
  91. package/dist/shell/render/status.d.ts +26 -0
  92. package/dist/shell/render/status.d.ts.map +1 -0
  93. package/dist/shell/render/status.js +143 -0
  94. package/dist/shell/render/status.js.map +1 -0
  95. package/dist/shell/render/waiver.d.ts +21 -0
  96. package/dist/shell/render/waiver.d.ts.map +1 -0
  97. package/dist/shell/render/waiver.js +94 -0
  98. package/dist/shell/render/waiver.js.map +1 -0
  99. package/dist/shell/rules.d.ts +37 -0
  100. package/dist/shell/rules.d.ts.map +1 -0
  101. package/dist/shell/rules.js +51 -0
  102. package/dist/shell/rules.js.map +1 -0
  103. package/dist/shell/session/actor.d.ts +14 -0
  104. package/dist/shell/session/actor.d.ts.map +1 -0
  105. package/dist/shell/session/actor.js +34 -0
  106. package/dist/shell/session/actor.js.map +1 -0
  107. package/dist/shell/session/resolve-session.d.ts +5 -0
  108. package/dist/shell/session/resolve-session.d.ts.map +1 -0
  109. package/dist/shell/session/resolve-session.js +239 -0
  110. package/dist/shell/session/resolve-session.js.map +1 -0
  111. package/dist/shell/session/types.d.ts +56 -0
  112. package/dist/shell/session/types.d.ts.map +1 -0
  113. package/dist/shell/session/types.js +15 -0
  114. package/dist/shell/session/types.js.map +1 -0
  115. package/dist/store/agents-store.d.ts +3 -0
  116. package/dist/store/agents-store.d.ts.map +1 -0
  117. package/dist/store/agents-store.js +63 -0
  118. package/dist/store/agents-store.js.map +1 -0
  119. package/dist/store/apply-patch.d.ts +16 -0
  120. package/dist/store/apply-patch.d.ts.map +1 -0
  121. package/dist/store/apply-patch.js +191 -0
  122. package/dist/store/apply-patch.js.map +1 -0
  123. package/dist/store/atomic-write.d.ts +16 -0
  124. package/dist/store/atomic-write.d.ts.map +1 -0
  125. package/dist/store/atomic-write.js +132 -0
  126. package/dist/store/atomic-write.js.map +1 -0
  127. package/dist/store/doctor-snapshot.d.ts +20 -0
  128. package/dist/store/doctor-snapshot.d.ts.map +1 -0
  129. package/dist/store/doctor-snapshot.js +176 -0
  130. package/dist/store/doctor-snapshot.js.map +1 -0
  131. package/dist/store/events-store.d.ts +33 -0
  132. package/dist/store/events-store.d.ts.map +1 -0
  133. package/dist/store/events-store.js +297 -0
  134. package/dist/store/events-store.js.map +1 -0
  135. package/dist/store/index.d.ts +21 -0
  136. package/dist/store/index.d.ts.map +1 -0
  137. package/dist/store/index.js +47 -0
  138. package/dist/store/index.js.map +1 -0
  139. package/dist/store/init-store.d.ts +21 -0
  140. package/dist/store/init-store.d.ts.map +1 -0
  141. package/dist/store/init-store.js +295 -0
  142. package/dist/store/init-store.js.map +1 -0
  143. package/dist/store/json-store.d.ts +3 -0
  144. package/dist/store/json-store.d.ts.map +1 -0
  145. package/dist/store/json-store.js +65 -0
  146. package/dist/store/json-store.js.map +1 -0
  147. package/dist/store/policy-store.d.ts +3 -0
  148. package/dist/store/policy-store.d.ts.map +1 -0
  149. package/dist/store/policy-store.js +65 -0
  150. package/dist/store/policy-store.js.map +1 -0
  151. package/dist/store/repo-root.d.ts +46 -0
  152. package/dist/store/repo-root.d.ts.map +1 -0
  153. package/dist/store/repo-root.js +145 -0
  154. package/dist/store/repo-root.js.map +1 -0
  155. package/dist/store/rules.d.ts +53 -0
  156. package/dist/store/rules.d.ts.map +1 -0
  157. package/dist/store/rules.js +78 -0
  158. package/dist/store/rules.js.map +1 -0
  159. package/dist/store/specs-store.d.ts +3 -0
  160. package/dist/store/specs-store.d.ts.map +1 -0
  161. package/dist/store/specs-store.js +131 -0
  162. package/dist/store/specs-store.js.map +1 -0
  163. package/dist/store/types.d.ts +84 -0
  164. package/dist/store/types.d.ts.map +1 -0
  165. package/dist/store/types.js +14 -0
  166. package/dist/store/types.js.map +1 -0
  167. package/dist/store/waivers-store.d.ts +25 -0
  168. package/dist/store/waivers-store.d.ts.map +1 -0
  169. package/dist/store/waivers-store.js +232 -0
  170. package/dist/store/waivers-store.js.map +1 -0
  171. package/dist/store/worktrees-store.d.ts +3 -0
  172. package/dist/store/worktrees-store.d.ts.map +1 -0
  173. package/dist/store/worktrees-store.js +62 -0
  174. package/dist/store/worktrees-store.js.map +1 -0
  175. package/dist/store/yaml-store.d.ts +9 -0
  176. package/dist/store/yaml-store.d.ts.map +1 -0
  177. package/dist/store/yaml-store.js +121 -0
  178. package/dist/store/yaml-store.js.map +1 -0
  179. package/package.json +15 -13
  180. package/dist/budget-derivation.js +0 -751
  181. package/dist/cicd-optimizer.js +0 -504
  182. package/dist/commands/archive.js +0 -500
  183. package/dist/commands/burnup.js +0 -198
  184. package/dist/commands/diagnose.js +0 -525
  185. package/dist/commands/evaluate.js +0 -314
  186. package/dist/commands/gates.js +0 -149
  187. package/dist/commands/init.js +0 -857
  188. package/dist/commands/iterate.js +0 -417
  189. package/dist/commands/mode.js +0 -269
  190. package/dist/commands/parallel.js +0 -242
  191. package/dist/commands/plan.js +0 -438
  192. package/dist/commands/provenance.js +0 -1143
  193. package/dist/commands/quality-monitor.js +0 -284
  194. package/dist/commands/scope.js +0 -264
  195. package/dist/commands/session.js +0 -312
  196. package/dist/commands/sidecar.js +0 -74
  197. package/dist/commands/specs.js +0 -1448
  198. package/dist/commands/status.js +0 -1151
  199. package/dist/commands/templates.js +0 -237
  200. package/dist/commands/tool.js +0 -136
  201. package/dist/commands/tutorial.js +0 -480
  202. package/dist/commands/validate.js +0 -357
  203. package/dist/commands/verify-acs.js +0 -443
  204. package/dist/commands/waivers.js +0 -599
  205. package/dist/commands/workflow.js +0 -243
  206. package/dist/commands/worktree.js +0 -386
  207. package/dist/config/lite-scope.js +0 -158
  208. package/dist/config/modes.js +0 -347
  209. package/dist/constants/spec-types.js +0 -65
  210. package/dist/gates/budget-limit.js +0 -121
  211. package/dist/gates/feedback.js +0 -260
  212. package/dist/gates/format.js +0 -179
  213. package/dist/gates/god-object.js +0 -117
  214. package/dist/gates/pipeline.js +0 -167
  215. package/dist/gates/scope-boundary.js +0 -93
  216. package/dist/gates/spec-completeness.js +0 -109
  217. package/dist/gates/todo-detection.js +0 -205
  218. package/dist/generators/jest-config-generator.js +0 -242
  219. package/dist/generators/working-spec.js +0 -237
  220. package/dist/minimal-cli.js +0 -88
  221. package/dist/parallel/parallel-manager.js +0 -433
  222. package/dist/policy/PolicyManager.js +0 -465
  223. package/dist/scaffold/claude-hooks.js +0 -443
  224. package/dist/scaffold/cursor-hooks.js +0 -177
  225. package/dist/scaffold/git-hooks.js +0 -928
  226. package/dist/scaffold/index.js +0 -794
  227. package/dist/session/session-manager.js +0 -653
  228. package/dist/sidecars/index.js +0 -33
  229. package/dist/sidecars/listeners.js +0 -40
  230. package/dist/sidecars/provenance-summary.js +0 -238
  231. package/dist/sidecars/quality-gaps.js +0 -258
  232. package/dist/sidecars/schema.js +0 -149
  233. package/dist/sidecars/spec-drift.js +0 -151
  234. package/dist/sidecars/waiver-draft.js +0 -176
  235. package/dist/spec/SpecFileManager.js +0 -419
  236. package/dist/templates/.caws/schemas/policy.schema.json +0 -112
  237. package/dist/templates/.caws/schemas/scope.schema.json +0 -52
  238. package/dist/templates/.caws/schemas/waivers.schema.json +0 -106
  239. package/dist/templates/.caws/schemas/working-spec.schema.json +0 -340
  240. package/dist/templates/.caws/schemas/worktrees.schema.json +0 -38
  241. package/dist/templates/.caws/templates/working-spec.template.yml +0 -80
  242. package/dist/templates/.caws/tools/README.md +0 -18
  243. package/dist/templates/.caws/tools/scope-guard.js +0 -203
  244. package/dist/templates/.caws/tools-allow.json +0 -331
  245. package/dist/templates/.caws/waivers.yml +0 -19
  246. package/dist/templates/.claude/README.md +0 -190
  247. package/dist/templates/.claude/hooks/audit.sh +0 -121
  248. package/dist/templates/.claude/hooks/block-dangerous.sh +0 -203
  249. package/dist/templates/.claude/hooks/classify_command.py +0 -592
  250. package/dist/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  251. package/dist/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  252. package/dist/templates/.claude/hooks/naming-check.sh +0 -100
  253. package/dist/templates/.claude/hooks/protected-paths.sh +0 -39
  254. package/dist/templates/.claude/hooks/quality-check.sh +0 -81
  255. package/dist/templates/.claude/hooks/scan-secrets.sh +0 -85
  256. package/dist/templates/.claude/hooks/scope-guard.sh +0 -381
  257. package/dist/templates/.claude/hooks/session-caws-status.sh +0 -117
  258. package/dist/templates/.claude/hooks/session-log.sh +0 -634
  259. package/dist/templates/.claude/hooks/simplification-guard.sh +0 -92
  260. package/dist/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  261. package/dist/templates/.claude/hooks/test_classify_command.py +0 -370
  262. package/dist/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  263. package/dist/templates/.claude/hooks/validate-spec.sh +0 -76
  264. package/dist/templates/.claude/hooks/worktree-guard.sh +0 -220
  265. package/dist/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  266. package/dist/templates/.claude/rules/git-safety.md +0 -26
  267. package/dist/templates/.claude/rules/worktree-isolation.md +0 -83
  268. package/dist/templates/.claude/settings.json +0 -141
  269. package/dist/templates/.cursor/README.md +0 -299
  270. package/dist/templates/.cursor/hooks/audit.sh +0 -55
  271. package/dist/templates/.cursor/hooks/block-dangerous.sh +0 -84
  272. package/dist/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  273. package/dist/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  274. package/dist/templates/.cursor/hooks/format.sh +0 -38
  275. package/dist/templates/.cursor/hooks/naming-check.sh +0 -64
  276. package/dist/templates/.cursor/hooks/scan-secrets.sh +0 -51
  277. package/dist/templates/.cursor/hooks/scope-guard.sh +0 -52
  278. package/dist/templates/.cursor/hooks/session-log.sh +0 -924
  279. package/dist/templates/.cursor/hooks/validate-spec.sh +0 -83
  280. package/dist/templates/.cursor/hooks.json +0 -76
  281. package/dist/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  282. package/dist/templates/.cursor/rules/01-working-style.mdc +0 -50
  283. package/dist/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  284. package/dist/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  285. package/dist/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  286. package/dist/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  287. package/dist/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  288. package/dist/templates/.cursor/rules/07-process-ops.mdc +0 -20
  289. package/dist/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  290. package/dist/templates/.cursor/rules/09-docstrings.mdc +0 -89
  291. package/dist/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  292. package/dist/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  293. package/dist/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  294. package/dist/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  295. package/dist/templates/.cursor/rules/README.md +0 -148
  296. package/dist/templates/.github/copilot-instructions.md +0 -82
  297. package/dist/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  298. package/dist/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  299. package/dist/templates/.junie/guidelines.md +0 -73
  300. package/dist/templates/.vscode/launch.json +0 -17
  301. package/dist/templates/.vscode/settings.json +0 -95
  302. package/dist/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  303. package/dist/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  304. package/dist/templates/CLAUDE.md +0 -174
  305. package/dist/templates/COMMIT_CONVENTIONS.md +0 -86
  306. package/dist/templates/OIDC_SETUP.md +0 -300
  307. package/dist/templates/agents.md +0 -145
  308. package/dist/templates/codemod/README.md +0 -1
  309. package/dist/templates/codemod/test.js +0 -93
  310. package/dist/templates/docs/README.md +0 -151
  311. package/dist/templates/scripts/new_feature.sh +0 -80
  312. package/dist/templates/scripts/quality-gates/check-god-objects.js +0 -146
  313. package/dist/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  314. package/dist/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
  315. package/dist/test-analysis.js +0 -786
  316. package/dist/tool-interface.js +0 -314
  317. package/dist/tool-loader.js +0 -303
  318. package/dist/tool-validator.js +0 -393
  319. package/dist/utils/agent-session.js +0 -202
  320. package/dist/utils/async-utils.js +0 -188
  321. package/dist/utils/command-wrapper.js +0 -200
  322. package/dist/utils/event-log.js +0 -584
  323. package/dist/utils/event-renderer.js +0 -521
  324. package/dist/utils/finalization.js +0 -230
  325. package/dist/utils/git-lock.js +0 -119
  326. package/dist/utils/gitignore-updater.js +0 -158
  327. package/dist/utils/ide-detection.js +0 -133
  328. package/dist/utils/lifecycle-events.js +0 -94
  329. package/dist/utils/project-analysis.js +0 -367
  330. package/dist/utils/promise-utils.js +0 -72
  331. package/dist/utils/quality-gates-errors.js +0 -520
  332. package/dist/utils/quality-gates-utils.js +0 -387
  333. package/dist/utils/schema-validator.js +0 -50
  334. package/dist/utils/spec-resolver.js +0 -711
  335. package/dist/utils/typescript-detector.js +0 -369
  336. package/dist/utils/working-state.js +0 -530
  337. package/dist/utils/yaml-validation.js +0 -156
  338. package/dist/validation/spec-validation.js +0 -921
  339. package/dist/waivers-manager.js +0 -732
  340. package/dist/worktree/worktree-manager.js +0 -1374
  341. package/templates/.caws/schemas/policy.schema.json +0 -112
  342. package/templates/.caws/schemas/scope.schema.json +0 -52
  343. package/templates/.caws/schemas/waivers.schema.json +0 -106
  344. package/templates/.caws/schemas/working-spec.schema.json +0 -340
  345. package/templates/.caws/schemas/worktrees.schema.json +0 -38
  346. package/templates/.caws/templates/working-spec.template.yml +0 -80
  347. package/templates/.caws/tools/README.md +0 -18
  348. package/templates/.caws/tools/scope-guard.js +0 -203
  349. package/templates/.caws/tools-allow.json +0 -331
  350. package/templates/.caws/waivers.yml +0 -19
  351. package/templates/.claude/README.md +0 -190
  352. package/templates/.claude/hooks/audit.sh +0 -121
  353. package/templates/.claude/hooks/block-dangerous.sh +0 -203
  354. package/templates/.claude/hooks/classify_command.py +0 -592
  355. package/templates/.claude/hooks/doc-frontmatter-check.sh +0 -173
  356. package/templates/.claude/hooks/lite-sprawl-check.sh +0 -145
  357. package/templates/.claude/hooks/naming-check.sh +0 -100
  358. package/templates/.claude/hooks/protected-paths.sh +0 -39
  359. package/templates/.claude/hooks/quality-check.sh +0 -81
  360. package/templates/.claude/hooks/scan-secrets.sh +0 -85
  361. package/templates/.claude/hooks/scope-guard.sh +0 -381
  362. package/templates/.claude/hooks/session-caws-status.sh +0 -117
  363. package/templates/.claude/hooks/session-log.sh +0 -634
  364. package/templates/.claude/hooks/simplification-guard.sh +0 -92
  365. package/templates/.claude/hooks/stop-worktree-check.sh +0 -46
  366. package/templates/.claude/hooks/test_classify_command.py +0 -370
  367. package/templates/.claude/hooks/test_wrapper_smoke.sh +0 -96
  368. package/templates/.claude/hooks/validate-spec.sh +0 -76
  369. package/templates/.claude/hooks/worktree-guard.sh +0 -220
  370. package/templates/.claude/hooks/worktree-write-guard.sh +0 -190
  371. package/templates/.claude/rules/git-safety.md +0 -26
  372. package/templates/.claude/rules/worktree-isolation.md +0 -83
  373. package/templates/.claude/settings.json +0 -141
  374. package/templates/.cursor/README.md +0 -299
  375. package/templates/.cursor/hooks/audit.sh +0 -55
  376. package/templates/.cursor/hooks/block-dangerous.sh +0 -84
  377. package/templates/.cursor/hooks/caws-quality-check.sh +0 -52
  378. package/templates/.cursor/hooks/caws-scope-guard.sh +0 -130
  379. package/templates/.cursor/hooks/format.sh +0 -38
  380. package/templates/.cursor/hooks/naming-check.sh +0 -64
  381. package/templates/.cursor/hooks/scan-secrets.sh +0 -51
  382. package/templates/.cursor/hooks/scope-guard.sh +0 -52
  383. package/templates/.cursor/hooks/session-log.sh +0 -924
  384. package/templates/.cursor/hooks/validate-spec.sh +0 -83
  385. package/templates/.cursor/hooks.json +0 -76
  386. package/templates/.cursor/rules/00-claims-verification.mdc +0 -144
  387. package/templates/.cursor/rules/01-working-style.mdc +0 -50
  388. package/templates/.cursor/rules/02-quality-gates.mdc +0 -368
  389. package/templates/.cursor/rules/03-naming-and-refactor.mdc +0 -33
  390. package/templates/.cursor/rules/04-logging-language-style.mdc +0 -23
  391. package/templates/.cursor/rules/05-safe-defaults-guards.mdc +0 -23
  392. package/templates/.cursor/rules/06-typescript-conventions.mdc +0 -36
  393. package/templates/.cursor/rules/07-process-ops.mdc +0 -20
  394. package/templates/.cursor/rules/08-solid-and-architecture.mdc +0 -16
  395. package/templates/.cursor/rules/09-docstrings.mdc +0 -89
  396. package/templates/.cursor/rules/10-documentation-quality-standards.mdc +0 -385
  397. package/templates/.cursor/rules/11-scope-management-waivers.mdc +0 -381
  398. package/templates/.cursor/rules/12-implementation-completeness.mdc +0 -516
  399. package/templates/.cursor/rules/13-language-agnostic-standards.mdc +0 -578
  400. package/templates/.cursor/rules/README.md +0 -148
  401. package/templates/.github/copilot-instructions.md +0 -82
  402. package/templates/.idea/runConfigurations/CAWS_Evaluate.xml +0 -5
  403. package/templates/.idea/runConfigurations/CAWS_Validate.xml +0 -5
  404. package/templates/.junie/guidelines.md +0 -73
  405. package/templates/.vscode/launch.json +0 -17
  406. package/templates/.vscode/settings.json +0 -95
  407. package/templates/.windsurf/rules/caws-quality-standards.md +0 -54
  408. package/templates/.windsurf/workflows/caws-guided-development.md +0 -92
  409. package/templates/CLAUDE.md +0 -174
  410. package/templates/COMMIT_CONVENTIONS.md +0 -86
  411. package/templates/OIDC_SETUP.md +0 -300
  412. package/templates/agents.md +0 -145
  413. package/templates/codemod/README.md +0 -1
  414. package/templates/codemod/test.js +0 -93
  415. package/templates/docs/README.md +0 -151
  416. package/templates/scripts/new_feature.sh +0 -80
  417. package/templates/scripts/quality-gates/check-god-objects.js +0 -146
  418. package/templates/scripts/quality-gates/run-quality-gates.js +0 -50
  419. package/templates/scripts/v3/analysis/todo_analyzer.py +0 -1997
@@ -1,230 +0,0 @@
1
- /**
2
- * @fileoverview Project Finalization Utilities
3
- * Functions for finalizing CAWS project setup
4
- * @author @darianrosebrook
5
- */
6
-
7
- const fs = require('fs-extra');
8
- const path = require('path');
9
- const chalk = require('chalk');
10
-
11
- // CLI version from package.json
12
- const CLI_VERSION = require('../../package.json').version;
13
-
14
- // Import scaffold utilities
15
- const { scaffoldCursorHooks } = require('../scaffold/cursor-hooks');
16
-
17
- // Dependencies injected via setFinalizationDependencies()
18
- let languageSupport = null;
19
- let loadProvenanceTools = null;
20
-
21
- /**
22
- * Set dependencies for finalization utilities
23
- * @param {Object} deps - Dependencies object
24
- */
25
- function setFinalizationDependencies(deps) {
26
- languageSupport = deps.languageSupport;
27
- loadProvenanceTools = deps.loadProvenanceTools;
28
- }
29
-
30
- /**
31
- * Generate provenance manifest and git initialization (for both modes)
32
- * @param {string} projectName - Project name
33
- * @param {Object} options - Command options
34
- * @param {Object} answers - User answers
35
- */
36
- async function finalizeProject(projectName, options, answers) {
37
- try {
38
- // Detect and configure language support
39
- if (languageSupport) {
40
- console.log(chalk.cyan('Detecting project language...'));
41
- const detectedLanguage = languageSupport.detectProjectLanguage();
42
-
43
- if (detectedLanguage !== 'unknown') {
44
- console.log(chalk.green(`Detected language: ${detectedLanguage}`));
45
-
46
- // Generate language-specific configuration
47
- try {
48
- const langConfig = languageSupport.generateLanguageConfig(
49
- detectedLanguage,
50
- '.caws/language-config.json'
51
- );
52
-
53
- console.log(chalk.green('Generated language-specific configuration'));
54
- console.log(` Language: ${langConfig.name}`);
55
- console.log(` Tier: ${langConfig.tier}`);
56
- console.log(
57
- ` Thresholds: Branch ≥${langConfig.thresholds.min_branch * 100}%, Mutation ≥${langConfig.thresholds.min_mutation * 100}%`
58
- );
59
- } catch (langError) {
60
- console.warn(chalk.yellow('Could not generate language config:'), langError.message);
61
- }
62
- } else {
63
- console.log(
64
- chalk.blue('Could not detect project language - using default configuration')
65
- );
66
- }
67
- }
68
-
69
- // Setup Cursor hooks if enabled
70
- if (answers && answers.enableCursorHooks) {
71
- console.log(chalk.cyan('Setting up Cursor hooks...'));
72
- await scaffoldCursorHooks(
73
- process.cwd(),
74
- answers.cursorHookLevels || ['safety', 'quality', 'scope', 'audit']
75
- );
76
- }
77
-
78
- // Generate provenance manifest
79
- console.log(chalk.cyan('Generating provenance manifest...'));
80
-
81
- const provenanceData = {
82
- agent: 'caws-cli',
83
- model: 'cli-interactive',
84
- modelHash: CLI_VERSION,
85
- toolAllowlist: [
86
- 'node',
87
- 'npm',
88
- 'git',
89
- 'fs-extra',
90
- 'inquirer',
91
- 'commander',
92
- 'js-yaml',
93
- 'ajv',
94
- 'chalk',
95
- ],
96
- prompts: Object.keys(answers),
97
- commit: null, // Will be set after git init
98
- artifacts: ['.caws/specs/', '.caws/working-spec.yaml'],
99
- results: {
100
- project_id: answers.projectId,
101
- project_title: answers.projectTitle,
102
- risk_tier: answers.riskTier,
103
- mode: answers.projectMode,
104
- change_budget: {
105
- max_files: answers.maxFiles,
106
- max_loc: answers.maxLoc,
107
- },
108
- },
109
- approvals: [],
110
- };
111
-
112
- // Generate provenance if tools are available
113
- const tools = loadProvenanceTools && loadProvenanceTools();
114
- if (
115
- tools &&
116
- typeof tools.generateProvenance === 'function' &&
117
- typeof tools.saveProvenance === 'function'
118
- ) {
119
- const provenance = tools.generateProvenance(provenanceData);
120
- await tools.saveProvenance(provenance, '.agent/provenance.json');
121
- console.log(chalk.green('Provenance manifest generated'));
122
- } else {
123
- console.log(
124
- chalk.yellow('Provenance tools not available - skipping manifest generation')
125
- );
126
- }
127
-
128
- // Initialize git repository
129
- if (options.git) {
130
- try {
131
- console.log(chalk.cyan('Initializing git repository...'));
132
-
133
- // Check if git is available
134
- try {
135
- require('child_process').execSync('git --version', { stdio: 'ignore' });
136
- } catch (error) {
137
- console.warn(chalk.yellow('Git not found. Skipping git initialization.'));
138
- console.warn(chalk.blue('Install git to enable automatic repository setup.'));
139
- return;
140
- }
141
-
142
- // Configure git author information
143
- const gitConfig = answers.git_config || {};
144
- const authorName = process.env.GIT_AUTHOR_NAME || gitConfig.author_name;
145
- const authorEmail = process.env.GIT_AUTHOR_EMAIL || gitConfig.author_email;
146
-
147
- if (authorName && authorEmail) {
148
- require('child_process').execSync(`git config user.name "${authorName}"`, {
149
- stdio: 'inherit',
150
- });
151
- require('child_process').execSync(`git config user.email "${authorEmail}"`, {
152
- stdio: 'inherit',
153
- });
154
- console.log(chalk.green(`Git configured: ${authorName} <${authorEmail}>`));
155
- }
156
-
157
- require('child_process').execSync('git init', { stdio: 'inherit' });
158
- require('child_process').execSync('git add .', { stdio: 'inherit' });
159
- require('child_process').execSync('git commit -m "Initial CAWS project setup"', {
160
- stdio: 'inherit',
161
- });
162
- console.log(chalk.green('Git repository initialized'));
163
-
164
- // Update provenance with commit hash
165
- const commitHash = require('child_process')
166
- .execSync('git rev-parse HEAD', { encoding: 'utf8' })
167
- .trim();
168
- const currentProvenance = JSON.parse(fs.readFileSync('.agent/provenance.json', 'utf8'));
169
- currentProvenance.commit = commitHash;
170
- currentProvenance.hash = require('crypto')
171
- .createHash('sha256')
172
- .update(JSON.stringify(currentProvenance, Object.keys(currentProvenance).sort()))
173
- .digest('hex');
174
- await fs.writeFile('.agent/provenance.json', JSON.stringify(currentProvenance, null, 2));
175
-
176
- console.log(chalk.green('Provenance updated with commit hash'));
177
- } catch (error) {
178
- console.warn(
179
- chalk.yellow('Failed to initialize git repository:'),
180
- error?.message || String(error)
181
- );
182
- console.warn(chalk.blue('You can initialize git manually later with:'));
183
- console.warn(" git init && git add . && git commit -m 'Initial CAWS project setup'");
184
- }
185
- }
186
- } catch (error) {
187
- console.error(
188
- chalk.red('Error during project finalization:'),
189
- error?.message || String(error)
190
- );
191
- }
192
- }
193
-
194
- /**
195
- * Display success message after project initialization
196
- */
197
- function continueToSuccess() {
198
- const isCurrentDir =
199
- process.cwd() ===
200
- path.resolve(process.argv[3] === '.' ? process.cwd() : process.argv[3] || 'caws-project');
201
-
202
- console.log(chalk.green('\nCAWS project initialized successfully!'));
203
-
204
- if (isCurrentDir) {
205
- console.log(
206
- `${chalk.cyan('Initialized in current directory')}: ${path.resolve(process.cwd())}`
207
- );
208
- console.log(chalk.gray(' (CAWS files added to your existing project)'));
209
- } else {
210
- console.log(`${chalk.cyan('Project location')}: ${path.resolve(process.cwd())}`);
211
- console.log(chalk.gray(' (New subdirectory created with CAWS structure)'));
212
- }
213
-
214
- console.log(chalk.bold('\nNext steps:'));
215
- console.log('1. Customize .caws/specs/<spec-id>.yaml');
216
- console.log('2. Treat .caws/working-spec.yaml as a compatibility mirror');
217
- console.log('3. Review added CAWS tools and documentation');
218
- if (!isCurrentDir) {
219
- console.log('4. Move CAWS files to your main project if needed');
220
- }
221
- console.log('5. npm install (if using Node.js)');
222
- console.log('6. Set up your CI/CD pipeline');
223
- console.log(chalk.blue('\nFor help: caws --help'));
224
- }
225
-
226
- module.exports = {
227
- finalizeProject,
228
- continueToSuccess,
229
- setFinalizationDependencies,
230
- };
@@ -1,119 +0,0 @@
1
- /**
2
- * @fileoverview Git Lock Detection Utilities
3
- * Functions for detecting and handling git locks
4
- * @author @darianrosebrook
5
- */
6
-
7
- const fs = require('fs-extra');
8
- const path = require('path');
9
-
10
- /**
11
- * Check for git lock files
12
- * @param {string} projectRoot - Project root directory
13
- * @returns {Object} Lock status information
14
- */
15
- function checkGitLock(projectRoot) {
16
- const lockFile = path.join(projectRoot, '.git', 'index.lock');
17
- const headLockFile = path.join(projectRoot, '.git', 'HEAD.lock');
18
-
19
- const result = {
20
- locked: false,
21
- stale: false,
22
- lockFiles: [],
23
- message: null,
24
- suggestion: null,
25
- };
26
-
27
- // Check index.lock
28
- if (fs.existsSync(lockFile)) {
29
- const lockAge = Date.now() - fs.statSync(lockFile).mtimeMs;
30
- const lockAgeMinutes = Math.floor(lockAge / 60000);
31
-
32
- result.locked = true;
33
- result.lockFiles.push({
34
- path: '.git/index.lock',
35
- age: lockAgeMinutes,
36
- stale: lockAgeMinutes > 5,
37
- });
38
-
39
- if (lockAgeMinutes > 5) {
40
- // Stale lock (older than 5 minutes)
41
- result.stale = true;
42
- result.message = `Stale git lock detected (${lockAgeMinutes} minutes old). This may indicate a crashed git process.`;
43
- result.suggestion = 'Remove stale lock: rm .git/index.lock';
44
- } else {
45
- // Active lock
46
- result.message =
47
- 'Git lock detected. Another git process may be running.';
48
- result.suggestion =
49
- 'Wait for the other process to complete, or check for running git/editor processes';
50
- }
51
- }
52
-
53
- // Check HEAD.lock
54
- if (fs.existsSync(headLockFile)) {
55
- const lockAge = Date.now() - fs.statSync(headLockFile).mtimeMs;
56
- const lockAgeMinutes = Math.floor(lockAge / 60000);
57
-
58
- result.locked = true;
59
- result.lockFiles.push({
60
- path: '.git/HEAD.lock',
61
- age: lockAgeMinutes,
62
- stale: lockAgeMinutes > 5,
63
- });
64
-
65
- if (lockAgeMinutes > 5) {
66
- result.stale = true;
67
- if (!result.message) {
68
- result.message = `Stale git lock detected (${lockAgeMinutes} minutes old).`;
69
- result.suggestion = 'Remove stale lock: rm .git/HEAD.lock';
70
- }
71
- }
72
- }
73
-
74
- return result;
75
- }
76
-
77
- /**
78
- * Format git lock error message
79
- * @param {Object} lockStatus - Lock status from checkGitLock
80
- * @returns {string} Formatted error message
81
- */
82
- function formatGitLockError(lockStatus) {
83
- if (!lockStatus.locked) {
84
- return null;
85
- }
86
-
87
- let message = 'Git lock detected\n';
88
- message += ` ${lockStatus.message}\n`;
89
-
90
- if (lockStatus.lockFiles.length > 0) {
91
- message += '\n Lock files:\n';
92
- for (const lockFile of lockStatus.lockFiles) {
93
- message += ` - ${lockFile.path} (${lockFile.age} minutes old)`;
94
- if (lockFile.stale) {
95
- message += ' [STALE]';
96
- }
97
- message += '\n';
98
- }
99
- }
100
-
101
- if (lockStatus.suggestion) {
102
- message += `\n ${lockStatus.suggestion}\n`;
103
- }
104
-
105
- if (lockStatus.stale) {
106
- message +=
107
- '\n Warning: Removing stale locks may cause data loss if another process is actually running.\n';
108
- message += ' Check for running git/editor processes before removing locks.\n';
109
- }
110
-
111
- return message;
112
- }
113
-
114
- module.exports = {
115
- checkGitLock,
116
- formatGitLockError,
117
- };
118
-
119
-
@@ -1,158 +0,0 @@
1
- /**
2
- * @fileoverview Gitignore Updater Utility
3
- * Updates .gitignore to properly handle CAWS runtime files vs source files
4
- * @author @darianrosebrook
5
- */
6
-
7
- const fs = require('fs-extra');
8
- const path = require('path');
9
- const chalk = require('chalk');
10
-
11
- /**
12
- * CAWS .gitignore entries
13
- *
14
- * Strategy: Track shared/collaborative files, ignore local-only runtime data
15
- *
16
- * TRACKED (shared with team):
17
- * - .caws/working-spec.yaml (main spec)
18
- * - .caws/specs/*.yaml (feature specs)
19
- * - .caws/policy.yaml (team policy)
20
- * - .caws/waivers/*.yaml (project-wide waivers)
21
- * - .caws/provenance/ (audit trails for compliance)
22
- * - .caws/changes/ (change tracking for team visibility)
23
- * - .caws/archive/ (archived changes for history)
24
- * - .caws/plans/*.md (implementation plans)
25
- *
26
- * IGNORED (local-only):
27
- * - .agent/ (agent runtime tracking, local to each developer)
28
- * - Temporary files (*.tmp, *.bak)
29
- * - Logs (caws.log, debug logs)
30
- * - Local overrides (caws.local.*)
31
- */
32
- const CAWS_GITIGNORE_ENTRIES = `
33
- # CAWS Local Runtime Data (developer-specific, should not be tracked)
34
- # ====================================================================
35
- # Note: Specs, policy, waivers, provenance, and plans ARE tracked for team collaboration
36
- # Only local agent tracking, generated tools, and temporary files are ignored
37
-
38
- # Agent runtime tracking (local to each developer)
39
- .agent/
40
-
41
- # CAWS tools (now in .caws/tools/)
42
- .caws/tools/
43
- # Legacy location (for backward compatibility)
44
- apps/tools/caws/
45
-
46
- # Temporary CAWS files
47
- **/*.caws.tmp
48
- **/*.working-spec.bak
49
- .caws/*.tmp
50
- .caws/*.bak
51
-
52
- # CAWS logs (local debugging)
53
- caws-debug.log*
54
- **/caws.log
55
- .caws/*.log
56
-
57
- # Local development overrides (developer-specific)
58
- caws.local.*
59
- .caws/local.*
60
-
61
- # CAWS working state (runtime, not committed)
62
- .caws/state/
63
-
64
- # CAWS Worktrees (local, should not be tracked)
65
- .caws/worktrees/
66
- .caws/worktrees.json
67
-
68
- # Session transcripts (generated by session-log hook)
69
- tmp/
70
- `;
71
-
72
- /**
73
- * Update .gitignore to include CAWS runtime file exclusions
74
- * @param {string} projectRoot - Project root directory
75
- * @param {Object} options - Options
76
- * @param {boolean} options.force - Force update even if entries exist
77
- * @returns {Promise<boolean>} Whether .gitignore was updated
78
- */
79
- async function updateGitignore(projectRoot, options = {}) {
80
- const { force = false } = options;
81
- const gitignorePath = path.join(projectRoot, '.gitignore');
82
-
83
- try {
84
- // Read existing .gitignore or create empty
85
- let existingContent = '';
86
- if (await fs.pathExists(gitignorePath)) {
87
- existingContent = await fs.readFile(gitignorePath, 'utf8');
88
- }
89
-
90
- // Check if CAWS entries already exist (check for either old or new header)
91
- const hasCawsEntries =
92
- existingContent.includes('# CAWS Local Runtime Data') ||
93
- existingContent.includes('# CAWS Runtime Data');
94
-
95
- if (hasCawsEntries && !force) {
96
- // Already has CAWS entries, skip
97
- return false;
98
- }
99
-
100
- // If old entries exist, replace them with new ones
101
- if (existingContent.includes('# CAWS Runtime Data') && force) {
102
- // Remove old CAWS entries (between "# CAWS Runtime Data" and next major section)
103
- const lines = existingContent.split('\n');
104
- const startIndex = lines.findIndex((line) => line.includes('# CAWS Runtime Data'));
105
- if (startIndex !== -1) {
106
- // Find the end of CAWS section (next major section starting with #)
107
- let endIndex = startIndex + 1;
108
- while (
109
- endIndex < lines.length &&
110
- (lines[endIndex].trim() === '' ||
111
- lines[endIndex].startsWith('#') ||
112
- lines[endIndex].startsWith('.caws/') ||
113
- lines[endIndex].startsWith('.agent/') ||
114
- lines[endIndex].includes('caws') ||
115
- lines[endIndex].includes('CAWS'))
116
- ) {
117
- endIndex++;
118
- }
119
- // Remove old section and insert new one
120
- const before = lines.slice(0, startIndex).join('\n');
121
- const after = lines.slice(endIndex).join('\n');
122
- existingContent = [before, after].filter(Boolean).join('\n');
123
- }
124
- }
125
-
126
- // Append CAWS entries
127
- const updatedContent = existingContent.trim() + '\n' + CAWS_GITIGNORE_ENTRIES.trim() + '\n';
128
-
129
- await fs.writeFile(gitignorePath, updatedContent, 'utf8');
130
-
131
- return true;
132
- } catch (error) {
133
- console.warn(chalk.yellow(`Could not update .gitignore: ${error.message}`));
134
- return false;
135
- }
136
- }
137
-
138
- /**
139
- * Verify .gitignore has proper CAWS entries
140
- * @param {string} projectRoot - Project root directory
141
- * @returns {Promise<boolean>} Whether .gitignore has CAWS entries
142
- */
143
- async function verifyGitignore(projectRoot) {
144
- const gitignorePath = path.join(projectRoot, '.gitignore');
145
-
146
- if (!(await fs.pathExists(gitignorePath))) {
147
- return false;
148
- }
149
-
150
- const content = await fs.readFile(gitignorePath, 'utf8');
151
- return content.includes('# CAWS Local Runtime Data') || content.includes('# CAWS Runtime Data');
152
- }
153
-
154
- module.exports = {
155
- updateGitignore,
156
- verifyGitignore,
157
- CAWS_GITIGNORE_ENTRIES,
158
- };
@@ -1,133 +0,0 @@
1
- /**
2
- * @fileoverview IDE Detection and Selection Utilities
3
- * Detects active IDEs from environment variables and provides
4
- * selection/parsing helpers for the --ide CLI flag.
5
- * @author @darianrosebrook
6
- */
7
-
8
- const chalk = require('chalk');
9
-
10
- /**
11
- * Registry of supported IDE integrations.
12
- * Each entry maps an ID to its display name, description, and detection env vars.
13
- */
14
- const IDE_REGISTRY = {
15
- cursor: {
16
- id: 'cursor',
17
- name: 'Cursor',
18
- description: 'AI-first IDE with hooks, rules, and audit logs',
19
- envVars: ['CURSOR_TRACE_DIR'],
20
- },
21
- claude: {
22
- id: 'claude',
23
- name: 'Claude Code',
24
- description: 'Claude Code with safety hooks and settings',
25
- envVars: ['CLAUDE_PROJECT_DIR'],
26
- },
27
- vscode: {
28
- id: 'vscode',
29
- name: 'VS Code',
30
- description: 'Visual Studio Code settings and debug configs',
31
- envVars: ['VSCODE_PID', 'VSCODE_IPC_HOOK'],
32
- },
33
- intellij: {
34
- id: 'intellij',
35
- name: 'IntelliJ IDEA',
36
- description: 'IntelliJ run configurations for CAWS',
37
- envVars: ['IDEA_INITIAL_DIRECTORY'],
38
- },
39
- windsurf: {
40
- id: 'windsurf',
41
- name: 'Windsurf',
42
- description: 'Windsurf workflow for CAWS-guided development',
43
- envVars: ['WINDSURF_WORKSPACE'],
44
- },
45
- copilot: {
46
- id: 'copilot',
47
- name: 'GitHub Copilot',
48
- description: 'GitHub Copilot CAWS integration instructions',
49
- envVars: [], // No reliable env var; paired with vscode
50
- },
51
- junie: {
52
- id: 'junie',
53
- name: 'JetBrains Junie',
54
- description: 'Junie AI agent guidelines for JetBrains IDEs',
55
- envVars: [], // Paired with intellij
56
- },
57
- };
58
-
59
- const ALL_IDE_IDS = Object.keys(IDE_REGISTRY);
60
-
61
- /**
62
- * Detect currently active IDEs from environment variables.
63
- * @returns {string[]} Array of detected IDE identifiers
64
- */
65
- function detectActiveIDEs() {
66
- const detected = [];
67
- for (const [id, config] of Object.entries(IDE_REGISTRY)) {
68
- if (config.envVars.length > 0 && config.envVars.some((v) => process.env[v])) {
69
- detected.push(id);
70
- }
71
- }
72
- return detected;
73
- }
74
-
75
- /**
76
- * Get recommended IDE set based on detection and natural pairings.
77
- * - Cursor detected -> also recommend Claude Code
78
- * - VS Code detected -> also recommend Copilot
79
- * - Nothing detected -> default to cursor + claude (AI-first set)
80
- * @returns {string[]} Array of recommended IDE identifiers
81
- */
82
- function getRecommendedIDEs() {
83
- const detected = detectActiveIDEs();
84
-
85
- if (detected.length > 0) {
86
- const recommended = new Set(detected);
87
- if (detected.includes('cursor')) recommended.add('claude');
88
- if (detected.includes('vscode')) recommended.add('copilot');
89
- if (detected.includes('intellij')) recommended.add('junie');
90
- return Array.from(recommended);
91
- }
92
-
93
- return ['cursor', 'claude'];
94
- }
95
-
96
- /**
97
- * Parse an IDE selection from a CLI flag value or prompt answer.
98
- * @param {string|string[]} input - Comma-separated string or array of IDE ids
99
- * @returns {string[]} Normalized, validated array of IDE identifiers
100
- */
101
- function parseIDESelection(input) {
102
- if (!input) return [];
103
-
104
- let ids;
105
- if (typeof input === 'string') {
106
- ids = input.split(',').map((s) => s.trim().toLowerCase()).filter(Boolean);
107
- } else if (Array.isArray(input)) {
108
- ids = input.map((s) => String(s).trim().toLowerCase()).filter(Boolean);
109
- } else {
110
- return [];
111
- }
112
-
113
- if (ids.includes('all')) return [...ALL_IDE_IDS];
114
- if (ids.includes('none')) return [];
115
-
116
- const valid = ids.filter((id) => id in IDE_REGISTRY);
117
- const invalid = ids.filter((id) => !(id in IDE_REGISTRY));
118
-
119
- if (invalid.length > 0) {
120
- console.warn(chalk.yellow(`Warning: Unknown IDE identifiers: ${invalid.join(', ')}`));
121
- console.warn(chalk.blue(`Valid options: ${ALL_IDE_IDS.join(', ')}, all, none`));
122
- }
123
-
124
- return valid;
125
- }
126
-
127
- module.exports = {
128
- IDE_REGISTRY,
129
- ALL_IDE_IDS,
130
- detectActiveIDEs,
131
- getRecommendedIDEs,
132
- parseIDESelection,
133
- };