@codemcp/workflows 5.3.0 → 6.0.1

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 (451) hide show
  1. package/README.md +91 -0
  2. package/package.json +77 -17
  3. package/packages/cli/dist/chunk-R5U7XKVJ.js +16 -0
  4. package/packages/cli/dist/chunk-RTDQR2KY.js +6718 -0
  5. package/packages/cli/dist/cli-CZ4FMSWR.js +1421 -0
  6. package/packages/cli/dist/dist-KZOA4GL5.js +65 -0
  7. package/packages/cli/dist/dist-UGVUJIDN.js +14475 -0
  8. package/packages/cli/dist/index.js +21 -0
  9. package/packages/cli/package.json +28 -0
  10. package/packages/core/dist/beads-integration.d.ts +50 -0
  11. package/packages/core/dist/beads-integration.js +387 -0
  12. package/packages/core/dist/beads-integration.js.map +1 -0
  13. package/packages/core/dist/beads-state-manager.d.ts +58 -0
  14. package/packages/core/dist/beads-state-manager.js +212 -0
  15. package/packages/core/dist/beads-state-manager.js.map +1 -0
  16. package/packages/core/dist/config-manager.d.ts +24 -0
  17. package/packages/core/dist/config-manager.js +68 -0
  18. package/packages/core/dist/config-manager.js.map +1 -0
  19. package/packages/core/dist/conversation-manager.d.ts +98 -0
  20. package/packages/core/dist/conversation-manager.js +382 -0
  21. package/packages/core/dist/conversation-manager.js.map +1 -0
  22. package/packages/core/dist/file-detection-manager.d.ts +53 -0
  23. package/packages/core/dist/file-detection-manager.js +221 -0
  24. package/packages/core/dist/file-detection-manager.js.map +1 -0
  25. package/packages/core/dist/file-storage.d.ts +93 -0
  26. package/packages/core/dist/file-storage.js +301 -0
  27. package/packages/core/dist/file-storage.js.map +1 -0
  28. package/packages/core/dist/git-manager.d.ts +22 -0
  29. package/packages/core/dist/git-manager.js +123 -0
  30. package/packages/core/dist/git-manager.js.map +1 -0
  31. package/packages/core/dist/index.d.ts +24 -0
  32. package/packages/core/dist/index.js +31 -0
  33. package/packages/core/dist/index.js.map +1 -0
  34. package/packages/core/dist/instruction-generator.d.ts +40 -0
  35. package/packages/core/dist/instruction-generator.js +89 -0
  36. package/packages/core/dist/instruction-generator.js.map +1 -0
  37. package/packages/core/dist/interaction-logger.d.ts +37 -0
  38. package/packages/core/dist/interaction-logger.js +87 -0
  39. package/packages/core/dist/interaction-logger.js.map +1 -0
  40. package/packages/core/dist/interfaces/index.d.ts +9 -0
  41. package/packages/core/dist/interfaces/index.js +10 -0
  42. package/packages/core/dist/interfaces/index.js.map +1 -0
  43. package/packages/core/dist/interfaces/instruction-generator.interface.d.ts +41 -0
  44. package/packages/core/dist/interfaces/instruction-generator.interface.js +8 -0
  45. package/packages/core/dist/interfaces/instruction-generator.interface.js.map +1 -0
  46. package/packages/core/dist/interfaces/plan-manager.interface.d.ts +55 -0
  47. package/packages/core/dist/interfaces/plan-manager.interface.js +8 -0
  48. package/packages/core/dist/interfaces/plan-manager.interface.js.map +1 -0
  49. package/packages/core/dist/interfaces/task-backend-client.interface.d.ts +52 -0
  50. package/packages/core/dist/interfaces/task-backend-client.interface.js +8 -0
  51. package/packages/core/dist/interfaces/task-backend-client.interface.js.map +1 -0
  52. package/packages/core/dist/logger.d.ts +64 -0
  53. package/packages/core/dist/logger.js +283 -0
  54. package/packages/core/dist/logger.js.map +1 -0
  55. package/packages/core/dist/path-validation-utils.d.ts +75 -0
  56. package/packages/core/dist/path-validation-utils.js +238 -0
  57. package/packages/core/dist/path-validation-utils.js.map +1 -0
  58. package/packages/core/dist/persistence-interface.d.ts +91 -0
  59. package/packages/core/dist/persistence-interface.js +9 -0
  60. package/packages/core/dist/persistence-interface.js.map +1 -0
  61. package/{dist/components/beads/beads-plan-manager.d.ts → packages/core/dist/plan-manager.d.ts} +15 -15
  62. package/{dist/components/beads/beads-plan-manager.js → packages/core/dist/plan-manager.js} +66 -50
  63. package/packages/core/dist/plan-manager.js.map +1 -0
  64. package/packages/core/dist/project-docs-manager.d.ts +119 -0
  65. package/packages/core/dist/project-docs-manager.js +366 -0
  66. package/packages/core/dist/project-docs-manager.js.map +1 -0
  67. package/packages/core/dist/state-machine-loader.d.ts +61 -0
  68. package/packages/core/dist/state-machine-loader.js +273 -0
  69. package/packages/core/dist/state-machine-loader.js.map +1 -0
  70. package/packages/core/dist/state-machine-types.d.ts +64 -0
  71. package/packages/core/dist/state-machine-types.js +7 -0
  72. package/packages/core/dist/state-machine-types.js.map +1 -0
  73. package/packages/core/dist/state-machine.d.ts +52 -0
  74. package/packages/core/dist/state-machine.js +256 -0
  75. package/packages/core/dist/state-machine.js.map +1 -0
  76. package/packages/core/dist/system-prompt-generator.d.ts +14 -0
  77. package/packages/core/dist/system-prompt-generator.js +42 -0
  78. package/packages/core/dist/system-prompt-generator.js.map +1 -0
  79. package/packages/core/dist/task-backend.d.ts +45 -0
  80. package/packages/core/dist/task-backend.js +176 -0
  81. package/packages/core/dist/task-backend.js.map +1 -0
  82. package/packages/core/dist/template-manager.d.ts +61 -0
  83. package/packages/core/dist/template-manager.js +231 -0
  84. package/packages/core/dist/template-manager.js.map +1 -0
  85. package/packages/core/dist/transition-engine.d.ts +77 -0
  86. package/packages/core/dist/transition-engine.js +244 -0
  87. package/packages/core/dist/transition-engine.js.map +1 -0
  88. package/packages/core/dist/types.d.ts +54 -0
  89. package/packages/core/dist/types.js +5 -0
  90. package/packages/core/dist/workflow-manager.d.ts +89 -0
  91. package/packages/core/dist/workflow-manager.js +468 -0
  92. package/packages/core/dist/workflow-manager.js.map +1 -0
  93. package/packages/core/package.json +33 -0
  94. package/packages/docs/.vitepress/dist/.gitignore +2 -0
  95. package/packages/docs/.vitepress/dist/404.html +23 -0
  96. package/packages/docs/.vitepress/dist/assets/app.Dz3lZH3M.js +1 -0
  97. package/packages/docs/.vitepress/dist/assets/chunks/framework.DZS7lpav.js +19 -0
  98. package/packages/docs/.vitepress/dist/assets/chunks/theme.q5Ewb3F1.js +206 -0
  99. package/packages/docs/.vitepress/dist/assets/dev_ARCHITECTURE.md.da_vFDwM.js +130 -0
  100. package/packages/docs/.vitepress/dist/assets/dev_ARCHITECTURE.md.da_vFDwM.lean.js +1 -0
  101. package/packages/docs/.vitepress/dist/assets/dev_DEVELOPMENT.md.DWl9cccE.js +72 -0
  102. package/packages/docs/.vitepress/dist/assets/dev_DEVELOPMENT.md.DWl9cccE.lean.js +1 -0
  103. package/packages/docs/.vitepress/dist/assets/dev_LOGGING.md.BebvbW7z.js +34 -0
  104. package/packages/docs/.vitepress/dist/assets/dev_LOGGING.md.BebvbW7z.lean.js +1 -0
  105. package/packages/docs/.vitepress/dist/assets/dev_PUBLISHING.md.CQqbiIOF.js +1 -0
  106. package/packages/docs/.vitepress/dist/assets/dev_PUBLISHING.md.CQqbiIOF.lean.js +1 -0
  107. package/packages/docs/.vitepress/dist/assets/index.md.D6ROLohf.js +2 -0
  108. package/packages/docs/.vitepress/dist/assets/index.md.D6ROLohf.lean.js +1 -0
  109. package/packages/docs/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
  110. package/packages/docs/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
  111. package/packages/docs/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
  112. package/packages/docs/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
  113. package/packages/docs/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
  114. package/packages/docs/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
  115. package/packages/docs/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
  116. package/packages/docs/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
  117. package/packages/docs/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
  118. package/packages/docs/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
  119. package/packages/docs/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
  120. package/packages/docs/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
  121. package/packages/docs/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
  122. package/packages/docs/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
  123. package/packages/docs/.vitepress/dist/assets/mcp-interaction-pattern.VdvOPuTt.png +0 -0
  124. package/packages/docs/.vitepress/dist/assets/placeholder-demo-greenfield.B8lG_tBI.png +0 -0
  125. package/packages/docs/.vitepress/dist/assets/style.CAgdBzOq.css +1 -0
  126. package/packages/docs/.vitepress/dist/assets/user_advanced-engineering.md.MkETYNtq.js +50 -0
  127. package/packages/docs/.vitepress/dist/assets/user_advanced-engineering.md.MkETYNtq.lean.js +1 -0
  128. package/packages/docs/.vitepress/dist/assets/user_agent-setup.md.B54OLL2H.js +24 -0
  129. package/packages/docs/.vitepress/dist/assets/user_agent-setup.md.B54OLL2H.lean.js +1 -0
  130. package/packages/docs/.vitepress/dist/assets/user_beads-integration.md.BzdR5Fif.js +15 -0
  131. package/packages/docs/.vitepress/dist/assets/user_beads-integration.md.BzdR5Fif.lean.js +1 -0
  132. package/packages/docs/.vitepress/dist/assets/user_crowd-mcp-integration.md.C15kSdIJ.js +157 -0
  133. package/packages/docs/.vitepress/dist/assets/user_crowd-mcp-integration.md.C15kSdIJ.lean.js +1 -0
  134. package/packages/docs/.vitepress/dist/assets/user_custom-workflows.md.Cz4IYCXa.js +143 -0
  135. package/packages/docs/.vitepress/dist/assets/user_custom-workflows.md.Cz4IYCXa.lean.js +1 -0
  136. package/packages/docs/.vitepress/dist/assets/user_git-commit-feature.md.UcTvDR-O.js +1 -0
  137. package/packages/docs/.vitepress/dist/assets/user_git-commit-feature.md.UcTvDR-O.lean.js +1 -0
  138. package/packages/docs/.vitepress/dist/assets/user_how-it-works.md.DiOXNgaL.js +23 -0
  139. package/packages/docs/.vitepress/dist/assets/user_how-it-works.md.DiOXNgaL.lean.js +1 -0
  140. package/packages/docs/.vitepress/dist/assets/user_long-term-memory.md.DZh0tjNa.js +43 -0
  141. package/packages/docs/.vitepress/dist/assets/user_long-term-memory.md.DZh0tjNa.lean.js +1 -0
  142. package/packages/docs/.vitepress/dist/assets/user_packaged-workflows.md.s1HT89ZU.js +2 -0
  143. package/packages/docs/.vitepress/dist/assets/user_packaged-workflows.md.s1HT89ZU.lean.js +1 -0
  144. package/packages/docs/.vitepress/dist/assets/user_tutorial.md.Dmj8zLB2.js +3 -0
  145. package/packages/docs/.vitepress/dist/assets/user_tutorial.md.Dmj8zLB2.lean.js +1 -0
  146. package/packages/docs/.vitepress/dist/assets/user_workflow-selection.md.CrPGw9Hr.js +7 -0
  147. package/packages/docs/.vitepress/dist/assets/user_workflow-selection.md.CrPGw9Hr.lean.js +1 -0
  148. package/packages/docs/.vitepress/dist/assets/workflows.md.Bm5sGt3u.js +1 -0
  149. package/packages/docs/.vitepress/dist/assets/workflows.md.Bm5sGt3u.lean.js +1 -0
  150. package/packages/docs/.vitepress/dist/assets/workflows_adr.md.DEaXkbRp.js +1 -0
  151. package/packages/docs/.vitepress/dist/assets/workflows_adr.md.DEaXkbRp.lean.js +1 -0
  152. package/packages/docs/.vitepress/dist/assets/workflows_big-bang-conversion.md.BA5R1LxZ.js +1 -0
  153. package/packages/docs/.vitepress/dist/assets/workflows_big-bang-conversion.md.BA5R1LxZ.lean.js +1 -0
  154. package/packages/docs/.vitepress/dist/assets/workflows_boundary-testing.md.DBcYnMhx.js +1 -0
  155. package/packages/docs/.vitepress/dist/assets/workflows_boundary-testing.md.DBcYnMhx.lean.js +1 -0
  156. package/packages/docs/.vitepress/dist/assets/workflows_bugfix.md.CZRCL0Hp.js +1 -0
  157. package/packages/docs/.vitepress/dist/assets/workflows_bugfix.md.CZRCL0Hp.lean.js +1 -0
  158. package/packages/docs/.vitepress/dist/assets/workflows_business-analysis.md.fGLml8Hw.js +1 -0
  159. package/packages/docs/.vitepress/dist/assets/workflows_business-analysis.md.fGLml8Hw.lean.js +1 -0
  160. package/packages/docs/.vitepress/dist/assets/workflows_c4-analysis.md.Dnssqzuf.js +1 -0
  161. package/packages/docs/.vitepress/dist/assets/workflows_c4-analysis.md.Dnssqzuf.lean.js +1 -0
  162. package/packages/docs/.vitepress/dist/assets/workflows_epcc.md.M6DnIhpp.js +1 -0
  163. package/packages/docs/.vitepress/dist/assets/workflows_epcc.md.M6DnIhpp.lean.js +1 -0
  164. package/packages/docs/.vitepress/dist/assets/workflows_game-beginner.md.CNxzWLtd.js +1 -0
  165. package/packages/docs/.vitepress/dist/assets/workflows_game-beginner.md.CNxzWLtd.lean.js +1 -0
  166. package/packages/docs/.vitepress/dist/assets/workflows_greenfield.md.vx_g-WOe.js +1 -0
  167. package/packages/docs/.vitepress/dist/assets/workflows_greenfield.md.vx_g-WOe.lean.js +1 -0
  168. package/packages/docs/.vitepress/dist/assets/workflows_minor.md.DdnfwMf4.js +1 -0
  169. package/packages/docs/.vitepress/dist/assets/workflows_minor.md.DdnfwMf4.lean.js +1 -0
  170. package/packages/docs/.vitepress/dist/assets/workflows_posts.md.SOldXvq7.js +1 -0
  171. package/packages/docs/.vitepress/dist/assets/workflows_posts.md.SOldXvq7.lean.js +1 -0
  172. package/packages/docs/.vitepress/dist/assets/workflows_sdd-bugfix-crowd.md.-lSf42gJ.js +1 -0
  173. package/packages/docs/.vitepress/dist/assets/workflows_sdd-bugfix-crowd.md.-lSf42gJ.lean.js +1 -0
  174. package/packages/docs/.vitepress/dist/assets/workflows_sdd-bugfix.md.oRAsEVbc.js +1 -0
  175. package/packages/docs/.vitepress/dist/assets/workflows_sdd-bugfix.md.oRAsEVbc.lean.js +1 -0
  176. package/packages/docs/.vitepress/dist/assets/workflows_sdd-feature-crowd.md.DAtnfCAd.js +1 -0
  177. package/packages/docs/.vitepress/dist/assets/workflows_sdd-feature-crowd.md.DAtnfCAd.lean.js +1 -0
  178. package/packages/docs/.vitepress/dist/assets/workflows_sdd-feature.md.Ce3-H_g3.js +1 -0
  179. package/packages/docs/.vitepress/dist/assets/workflows_sdd-feature.md.Ce3-H_g3.lean.js +1 -0
  180. package/packages/docs/.vitepress/dist/assets/workflows_sdd-greenfield-crowd.md.8DUvcmLe.js +1 -0
  181. package/packages/docs/.vitepress/dist/assets/workflows_sdd-greenfield-crowd.md.8DUvcmLe.lean.js +1 -0
  182. package/packages/docs/.vitepress/dist/assets/workflows_sdd-greenfield.md.eEN6U0J4.js +1 -0
  183. package/packages/docs/.vitepress/dist/assets/workflows_sdd-greenfield.md.eEN6U0J4.lean.js +1 -0
  184. package/packages/docs/.vitepress/dist/assets/workflows_slides.md.Cqt-19_1.js +1 -0
  185. package/packages/docs/.vitepress/dist/assets/workflows_slides.md.Cqt-19_1.lean.js +1 -0
  186. package/packages/docs/.vitepress/dist/assets/workflows_tdd.md.BjVC69tu.js +1 -0
  187. package/packages/docs/.vitepress/dist/assets/workflows_tdd.md.BjVC69tu.lean.js +1 -0
  188. package/packages/docs/.vitepress/dist/assets/workflows_waterfall.md.CL6jTZP9.js +1 -0
  189. package/packages/docs/.vitepress/dist/assets/workflows_waterfall.md.CL6jTZP9.lean.js +1 -0
  190. package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +155 -0
  191. package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +97 -0
  192. package/packages/docs/.vitepress/dist/dev/LOGGING.html +59 -0
  193. package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +30 -0
  194. package/packages/docs/.vitepress/dist/hashmap.json +1 -0
  195. package/packages/docs/.vitepress/dist/index.html +27 -0
  196. package/packages/docs/.vitepress/dist/user/advanced-engineering.html +75 -0
  197. package/packages/docs/.vitepress/dist/user/agent-setup.html +49 -0
  198. package/packages/docs/.vitepress/dist/user/beads-integration.html +40 -0
  199. package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +182 -0
  200. package/packages/docs/.vitepress/dist/user/custom-workflows.html +168 -0
  201. package/packages/docs/.vitepress/dist/user/git-commit-feature.html +30 -0
  202. package/packages/docs/.vitepress/dist/user/how-it-works.html +48 -0
  203. package/packages/docs/.vitepress/dist/user/long-term-memory.html +68 -0
  204. package/packages/docs/.vitepress/dist/user/packaged-workflows.html +27 -0
  205. package/packages/docs/.vitepress/dist/user/tutorial.html +28 -0
  206. package/packages/docs/.vitepress/dist/user/workflow-selection.html +32 -0
  207. package/packages/docs/.vitepress/dist/vp-icons.css +0 -0
  208. package/packages/docs/.vitepress/dist/workflows/adr.html +26 -0
  209. package/packages/docs/.vitepress/dist/workflows/adr.yaml +157 -0
  210. package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +26 -0
  211. package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.yaml +592 -0
  212. package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +26 -0
  213. package/packages/docs/.vitepress/dist/workflows/boundary-testing.yaml +376 -0
  214. package/packages/docs/.vitepress/dist/workflows/bugfix.html +26 -0
  215. package/packages/docs/.vitepress/dist/workflows/bugfix.yaml +177 -0
  216. package/packages/docs/.vitepress/dist/workflows/business-analysis.html +26 -0
  217. package/packages/docs/.vitepress/dist/workflows/business-analysis.yaml +597 -0
  218. package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +26 -0
  219. package/packages/docs/.vitepress/dist/workflows/c4-analysis.yaml +471 -0
  220. package/packages/docs/.vitepress/dist/workflows/epcc.html +26 -0
  221. package/packages/docs/.vitepress/dist/workflows/epcc.yaml +183 -0
  222. package/packages/docs/.vitepress/dist/workflows/game-beginner.html +26 -0
  223. package/packages/docs/.vitepress/dist/workflows/game-beginner.yaml +434 -0
  224. package/packages/docs/.vitepress/dist/workflows/greenfield.html +26 -0
  225. package/packages/docs/.vitepress/dist/workflows/greenfield.yaml +201 -0
  226. package/packages/docs/.vitepress/dist/workflows/minor.html +26 -0
  227. package/packages/docs/.vitepress/dist/workflows/minor.yaml +138 -0
  228. package/packages/docs/.vitepress/dist/workflows/posts.html +26 -0
  229. package/packages/docs/.vitepress/dist/workflows/posts.yaml +193 -0
  230. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +26 -0
  231. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.yaml +608 -0
  232. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +26 -0
  233. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.yaml +381 -0
  234. package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +26 -0
  235. package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.yaml +713 -0
  236. package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +26 -0
  237. package/packages/docs/.vitepress/dist/workflows/sdd-feature.yaml +471 -0
  238. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +26 -0
  239. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.yaml +336 -0
  240. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +26 -0
  241. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.yaml +463 -0
  242. package/packages/docs/.vitepress/dist/workflows/slides.html +26 -0
  243. package/packages/docs/.vitepress/dist/workflows/slides.yaml +237 -0
  244. package/packages/docs/.vitepress/dist/workflows/tdd.html +26 -0
  245. package/packages/docs/.vitepress/dist/workflows/tdd.yaml +160 -0
  246. package/packages/docs/.vitepress/dist/workflows/waterfall.html +26 -0
  247. package/packages/docs/.vitepress/dist/workflows/waterfall.yaml +209 -0
  248. package/packages/docs/.vitepress/dist/workflows.html +26 -0
  249. package/packages/docs/package.json +32 -0
  250. package/packages/mcp-server/dist/index.js +10546 -0
  251. package/packages/mcp-server/package.json +41 -0
  252. package/packages/visualizer/dist/WorkflowVisualizer.vue +1147 -0
  253. package/packages/visualizer/dist/index.ts +17 -0
  254. package/packages/visualizer/dist/main.ts +673 -0
  255. package/packages/visualizer/dist/services/BundledWorkflows.ts +35 -0
  256. package/packages/visualizer/dist/services/FileUploadHandler.ts +166 -0
  257. package/packages/visualizer/dist/services/WorkflowLoader.ts +198 -0
  258. package/packages/visualizer/dist/services/YamlParser.ts +248 -0
  259. package/packages/visualizer/dist/services/workflow-list.ts +23 -0
  260. package/packages/visualizer/dist/types/ui-types.ts +84 -0
  261. package/packages/visualizer/dist/types/visualization-types.ts +95 -0
  262. package/packages/visualizer/dist/types/vite-env.d.ts +12 -0
  263. package/packages/visualizer/dist/utils/DomHelpers.ts +206 -0
  264. package/packages/visualizer/dist/utils/ErrorHandler.ts +170 -0
  265. package/packages/visualizer/dist/utils/PlantUMLEncoder.ts +121 -0
  266. package/packages/visualizer/dist/visualization/DiagramRenderer.ts +430 -0
  267. package/packages/visualizer/dist/visualization/LayoutEngine.ts +339 -0
  268. package/packages/visualizer/dist/visualization/PlantUMLRenderer.ts +507 -0
  269. package/packages/visualizer/dist/visualization/StateRenderer.ts +339 -0
  270. package/packages/visualizer/dist/visualization/TransitionRenderer.ts +432 -0
  271. package/packages/visualizer/package.json +39 -0
  272. package/resources/.DS_Store +0 -0
  273. package/resources/agents/architect.yaml +61 -0
  274. package/resources/agents/business-analyst.yaml +60 -0
  275. package/resources/agents/developer.yaml +61 -0
  276. package/resources/state-machine-schema.json +114 -0
  277. package/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
  278. package/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
  279. package/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
  280. package/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
  281. package/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
  282. package/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
  283. package/resources/templates/architecture/c4.md +224 -0
  284. package/resources/templates/architecture/freestyle.md +53 -0
  285. package/resources/templates/architecture/game.md +250 -0
  286. package/resources/templates/architecture/none.md +17 -0
  287. package/resources/templates/design/comprehensive.md +207 -0
  288. package/resources/templates/design/freestyle.md +37 -0
  289. package/resources/templates/design/game.md +66 -0
  290. package/resources/templates/design/none.md +17 -0
  291. package/resources/templates/requirements/ears.md +90 -0
  292. package/resources/templates/requirements/freestyle.md +42 -0
  293. package/resources/templates/requirements/game.md +162 -0
  294. package/resources/templates/requirements/none.md +17 -0
  295. package/resources/templates/skills/POWER.md +23 -0
  296. package/resources/templates/skills/SKILL.md +19 -0
  297. package/resources/workflows/adr.yaml +157 -0
  298. package/resources/workflows/big-bang-conversion.yaml +592 -0
  299. package/resources/workflows/boundary-testing.yaml +376 -0
  300. package/resources/workflows/bugfix.yaml +177 -0
  301. package/resources/workflows/business-analysis.yaml +597 -0
  302. package/resources/workflows/c4-analysis.yaml +471 -0
  303. package/resources/workflows/epcc.yaml +183 -0
  304. package/resources/workflows/game-beginner.yaml +434 -0
  305. package/resources/workflows/greenfield.yaml +201 -0
  306. package/resources/workflows/minor.yaml +138 -0
  307. package/resources/workflows/posts.yaml +193 -0
  308. package/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
  309. package/resources/workflows/sdd-bugfix.yaml +381 -0
  310. package/resources/workflows/sdd-feature-crowd.yaml +713 -0
  311. package/resources/workflows/sdd-feature.yaml +471 -0
  312. package/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
  313. package/resources/workflows/sdd-greenfield.yaml +463 -0
  314. package/resources/workflows/slides.yaml +237 -0
  315. package/resources/workflows/tdd.yaml +160 -0
  316. package/resources/workflows/waterfall.yaml +209 -0
  317. package/dist/components/beads/beads-instruction-generator.d.ts +0 -44
  318. package/dist/components/beads/beads-instruction-generator.d.ts.map +0 -1
  319. package/dist/components/beads/beads-instruction-generator.js +0 -160
  320. package/dist/components/beads/beads-instruction-generator.js.map +0 -1
  321. package/dist/components/beads/beads-plan-manager.d.ts.map +0 -1
  322. package/dist/components/beads/beads-plan-manager.js.map +0 -1
  323. package/dist/components/beads/beads-task-backend-client.d.ts +0 -43
  324. package/dist/components/beads/beads-task-backend-client.d.ts.map +0 -1
  325. package/dist/components/beads/beads-task-backend-client.js +0 -175
  326. package/dist/components/beads/beads-task-backend-client.js.map +0 -1
  327. package/dist/index.d.ts +0 -9
  328. package/dist/index.d.ts.map +0 -1
  329. package/dist/index.js +0 -74
  330. package/dist/index.js.map +0 -1
  331. package/dist/notification-service.d.ts +0 -14
  332. package/dist/notification-service.d.ts.map +0 -1
  333. package/dist/notification-service.js +0 -18
  334. package/dist/notification-service.js.map +0 -1
  335. package/dist/plugin-system/beads-plugin.d.ts +0 -71
  336. package/dist/plugin-system/beads-plugin.d.ts.map +0 -1
  337. package/dist/plugin-system/beads-plugin.js +0 -465
  338. package/dist/plugin-system/beads-plugin.js.map +0 -1
  339. package/dist/plugin-system/commit-plugin.d.ts +0 -40
  340. package/dist/plugin-system/commit-plugin.d.ts.map +0 -1
  341. package/dist/plugin-system/commit-plugin.js +0 -204
  342. package/dist/plugin-system/commit-plugin.js.map +0 -1
  343. package/dist/plugin-system/index.d.ts +0 -9
  344. package/dist/plugin-system/index.d.ts.map +0 -1
  345. package/dist/plugin-system/index.js +0 -9
  346. package/dist/plugin-system/index.js.map +0 -1
  347. package/dist/plugin-system/plugin-interfaces.d.ts +0 -98
  348. package/dist/plugin-system/plugin-interfaces.d.ts.map +0 -1
  349. package/dist/plugin-system/plugin-interfaces.js +0 -9
  350. package/dist/plugin-system/plugin-interfaces.js.map +0 -1
  351. package/dist/plugin-system/plugin-registry.d.ts +0 -44
  352. package/dist/plugin-system/plugin-registry.d.ts.map +0 -1
  353. package/dist/plugin-system/plugin-registry.js +0 -132
  354. package/dist/plugin-system/plugin-registry.js.map +0 -1
  355. package/dist/resource-handlers/conversation-state.d.ts +0 -15
  356. package/dist/resource-handlers/conversation-state.d.ts.map +0 -1
  357. package/dist/resource-handlers/conversation-state.js +0 -40
  358. package/dist/resource-handlers/conversation-state.js.map +0 -1
  359. package/dist/resource-handlers/development-plan.d.ts +0 -14
  360. package/dist/resource-handlers/development-plan.d.ts.map +0 -1
  361. package/dist/resource-handlers/development-plan.js +0 -31
  362. package/dist/resource-handlers/development-plan.js.map +0 -1
  363. package/dist/resource-handlers/index.d.ts +0 -24
  364. package/dist/resource-handlers/index.d.ts.map +0 -1
  365. package/dist/resource-handlers/index.js +0 -62
  366. package/dist/resource-handlers/index.js.map +0 -1
  367. package/dist/resource-handlers/system-prompt.d.ts +0 -15
  368. package/dist/resource-handlers/system-prompt.d.ts.map +0 -1
  369. package/dist/resource-handlers/system-prompt.js +0 -40
  370. package/dist/resource-handlers/system-prompt.js.map +0 -1
  371. package/dist/resource-handlers/workflow-resource.d.ts +0 -15
  372. package/dist/resource-handlers/workflow-resource.d.ts.map +0 -1
  373. package/dist/resource-handlers/workflow-resource.js +0 -85
  374. package/dist/resource-handlers/workflow-resource.js.map +0 -1
  375. package/dist/response-renderer.d.ts +0 -30
  376. package/dist/response-renderer.d.ts.map +0 -1
  377. package/dist/response-renderer.js +0 -94
  378. package/dist/response-renderer.js.map +0 -1
  379. package/dist/server-config.d.ts +0 -34
  380. package/dist/server-config.d.ts.map +0 -1
  381. package/dist/server-config.js +0 -503
  382. package/dist/server-config.js.map +0 -1
  383. package/dist/server-helpers.d.ts +0 -70
  384. package/dist/server-helpers.d.ts.map +0 -1
  385. package/dist/server-helpers.js +0 -171
  386. package/dist/server-helpers.js.map +0 -1
  387. package/dist/server-implementation.d.ts +0 -74
  388. package/dist/server-implementation.d.ts.map +0 -1
  389. package/dist/server-implementation.js +0 -201
  390. package/dist/server-implementation.js.map +0 -1
  391. package/dist/server.d.ts +0 -6
  392. package/dist/server.d.ts.map +0 -1
  393. package/dist/server.js +0 -5
  394. package/dist/server.js.map +0 -1
  395. package/dist/tool-handlers/base-tool-handler.d.ts +0 -50
  396. package/dist/tool-handlers/base-tool-handler.d.ts.map +0 -1
  397. package/dist/tool-handlers/base-tool-handler.js +0 -81
  398. package/dist/tool-handlers/base-tool-handler.js.map +0 -1
  399. package/dist/tool-handlers/conduct-review.d.ts +0 -49
  400. package/dist/tool-handlers/conduct-review.d.ts.map +0 -1
  401. package/dist/tool-handlers/conduct-review.js +0 -104
  402. package/dist/tool-handlers/conduct-review.js.map +0 -1
  403. package/dist/tool-handlers/get-tool-info.d.ts +0 -75
  404. package/dist/tool-handlers/get-tool-info.d.ts.map +0 -1
  405. package/dist/tool-handlers/get-tool-info.js +0 -168
  406. package/dist/tool-handlers/get-tool-info.js.map +0 -1
  407. package/dist/tool-handlers/index.d.ts +0 -41
  408. package/dist/tool-handlers/index.d.ts.map +0 -1
  409. package/dist/tool-handlers/index.js +0 -71
  410. package/dist/tool-handlers/index.js.map +0 -1
  411. package/dist/tool-handlers/list-workflows.d.ts +0 -35
  412. package/dist/tool-handlers/list-workflows.d.ts.map +0 -1
  413. package/dist/tool-handlers/list-workflows.js +0 -43
  414. package/dist/tool-handlers/list-workflows.js.map +0 -1
  415. package/dist/tool-handlers/no-idea.d.ts +0 -41
  416. package/dist/tool-handlers/no-idea.d.ts.map +0 -1
  417. package/dist/tool-handlers/no-idea.js +0 -29
  418. package/dist/tool-handlers/no-idea.js.map +0 -1
  419. package/dist/tool-handlers/proceed-to-phase.d.ts +0 -41
  420. package/dist/tool-handlers/proceed-to-phase.d.ts.map +0 -1
  421. package/dist/tool-handlers/proceed-to-phase.js +0 -165
  422. package/dist/tool-handlers/proceed-to-phase.js.map +0 -1
  423. package/dist/tool-handlers/reset-development.d.ts +0 -31
  424. package/dist/tool-handlers/reset-development.d.ts.map +0 -1
  425. package/dist/tool-handlers/reset-development.js +0 -48
  426. package/dist/tool-handlers/reset-development.js.map +0 -1
  427. package/dist/tool-handlers/resume-workflow.d.ts +0 -87
  428. package/dist/tool-handlers/resume-workflow.d.ts.map +0 -1
  429. package/dist/tool-handlers/resume-workflow.js +0 -212
  430. package/dist/tool-handlers/resume-workflow.js.map +0 -1
  431. package/dist/tool-handlers/setup-project-docs.d.ts +0 -37
  432. package/dist/tool-handlers/setup-project-docs.d.ts.map +0 -1
  433. package/dist/tool-handlers/setup-project-docs.js +0 -138
  434. package/dist/tool-handlers/setup-project-docs.js.map +0 -1
  435. package/dist/tool-handlers/start-development.d.ts +0 -79
  436. package/dist/tool-handlers/start-development.d.ts.map +0 -1
  437. package/dist/tool-handlers/start-development.js +0 -484
  438. package/dist/tool-handlers/start-development.js.map +0 -1
  439. package/dist/tool-handlers/whats-next.d.ts +0 -41
  440. package/dist/tool-handlers/whats-next.d.ts.map +0 -1
  441. package/dist/tool-handlers/whats-next.js +0 -123
  442. package/dist/tool-handlers/whats-next.js.map +0 -1
  443. package/dist/types.d.ts +0 -119
  444. package/dist/types.d.ts.map +0 -1
  445. package/dist/types.js +0 -5
  446. package/dist/version-info.d.ts +0 -30
  447. package/dist/version-info.d.ts.map +0 -1
  448. package/dist/version-info.js +0 -178
  449. package/dist/version-info.js.map +0 -1
  450. package/skill/SKILL.md +0 -28
  451. /package/{dist → packages/core/dist}/types.js.map +0 -0
@@ -0,0 +1,1421 @@
1
+ import {
2
+ StateMachineLoader,
3
+ WorkflowManager,
4
+ generateSystemPrompt
5
+ } from "./chunk-RTDQR2KY.js";
6
+ import "./chunk-R5U7XKVJ.js";
7
+
8
+ // src/cli.ts
9
+ import { fileURLToPath as fileURLToPath3 } from "url";
10
+ import { dirname as dirname3, join as join5 } from "path";
11
+ import {
12
+ existsSync as existsSync3,
13
+ mkdirSync,
14
+ writeFileSync,
15
+ readFileSync,
16
+ readdirSync
17
+ } from "fs";
18
+
19
+ // src/visualization-launcher.ts
20
+ import { spawn } from "child_process";
21
+ import { join, dirname } from "path";
22
+ import { fileURLToPath } from "url";
23
+ var __filename = fileURLToPath(import.meta.url);
24
+ var __dirname = dirname(__filename);
25
+ function startVisualizationTool() {
26
+ console.log(`
27
+ \u{1F389} Starting Workflow Visualizer...
28
+
29
+ The interactive workflow visualizer provides a web-based interface for
30
+ exploring and understanding workflow state machines with beautiful PlantUML diagrams.
31
+
32
+ Starting development server...
33
+ `);
34
+ try {
35
+ const docsPath = join(__dirname, "..", "..", "docs");
36
+ const isDev = process.env["NODE_ENV"] !== "production";
37
+ if (isDev) {
38
+ console.log("\u{1F4E6} Installing dependencies...");
39
+ const install = spawn("npm", ["install"], {
40
+ cwd: docsPath,
41
+ stdio: "inherit",
42
+ shell: true
43
+ });
44
+ install.on("close", (code) => {
45
+ if (code === 0) {
46
+ console.log("\u{1F680} Starting development server...");
47
+ const dev = spawn("npm", ["run", "dev"], {
48
+ cwd: docsPath,
49
+ stdio: "inherit",
50
+ shell: true
51
+ });
52
+ dev.on("close", (code2) => {
53
+ if (code2 !== 0) {
54
+ console.error("\u274C Failed to start development server");
55
+ process.exit(1);
56
+ }
57
+ });
58
+ } else {
59
+ console.error("\u274C Failed to install dependencies");
60
+ process.exit(1);
61
+ }
62
+ });
63
+ } else {
64
+ console.log("\u{1F3D7}\uFE0F Building visualizer...");
65
+ const build = spawn("npm", ["run", "build"], {
66
+ cwd: docsPath,
67
+ stdio: "inherit",
68
+ shell: true
69
+ });
70
+ build.on("close", (code) => {
71
+ if (code === 0) {
72
+ console.log("\u{1F310} Starting production server...");
73
+ const serve = spawn("npm", ["run", "preview"], {
74
+ cwd: docsPath,
75
+ stdio: "inherit",
76
+ shell: true
77
+ });
78
+ serve.on("close", (code2) => {
79
+ if (code2 !== 0) {
80
+ console.error("\u274C Failed to start production server");
81
+ process.exit(1);
82
+ }
83
+ });
84
+ } else {
85
+ console.error("\u274C Failed to build visualizer");
86
+ process.exit(1);
87
+ }
88
+ });
89
+ }
90
+ } catch (error) {
91
+ console.error("\u274C Error starting workflow visualizer:", error);
92
+ console.log(`
93
+ \u{1F4A1} Manual start instructions:
94
+ cd packages/docs
95
+ npm install
96
+ npm run dev
97
+
98
+ Then open http://localhost:5173/ in your browser.
99
+ `);
100
+ process.exit(1);
101
+ }
102
+ }
103
+
104
+ // src/config-generator.ts
105
+ import { writeFile, mkdir, readFile } from "fs/promises";
106
+ import { join as join2 } from "path";
107
+ import { existsSync } from "fs";
108
+ function deepMerge(target, source) {
109
+ if (!source || typeof source !== "object") {
110
+ return source;
111
+ }
112
+ if (!target || typeof target !== "object") {
113
+ return source;
114
+ }
115
+ const result = { ...target };
116
+ for (const key of Object.keys(source)) {
117
+ const sourceValue = source[key];
118
+ const targetValue = target[key];
119
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
120
+ result[key] = deepMerge(
121
+ targetValue,
122
+ sourceValue
123
+ );
124
+ } else {
125
+ result[key] = sourceValue;
126
+ }
127
+ }
128
+ return result;
129
+ }
130
+ var ConfigGenerator = class {
131
+ /**
132
+ * Get the system prompt using existing generation logic
133
+ * Suppresses info logs during CLI operations
134
+ */
135
+ getSystemPrompt() {
136
+ try {
137
+ const loader = new StateMachineLoader();
138
+ const stateMachine = loader.loadStateMachine(process.cwd());
139
+ return generateSystemPrompt(stateMachine);
140
+ } catch (error) {
141
+ throw new Error(`Failed to generate system prompt: ${error}`);
142
+ }
143
+ }
144
+ /**
145
+ * Write file with proper error handling
146
+ */
147
+ async writeFile(filePath, content) {
148
+ try {
149
+ await writeFile(filePath, content, "utf-8");
150
+ console.log(`\u2713 Generated: ${filePath}`);
151
+ } catch (error) {
152
+ throw new Error(`Failed to write file ${filePath}: ${error}`);
153
+ }
154
+ }
155
+ /**
156
+ * Read and merge with existing JSON config file if it exists
157
+ * Returns merged config with new config taking precedence
158
+ */
159
+ async mergeWithExistingConfig(filePath, newConfig) {
160
+ if (!existsSync(filePath)) {
161
+ return newConfig;
162
+ }
163
+ try {
164
+ const existingContent = await readFile(filePath, "utf-8");
165
+ const existingConfig = JSON.parse(existingContent);
166
+ console.log("\u2713 Merged with existing configuration");
167
+ return deepMerge(existingConfig, newConfig);
168
+ } catch (error) {
169
+ if (error instanceof SyntaxError) {
170
+ throw new Error(
171
+ `Existing ${filePath} contains invalid JSON. Please fix the file or remove it to generate a new configuration. Error: ${error.message}`
172
+ );
173
+ }
174
+ throw error;
175
+ }
176
+ }
177
+ /**
178
+ * We'll be using the reduced deployable which only contains the mcp server, not the CLI
179
+ * On Windows, npx commands need to be prefixed with "cmd /c"
180
+ */
181
+ getDefaultMcpConfig() {
182
+ const isWindows = process.platform.startsWith("win");
183
+ return {
184
+ workflows: {
185
+ command: isWindows ? ["cmd", "/c", "npx", "@codemcp/workflows-server@latest"] : ["npx", "@codemcp/workflows-server@latest"]
186
+ }
187
+ };
188
+ }
189
+ /**
190
+ * Get default allowed tools for workflows
191
+ */
192
+ getDefaultAllowedTools() {
193
+ return ["whats_next", "conduct_review", "list_workflows", "get_tool_info"];
194
+ }
195
+ };
196
+ var AmazonQConfigGenerator = class extends ConfigGenerator {
197
+ async generate(outputDir) {
198
+ const systemPrompt = this.getSystemPrompt();
199
+ const mcpServers = this.getDefaultMcpConfig();
200
+ const newConfig = {
201
+ name: "vibe",
202
+ description: "Responsible vibe development",
203
+ prompt: systemPrompt,
204
+ mcpServers,
205
+ tools: [
206
+ "execute_bash",
207
+ "fs_read",
208
+ "fs_write",
209
+ "report_issue",
210
+ "knowledge",
211
+ "thinking",
212
+ "use_aws",
213
+ "@workflows"
214
+ ],
215
+ allowedTools: [
216
+ "fs_read",
217
+ "fs_write",
218
+ "@workflows/whats_next",
219
+ "@workflows/conduct_review",
220
+ "@workflows/list_workflows",
221
+ "@workflows/get_tool_info"
222
+ ],
223
+ toolsSettings: {
224
+ execute_bash: {
225
+ alwaysAllow: [
226
+ {
227
+ preset: "readOnly"
228
+ }
229
+ ]
230
+ },
231
+ use_aws: {
232
+ alwaysAllow: [
233
+ {
234
+ preset: "readOnly"
235
+ }
236
+ ]
237
+ }
238
+ },
239
+ resources: ["file://README.md", "file://.amazonq/rules/**/*.md"],
240
+ hooks: {}
241
+ };
242
+ const amazonqDir = join2(outputDir, ".amazonq", "cli-agents");
243
+ await mkdir(amazonqDir, { recursive: true });
244
+ const configPath = join2(amazonqDir, "vibe.json");
245
+ const finalConfig = await this.mergeWithExistingConfig(
246
+ configPath,
247
+ newConfig
248
+ );
249
+ await this.writeFile(configPath, JSON.stringify(finalConfig, null, 2));
250
+ }
251
+ };
252
+ var ClaudeConfigGenerator = class extends ConfigGenerator {
253
+ async generate(outputDir) {
254
+ const systemPrompt = this.getSystemPrompt();
255
+ const mcpServers = this.getDefaultMcpConfig();
256
+ const claudeMdPath = join2(outputDir, "CLAUDE.md");
257
+ await this.writeFile(claudeMdPath, systemPrompt);
258
+ const mcpConfig = {
259
+ mcpServers
260
+ };
261
+ const mcpJsonPath = join2(outputDir, ".mcp.json");
262
+ const finalMcpConfig = await this.mergeWithExistingConfig(
263
+ mcpJsonPath,
264
+ mcpConfig
265
+ );
266
+ await this.writeFile(mcpJsonPath, JSON.stringify(finalMcpConfig, null, 2));
267
+ const settings = {
268
+ permissions: {
269
+ allow: [
270
+ "MCP(workflows:whats_next)",
271
+ "MCP(workflows:conduct_review)",
272
+ "MCP(workflows:list_workflows)",
273
+ "MCP(workflows:get_tool_info)",
274
+ "Read(README.md)",
275
+ "Read(./.vibe/**)",
276
+ "Write(./.vibe/**)"
277
+ ],
278
+ ask: ["Bash(*)", "Write(**)"],
279
+ deny: ["Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
280
+ }
281
+ };
282
+ const settingsPath = join2(outputDir, "settings.json");
283
+ const finalSettings = await this.mergeWithExistingConfig(
284
+ settingsPath,
285
+ settings
286
+ );
287
+ await this.writeFile(settingsPath, JSON.stringify(finalSettings, null, 2));
288
+ }
289
+ };
290
+ var GeminiConfigGenerator = class extends ConfigGenerator {
291
+ async generate(outputDir) {
292
+ const systemPrompt = this.getSystemPrompt();
293
+ const mcpServers = this.getDefaultMcpConfig();
294
+ const allowedTools = this.getDefaultAllowedTools();
295
+ const settings = {
296
+ contextFileName: "GEMINI.md",
297
+ autoAccept: false,
298
+ theme: "Default",
299
+ vimMode: false,
300
+ sandbox: false,
301
+ mcpServers,
302
+ allowMCPServers: ["workflows"],
303
+ coreTools: ["ReadFileTool", "WriteFileTool", "GlobTool", "ShellTool"],
304
+ telemetry: {
305
+ enabled: false,
306
+ target: "local",
307
+ otlpEndpoint: "http://localhost:4317",
308
+ logPrompts: false
309
+ },
310
+ usageStatisticsEnabled: false,
311
+ hideTips: false,
312
+ hideBanner: false
313
+ };
314
+ const settingsPath = join2(outputDir, "settings.json");
315
+ const finalSettings = await this.mergeWithExistingConfig(
316
+ settingsPath,
317
+ settings
318
+ );
319
+ await this.writeFile(settingsPath, JSON.stringify(finalSettings, null, 2));
320
+ const geminiMdContent = `# Vibe Development Agent
321
+
322
+ ${systemPrompt}
323
+
324
+ ## Project Context
325
+
326
+ This agent is configured to work with the workflows server for structured development workflows.
327
+
328
+ ## Available Tools
329
+
330
+ The following tools are available for development tasks:
331
+ ${allowedTools.map((tool) => `- ${tool}`).join("\n")}
332
+ `;
333
+ const geminiMdPath = join2(outputDir, "GEMINI.md");
334
+ await this.writeFile(geminiMdPath, geminiMdContent);
335
+ }
336
+ };
337
+ var OpencodeConfigGenerator = class extends ConfigGenerator {
338
+ async generate(outputDir) {
339
+ const systemPrompt = this.getSystemPrompt();
340
+ const configPath = join2(outputDir, "opencode.json");
341
+ const isWindows = process.platform.startsWith("win");
342
+ const newConfig = {
343
+ $schema: "https://opencode.ai/config.json",
344
+ mcp: {
345
+ workflows: {
346
+ type: "local",
347
+ command: isWindows ? ["cmd", "/c", "npx", "@codemcp/workflows-server@latest"] : ["npx", "@codemcp/workflows-server@latest"]
348
+ }
349
+ },
350
+ agent: {
351
+ vibe: {
352
+ description: "Responsible vibe development agent with structured workflows",
353
+ mode: "primary",
354
+ prompt: systemPrompt,
355
+ tools: {
356
+ "workflows*": true
357
+ },
358
+ permission: {
359
+ workflows_reset_development: "ask",
360
+ workflows_start_development: "ask",
361
+ workflows_proceed_to_phase: "ask"
362
+ }
363
+ }
364
+ }
365
+ };
366
+ const finalConfig = await this.mergeWithExistingConfig(
367
+ configPath,
368
+ newConfig
369
+ );
370
+ await this.writeFile(configPath, JSON.stringify(finalConfig, null, 2));
371
+ }
372
+ };
373
+ var VSCodeConfigGenerator = class extends ConfigGenerator {
374
+ async generate(outputDir) {
375
+ const systemPrompt = this.getSystemPrompt();
376
+ const mcpServers = this.getDefaultMcpConfig();
377
+ const vscodeDir = join2(outputDir, ".vscode");
378
+ await mkdir(vscodeDir, { recursive: true });
379
+ const mcpConfig = {
380
+ servers: mcpServers
381
+ };
382
+ const mcpJsonPath = join2(vscodeDir, "mcp.json");
383
+ await this.writeFile(mcpJsonPath, JSON.stringify(mcpConfig, null, 2));
384
+ const githubAgentsDir = join2(outputDir, ".github", "agents");
385
+ await mkdir(githubAgentsDir, { recursive: true });
386
+ const agentContent = `---
387
+ description: AI assistant that helps users develop software features using the workflows server.
388
+ tools: ['edit', 'runNotebooks', 'search', 'new', 'runCommands', 'runTasks', 'workflows/*', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'openSimpleBrowser', 'fetch', 'githubRepo', 'extensions', 'runSubagent']
389
+ ---
390
+
391
+ ${systemPrompt}
392
+ `;
393
+ const agentPath = join2(githubAgentsDir, "Vibe.agent.md");
394
+ await this.writeFile(agentPath, agentContent);
395
+ }
396
+ };
397
+ var GeneratorRegistry = class {
398
+ static generators = /* @__PURE__ */ new Map();
399
+ /**
400
+ * Register a generator with its metadata
401
+ */
402
+ static register(metadata) {
403
+ this.generators.set(metadata.name.toLowerCase(), metadata);
404
+ if (metadata.aliases) {
405
+ for (const alias of metadata.aliases) {
406
+ this.generators.set(alias.toLowerCase(), metadata);
407
+ }
408
+ }
409
+ }
410
+ /**
411
+ * Create a generator instance by name or alias
412
+ */
413
+ static createGenerator(name) {
414
+ const metadata = this.generators.get(name.toLowerCase());
415
+ if (!metadata) {
416
+ const available = this.getGeneratorNames().join(", ");
417
+ throw new Error(
418
+ `Unsupported agent: ${name}. Supported agents: ${available}`
419
+ );
420
+ }
421
+ return new metadata.generatorClass();
422
+ }
423
+ /**
424
+ * Get all unique registered generators (without duplicates from aliases)
425
+ */
426
+ static getAllGenerators() {
427
+ const unique = /* @__PURE__ */ new Map();
428
+ for (const metadata of this.generators.values()) {
429
+ unique.set(metadata.name, metadata);
430
+ }
431
+ return Array.from(unique.values());
432
+ }
433
+ /**
434
+ * Get list of primary generator names
435
+ */
436
+ static getGeneratorNames() {
437
+ return this.getAllGenerators().map((g) => g.name);
438
+ }
439
+ /**
440
+ * Get formatted help text for all generators
441
+ */
442
+ static getHelpText() {
443
+ return this.getAllGenerators().map((g) => ` ${g.name.padEnd(20)} ${g.description}`).join("\n");
444
+ }
445
+ /**
446
+ * Check if a generator exists by name or alias
447
+ */
448
+ static exists(name) {
449
+ return this.generators.has(name.toLowerCase());
450
+ }
451
+ };
452
+ GeneratorRegistry.register({
453
+ name: "kiro",
454
+ description: "Generate .amazonq/cli-agents/vibe.json (Kiro/Amazon Q)",
455
+ aliases: ["amazonq-cli", "amazonq"],
456
+ generatorClass: AmazonQConfigGenerator
457
+ });
458
+ GeneratorRegistry.register({
459
+ name: "kiro-cli",
460
+ description: "Generate .amazonq/cli-agents/vibe.json (Kiro/Amazon Q CLI)",
461
+ generatorClass: AmazonQConfigGenerator
462
+ });
463
+ GeneratorRegistry.register({
464
+ name: "claude",
465
+ description: "Generate CLAUDE.md, .mcp.json, settings.json",
466
+ generatorClass: ClaudeConfigGenerator
467
+ });
468
+ GeneratorRegistry.register({
469
+ name: "gemini",
470
+ description: "Generate settings.json, GEMINI.md",
471
+ generatorClass: GeminiConfigGenerator
472
+ });
473
+ GeneratorRegistry.register({
474
+ name: "opencode",
475
+ description: "Generate opencode.json",
476
+ generatorClass: OpencodeConfigGenerator
477
+ });
478
+ GeneratorRegistry.register({
479
+ name: "copilot",
480
+ description: "Generate .vscode/mcp.json, .github/agents/Vibe.agent.md",
481
+ aliases: ["copilot-vscode", "vscode"],
482
+ generatorClass: VSCodeConfigGenerator
483
+ });
484
+ var ConfigGeneratorFactory = class {
485
+ static createGenerator(agent) {
486
+ return GeneratorRegistry.createGenerator(agent);
487
+ }
488
+ };
489
+ async function generateConfig(agent, outputDir = ".") {
490
+ console.log(`Generating configuration for ${agent}...`);
491
+ const generator = ConfigGeneratorFactory.createGenerator(agent);
492
+ await generator.generate(outputDir);
493
+ console.log(`\u2705 Configuration generated successfully for ${agent}`);
494
+ }
495
+
496
+ // src/skill-generator.ts
497
+ import { writeFile as writeFile2, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
498
+ import { join as join4, dirname as dirname2 } from "path";
499
+ import { existsSync as existsSync2 } from "fs";
500
+ import { fileURLToPath as fileURLToPath2 } from "url";
501
+
502
+ // src/skill-paths.ts
503
+ import { join as join3 } from "path";
504
+ function getSkillPaths(platform, outputDir) {
505
+ const normalizedPlatform = platform.toLowerCase();
506
+ switch (normalizedPlatform) {
507
+ case "claude": {
508
+ const skillDir = join3(outputDir, ".claude", "skills", "responsible-vibe");
509
+ return {
510
+ skillDir,
511
+ skillFile: join3(skillDir, "SKILL.md"),
512
+ mcpConfigPath: join3(outputDir, ".mcp.json"),
513
+ mcpConfigKey: "mcpServers",
514
+ isKiroPower: false
515
+ };
516
+ }
517
+ case "opencode": {
518
+ const skillDir = join3(
519
+ outputDir,
520
+ ".opencode",
521
+ "skills",
522
+ "responsible-vibe"
523
+ );
524
+ return {
525
+ skillDir,
526
+ skillFile: join3(skillDir, "SKILL.md"),
527
+ mcpConfigPath: join3(outputDir, "opencode.json"),
528
+ mcpConfigKey: "mcp",
529
+ isKiroPower: false
530
+ };
531
+ }
532
+ case "kiro": {
533
+ const skillDir = join3(outputDir, ".kiro", "powers", "responsible-vibe");
534
+ return {
535
+ skillDir,
536
+ skillFile: join3(skillDir, "POWER.md"),
537
+ mcpConfigPath: join3(skillDir, "mcp.json"),
538
+ // mcpConfigKey omitted - MCP config is at root level
539
+ isKiroPower: true
540
+ };
541
+ }
542
+ case "kiro-cli": {
543
+ const skillDir = join3(outputDir, ".kiro", "skills", "responsible-vibe");
544
+ return {
545
+ skillDir,
546
+ skillFile: join3(skillDir, "SKILL.md"),
547
+ mcpConfigPath: join3(outputDir, ".kiro", "settings", "mcp.json"),
548
+ mcpConfigKey: "mcpServers",
549
+ isKiroPower: false
550
+ };
551
+ }
552
+ case "copilot": {
553
+ const skillDir = join3(outputDir, ".github", "skills", "responsible-vibe");
554
+ return {
555
+ skillDir,
556
+ skillFile: join3(skillDir, "SKILL.md"),
557
+ mcpConfigPath: join3(outputDir, ".vscode", "mcp.json"),
558
+ mcpConfigKey: "servers",
559
+ isKiroPower: false
560
+ };
561
+ }
562
+ case "gemini": {
563
+ const skillDir = join3(outputDir, ".gemini", "skills", "responsible-vibe");
564
+ return {
565
+ skillDir,
566
+ skillFile: join3(skillDir, "SKILL.md"),
567
+ mcpConfigPath: join3(outputDir, "settings.json"),
568
+ mcpConfigKey: "mcpServers",
569
+ isKiroPower: false
570
+ };
571
+ }
572
+ default:
573
+ throw new Error(
574
+ `Unsupported skill platform: ${platform}. Supported platforms: claude, opencode, kiro, kiro-cli, copilot, gemini`
575
+ );
576
+ }
577
+ }
578
+
579
+ // src/skill-generator.ts
580
+ var __filename2 = fileURLToPath2(import.meta.url);
581
+ var __dirname2 = dirname2(__filename2);
582
+ async function getVersion() {
583
+ const possiblePaths = [
584
+ join4(__dirname2, "..", "..", "package.json"),
585
+ // cli package
586
+ join4(__dirname2, "..", "..", "..", "package.json")
587
+ // root package
588
+ ];
589
+ for (const packagePath of possiblePaths) {
590
+ if (existsSync2(packagePath)) {
591
+ try {
592
+ const content = await readFile2(packagePath, "utf-8");
593
+ const pkg = JSON.parse(content);
594
+ if (pkg.version) {
595
+ return pkg.version;
596
+ }
597
+ } catch {
598
+ }
599
+ }
600
+ }
601
+ return "0.0.0";
602
+ }
603
+ var SkillGenerator = class {
604
+ /**
605
+ * Write file with proper error handling
606
+ */
607
+ async writeFile(filePath, content) {
608
+ try {
609
+ const dir = dirname2(filePath);
610
+ await mkdir2(dir, { recursive: true });
611
+ await writeFile2(filePath, content, "utf-8");
612
+ console.log(`\u2713 Generated: ${filePath}`);
613
+ } catch (error) {
614
+ throw new Error(`Failed to write file ${filePath}: ${error}`);
615
+ }
616
+ }
617
+ /**
618
+ * We'll be using the reduced deployable which only contains the mcp server, not the CLI
619
+ * On Windows, npx commands need to be prefixed with "cmd /c"
620
+ */
621
+ getDefaultMcpConfig() {
622
+ const isWindows = process.platform.startsWith("win");
623
+ return {
624
+ workflows: {
625
+ command: isWindows ? ["cmd", "/c", "npx", "@codemcp/workflows-server@latest"] : ["npx", "@codemcp/workflows-server@latest"]
626
+ }
627
+ };
628
+ }
629
+ /**
630
+ * Get MCP config in command + args format (used by Kiro/Amazon Q CLI)
631
+ */
632
+ getKiroMcpConfig() {
633
+ const isWindows = process.platform.startsWith("win");
634
+ if (isWindows) {
635
+ return {
636
+ workflows: {
637
+ command: "cmd",
638
+ args: ["/c", "npx", "@codemcp/workflows-server@latest"]
639
+ }
640
+ };
641
+ }
642
+ return {
643
+ workflows: {
644
+ command: "npx",
645
+ args: ["@codemcp/workflows-server@latest"]
646
+ }
647
+ };
648
+ }
649
+ /**
650
+ * Write MCP configuration file for the platform
651
+ */
652
+ async writeMcpConfig(paths) {
653
+ const mcpConfig = this.getDefaultMcpConfig();
654
+ let configContent;
655
+ if (paths.mcpConfigKey) {
656
+ configContent = { [paths.mcpConfigKey]: mcpConfig };
657
+ } else {
658
+ configContent = { mcpServers: mcpConfig };
659
+ }
660
+ await this.writeFile(
661
+ paths.mcpConfigPath,
662
+ JSON.stringify(configContent, null, 2)
663
+ );
664
+ }
665
+ /**
666
+ * Get the system prompt using existing generation logic
667
+ * Same approach as config-generator.ts
668
+ */
669
+ getSystemPrompt() {
670
+ try {
671
+ const loader = new StateMachineLoader();
672
+ const stateMachine = loader.loadStateMachine(process.cwd());
673
+ return generateSystemPrompt(stateMachine);
674
+ } catch (error) {
675
+ throw new Error(`Failed to generate system prompt: ${error}`);
676
+ }
677
+ }
678
+ /**
679
+ * Get the skill content by combining frontmatter template with dynamic system prompt
680
+ * The frontmatter is loaded from resources/templates/skills/SKILL.md
681
+ * The body is generated dynamically from generateSystemPrompt()
682
+ */
683
+ async getSkillTemplate() {
684
+ const frontmatterPath = this.resolveSkillTemplatePath("SKILL.md");
685
+ const frontmatter = await this.loadAndProcessTemplate(frontmatterPath);
686
+ const systemPrompt = this.getSystemPrompt();
687
+ return `${frontmatter}
688
+
689
+ ${systemPrompt}`;
690
+ }
691
+ /**
692
+ * Get the power content by combining frontmatter template with dynamic system prompt
693
+ * (Used by Kiro which uses a different frontmatter format)
694
+ * The frontmatter is loaded from resources/templates/skills/POWER.md
695
+ * The body is generated dynamically from generateSystemPrompt()
696
+ */
697
+ async getPowerTemplate() {
698
+ const frontmatterPath = this.resolveSkillTemplatePath("POWER.md");
699
+ const frontmatter = await this.loadAndProcessTemplate(frontmatterPath);
700
+ const systemPrompt = this.getSystemPrompt();
701
+ return `${frontmatter}
702
+
703
+ ${systemPrompt}`;
704
+ }
705
+ /**
706
+ * Resolve the path to a skill template file
707
+ */
708
+ resolveSkillTemplatePath(filename) {
709
+ const possiblePaths = [
710
+ // Local development - resources symlinked
711
+ join4(__dirname2, "..", "resources", "templates", "skills", filename),
712
+ // From dist directory
713
+ join4(__dirname2, "..", "..", "resources", "templates", "skills", filename),
714
+ // Root resources
715
+ join4(
716
+ __dirname2,
717
+ "..",
718
+ "..",
719
+ "..",
720
+ "resources",
721
+ "templates",
722
+ "skills",
723
+ filename
724
+ ),
725
+ // From core package
726
+ join4(
727
+ __dirname2,
728
+ "..",
729
+ "..",
730
+ "core",
731
+ "resources",
732
+ "templates",
733
+ "skills",
734
+ filename
735
+ )
736
+ ];
737
+ for (const templatePath of possiblePaths) {
738
+ if (existsSync2(templatePath)) {
739
+ return templatePath;
740
+ }
741
+ }
742
+ throw new Error(
743
+ `Skill template not found: ${filename}. Searched paths: ${possiblePaths.join(", ")}`
744
+ );
745
+ }
746
+ /**
747
+ * Load and process a template file, substituting version placeholders
748
+ */
749
+ async loadAndProcessTemplate(templatePath) {
750
+ try {
751
+ const content = await readFile2(templatePath, "utf-8");
752
+ const version = await getVersion();
753
+ return content.replace(/\$\{VERSION\}/g, version);
754
+ } catch (error) {
755
+ throw new Error(`Failed to load skill template: ${error}`);
756
+ }
757
+ }
758
+ };
759
+ var ClaudeSkillGenerator = class extends SkillGenerator {
760
+ async generate(outputDir) {
761
+ const paths = getSkillPaths("claude", outputDir);
762
+ const skillContent = await this.getSkillTemplate();
763
+ await this.writeFile(paths.skillFile, skillContent);
764
+ await this.writeMcpConfig(paths);
765
+ }
766
+ };
767
+ var GeminiSkillGenerator = class extends SkillGenerator {
768
+ async generate(outputDir) {
769
+ const paths = getSkillPaths("gemini", outputDir);
770
+ const skillContent = await this.getSkillTemplate();
771
+ await this.writeFile(paths.skillFile, skillContent);
772
+ await this.writeMcpConfig(paths);
773
+ }
774
+ };
775
+ var OpenCodeSkillGenerator = class extends SkillGenerator {
776
+ async generate(outputDir) {
777
+ const paths = getSkillPaths("opencode", outputDir);
778
+ const skillContent = await this.getSkillTemplate();
779
+ await this.writeFile(paths.skillFile, skillContent);
780
+ await this.writeOpencodeMcpConfig(paths);
781
+ }
782
+ /**
783
+ * Write OpenCode-specific MCP configuration
784
+ * OpenCode uses a different format: type: "local" and command as array
785
+ */
786
+ async writeOpencodeMcpConfig(paths) {
787
+ const isWindows = process.platform.startsWith("win");
788
+ const mcpConfig = {
789
+ workflows: {
790
+ type: "local",
791
+ command: isWindows ? ["cmd", "/c", "npx", "@codemcp/workflows-server@latest"] : ["npx", "@codemcp/workflows-server@latest"]
792
+ }
793
+ };
794
+ const configContent = {
795
+ $schema: "https://opencode.ai/config.json",
796
+ mcp: mcpConfig
797
+ };
798
+ await this.writeFile(
799
+ paths.mcpConfigPath,
800
+ JSON.stringify(configContent, null, 2)
801
+ );
802
+ }
803
+ };
804
+ var CopilotSkillGenerator = class extends SkillGenerator {
805
+ async generate(outputDir) {
806
+ const paths = getSkillPaths("copilot", outputDir);
807
+ const skillContent = await this.getSkillTemplate();
808
+ await this.writeFile(paths.skillFile, skillContent);
809
+ await this.writeMcpConfig(paths);
810
+ }
811
+ };
812
+ var KiroSkillGenerator = class extends SkillGenerator {
813
+ async generate(outputDir) {
814
+ const paths = getSkillPaths("kiro", outputDir);
815
+ const skillContent = await this.getPowerTemplate();
816
+ await this.writeFile(paths.skillFile, skillContent);
817
+ await this.writeKiroMcpConfig(paths);
818
+ }
819
+ /**
820
+ * Write Kiro-specific MCP configuration (command + args format)
821
+ */
822
+ async writeKiroMcpConfig(paths) {
823
+ const mcpConfig = this.getKiroMcpConfig();
824
+ const configContent = { mcpServers: mcpConfig };
825
+ await this.writeFile(
826
+ paths.mcpConfigPath,
827
+ JSON.stringify(configContent, null, 2)
828
+ );
829
+ }
830
+ };
831
+ var KiroCliSkillGenerator = class extends SkillGenerator {
832
+ async generate(outputDir) {
833
+ const paths = getSkillPaths("kiro-cli", outputDir);
834
+ const skillContent = await this.getSkillTemplate();
835
+ await this.writeFile(paths.skillFile, skillContent);
836
+ await this.writeKiroMcpConfig(paths);
837
+ }
838
+ /**
839
+ * Write Kiro-specific MCP configuration (command + args format)
840
+ */
841
+ async writeKiroMcpConfig(paths) {
842
+ const mcpConfig = this.getKiroMcpConfig();
843
+ const configContent = { mcpServers: mcpConfig };
844
+ await this.writeFile(
845
+ paths.mcpConfigPath,
846
+ JSON.stringify(configContent, null, 2)
847
+ );
848
+ }
849
+ };
850
+ var SkillGeneratorRegistry = class {
851
+ static generators = /* @__PURE__ */ new Map();
852
+ /**
853
+ * Register a generator with its metadata
854
+ */
855
+ static register(metadata) {
856
+ this.generators.set(metadata.name.toLowerCase(), metadata);
857
+ if (metadata.aliases) {
858
+ for (const alias of metadata.aliases) {
859
+ this.generators.set(alias.toLowerCase(), metadata);
860
+ }
861
+ }
862
+ }
863
+ /**
864
+ * Create a generator instance by name or alias
865
+ */
866
+ static createGenerator(name) {
867
+ const metadata = this.generators.get(name.toLowerCase());
868
+ if (!metadata) {
869
+ const available = this.getGeneratorNames().join(", ");
870
+ throw new Error(
871
+ `Unsupported platform: ${name}. Supported platforms: ${available}`
872
+ );
873
+ }
874
+ return new metadata.generatorClass();
875
+ }
876
+ /**
877
+ * Get all unique registered generators (without duplicates from aliases)
878
+ */
879
+ static getAllGenerators() {
880
+ const unique = /* @__PURE__ */ new Map();
881
+ for (const metadata of this.generators.values()) {
882
+ unique.set(metadata.name, metadata);
883
+ }
884
+ return Array.from(unique.values());
885
+ }
886
+ /**
887
+ * Get list of primary generator names
888
+ */
889
+ static getGeneratorNames() {
890
+ return this.getAllGenerators().map((g) => g.name);
891
+ }
892
+ /**
893
+ * Get formatted help text for all generators
894
+ */
895
+ static getHelpText() {
896
+ return this.getAllGenerators().map((g) => ` ${g.name.padEnd(20)} ${g.description}`).join("\n");
897
+ }
898
+ /**
899
+ * Check if a generator exists by name or alias
900
+ */
901
+ static exists(name) {
902
+ return this.generators.has(name.toLowerCase());
903
+ }
904
+ };
905
+ SkillGeneratorRegistry.register({
906
+ name: "claude",
907
+ description: "Generate skill for Claude Code / Claude Desktop",
908
+ aliases: ["claude-code", "claude-desktop"],
909
+ generatorClass: ClaudeSkillGenerator
910
+ });
911
+ SkillGeneratorRegistry.register({
912
+ name: "gemini",
913
+ description: "Generate skill for Gemini CLI",
914
+ aliases: ["gemini-cli"],
915
+ generatorClass: GeminiSkillGenerator
916
+ });
917
+ SkillGeneratorRegistry.register({
918
+ name: "opencode",
919
+ description: "Generate skill for OpenCode",
920
+ generatorClass: OpenCodeSkillGenerator
921
+ });
922
+ SkillGeneratorRegistry.register({
923
+ name: "copilot",
924
+ description: "Generate skill for GitHub Copilot",
925
+ aliases: ["github-copilot", "copilot-vscode", "vscode"],
926
+ generatorClass: CopilotSkillGenerator
927
+ });
928
+ SkillGeneratorRegistry.register({
929
+ name: "kiro",
930
+ description: "Generate power for Kiro IDE (POWER.md + bundled mcp.json)",
931
+ generatorClass: KiroSkillGenerator
932
+ });
933
+ SkillGeneratorRegistry.register({
934
+ name: "kiro-cli",
935
+ description: "Generate skill for Kiro/Amazon Q CLI (SKILL.md + mcp.json)",
936
+ aliases: ["amazonq", "amazonq-cli"],
937
+ generatorClass: KiroCliSkillGenerator
938
+ });
939
+ async function generateSkill(platform, outputDir = ".") {
940
+ console.log(`Generating skill for ${platform}...`);
941
+ const generator = SkillGeneratorRegistry.createGenerator(platform);
942
+ await generator.generate(outputDir);
943
+ console.log(`\u2705 Skill generated successfully for ${platform}`);
944
+ }
945
+
946
+ // src/cli.ts
947
+ var __filename3 = fileURLToPath3(import.meta.url);
948
+ var __dirname3 = dirname3(__filename3);
949
+ var isLocal = existsSync3(join5(__dirname3, "../../core/dist/index.js"));
950
+ var generateSystemPrompt2;
951
+ var StateMachineLoader2;
952
+ if (isLocal) {
953
+ const coreModule = await import("./dist-KZOA4GL5.js");
954
+ generateSystemPrompt2 = coreModule.generateSystemPrompt;
955
+ StateMachineLoader2 = coreModule.StateMachineLoader;
956
+ } else {
957
+ const coreModule = await import("./dist-KZOA4GL5.js");
958
+ generateSystemPrompt2 = coreModule.generateSystemPrompt;
959
+ StateMachineLoader2 = coreModule.StateMachineLoader;
960
+ }
961
+ async function parseCliArgs() {
962
+ const args = process.argv.slice(2);
963
+ if (args.includes("--help") || args.includes("-h")) {
964
+ showHelp();
965
+ return { shouldExit: true };
966
+ }
967
+ const command = args[0];
968
+ if (command === "setup") {
969
+ const subcommand = args[1];
970
+ if (subcommand === "list") {
971
+ handleSetupList();
972
+ return { shouldExit: true };
973
+ } else if (subcommand) {
974
+ const modeIndex = args.findIndex((arg) => arg === "--mode");
975
+ const mode = modeIndex !== -1 ? args[modeIndex + 1] : "skill";
976
+ if (mode !== "skill" && mode !== "config") {
977
+ console.error('\u274C Error: --mode must be "skill" or "config"');
978
+ process.exit(1);
979
+ }
980
+ await handleSetup(subcommand, mode);
981
+ return { shouldExit: true };
982
+ } else {
983
+ console.error("\u274C Error: setup requires a target");
984
+ console.error("Usage: setup <target> [--mode config|skill]");
985
+ console.error(" setup list");
986
+ process.exit(1);
987
+ }
988
+ }
989
+ if (command === "workflow") {
990
+ const subcommand = args[1];
991
+ if (subcommand === "list") {
992
+ handleWorkflowList();
993
+ return { shouldExit: true };
994
+ } else if (subcommand === "copy") {
995
+ const sourceWorkflow = args[2];
996
+ const customName = args[3];
997
+ if (!sourceWorkflow || !customName) {
998
+ console.error(
999
+ "\u274C Error: workflow copy requires source workflow and custom name"
1000
+ );
1001
+ console.error("Usage: workflow copy <source-workflow> <custom-name>");
1002
+ process.exit(1);
1003
+ }
1004
+ handleWorkflowCopy(sourceWorkflow, customName);
1005
+ return { shouldExit: true };
1006
+ } else {
1007
+ console.error("\u274C Unknown workflow subcommand:", subcommand);
1008
+ console.error("Available: workflow list, workflow copy <source> <name>");
1009
+ process.exit(1);
1010
+ }
1011
+ }
1012
+ if (command === "crowd") {
1013
+ const subcommand = args[1];
1014
+ if (subcommand === "list") {
1015
+ handleCrowdList();
1016
+ return { shouldExit: true };
1017
+ } else if (subcommand === "copy") {
1018
+ const outputDirIndex = args.findIndex((arg) => arg === "--output-dir");
1019
+ const outputDir = outputDirIndex !== -1 ? args[outputDirIndex + 1] : void 0;
1020
+ handleCrowdCopy(outputDir);
1021
+ return { shouldExit: true };
1022
+ } else {
1023
+ console.error("\u274C Unknown crowd subcommand:", subcommand);
1024
+ console.error("Available: crowd list, crowd copy [--output-dir DIR]");
1025
+ process.exit(1);
1026
+ }
1027
+ }
1028
+ if (command === "visualize" || args.length === 0) {
1029
+ startVisualizationTool();
1030
+ return { shouldExit: true };
1031
+ }
1032
+ if (command === "validate") {
1033
+ const workflowPath = args[1];
1034
+ if (!workflowPath) {
1035
+ console.error("\u274C Error: validate requires a workflow file path");
1036
+ console.error("Usage: validate <workflow-file.yaml>");
1037
+ process.exit(1);
1038
+ }
1039
+ handleValidateWorkflow(workflowPath);
1040
+ return { shouldExit: true };
1041
+ }
1042
+ if (command === "system-prompt") {
1043
+ showSystemPrompt();
1044
+ return { shouldExit: true };
1045
+ }
1046
+ if (args.includes("--generate-config")) {
1047
+ const targetIndex = args.findIndex((arg) => arg === "--generate-config") + 1;
1048
+ const target = args[targetIndex] || "<target>";
1049
+ console.warn("\u26A0\uFE0F DEPRECATED: --generate-config is deprecated.");
1050
+ console.warn(` Use instead: setup ${target} --mode config`);
1051
+ console.warn("");
1052
+ console.warn(' Run "setup list" to see available targets.');
1053
+ return { shouldExit: true };
1054
+ }
1055
+ if (args.includes("--validate")) {
1056
+ const fileIndex = args.findIndex((arg) => arg === "--validate") + 1;
1057
+ const file = args[fileIndex] || "<workflow.yaml>";
1058
+ console.warn("\u26A0\uFE0F DEPRECATED: --validate is deprecated.");
1059
+ console.warn(` Use instead: validate ${file}`);
1060
+ return { shouldExit: true };
1061
+ }
1062
+ if (args.includes("--system-prompt")) {
1063
+ console.warn("\u26A0\uFE0F DEPRECATED: --system-prompt is deprecated.");
1064
+ console.warn(" Use instead: system-prompt");
1065
+ return { shouldExit: true };
1066
+ }
1067
+ if (args.includes("--visualize") || args.includes("--viz")) {
1068
+ console.warn("\u26A0\uFE0F DEPRECATED: --visualize/--viz is deprecated.");
1069
+ console.warn(" Use instead: visualize");
1070
+ console.warn(" Or simply run with no arguments (default behavior).");
1071
+ return { shouldExit: true };
1072
+ }
1073
+ if (command === "agents") {
1074
+ const subcommand = args[1] || "";
1075
+ console.warn('\u26A0\uFE0F DEPRECATED: "agents" subcommand is renamed to "crowd".');
1076
+ console.warn(` Use instead: crowd ${subcommand}`);
1077
+ return { shouldExit: true };
1078
+ }
1079
+ if (command === "skill") {
1080
+ const subcommand = args[1];
1081
+ if (subcommand === "list") {
1082
+ console.warn('\u26A0\uFE0F DEPRECATED: "skill list" is deprecated.');
1083
+ console.warn(" Use instead: setup list");
1084
+ } else {
1085
+ console.warn(
1086
+ '\u26A0\uFE0F DEPRECATED: "skill" subcommand is merged into "setup".'
1087
+ );
1088
+ console.warn(` Use instead: setup ${subcommand || "<target>"}`);
1089
+ }
1090
+ return { shouldExit: true };
1091
+ }
1092
+ console.error("\u274C Unknown command:", args.join(" "));
1093
+ showHelp();
1094
+ return { shouldExit: true };
1095
+ }
1096
+ function handleValidateWorkflow(workflowPath) {
1097
+ try {
1098
+ console.log(`\u{1F50D} Validating workflow: ${workflowPath}`);
1099
+ const loader = new StateMachineLoader2();
1100
+ const workflow = loader.loadFromFile(workflowPath);
1101
+ console.log("\u2705 Workflow validation successful!");
1102
+ console.log(`\u{1F4CB} Workflow: ${workflow.name}`);
1103
+ console.log(`\u{1F4DD} Description: ${workflow.description}`);
1104
+ console.log(`\u{1F3C1} Initial state: ${workflow.initial_state}`);
1105
+ console.log(`\u{1F504} States: ${Object.keys(workflow.states).join(", ")}`);
1106
+ if (workflow.metadata) {
1107
+ console.log(`\u{1F3F7}\uFE0F Domain: ${workflow.metadata.domain || "not specified"}`);
1108
+ console.log(
1109
+ `\u26A1 Complexity: ${workflow.metadata.complexity || "not specified"}`
1110
+ );
1111
+ }
1112
+ } catch (error) {
1113
+ console.error("\u274C Workflow validation failed:");
1114
+ console.error(error.message);
1115
+ process.exit(1);
1116
+ }
1117
+ }
1118
+ function handleWorkflowList() {
1119
+ try {
1120
+ const workflowManager = new WorkflowManager();
1121
+ const workflows = workflowManager.getAvailableWorkflowsForProject(
1122
+ process.cwd()
1123
+ );
1124
+ console.log("\u{1F4CB} Available workflows:");
1125
+ for (const w of workflows) {
1126
+ console.log(` ${w.name.padEnd(12)} - ${w.description}`);
1127
+ }
1128
+ } catch (error) {
1129
+ console.error("Error listing workflows:", error);
1130
+ process.exit(1);
1131
+ }
1132
+ }
1133
+ function handleWorkflowCopy(sourceWorkflow, customName) {
1134
+ try {
1135
+ const workflowManager = new WorkflowManager();
1136
+ const allWorkflows = workflowManager.getAllAvailableWorkflows();
1137
+ const validWorkflow = allWorkflows.find((w) => w.name === sourceWorkflow);
1138
+ if (!validWorkflow) {
1139
+ console.error(`\u274C Invalid source workflow: ${sourceWorkflow}`);
1140
+ console.error(
1141
+ `Available workflows: ${allWorkflows.map((w) => w.name).join(", ")}`
1142
+ );
1143
+ process.exit(1);
1144
+ }
1145
+ const possibleSourcePaths = [
1146
+ join5(
1147
+ __dirname3,
1148
+ "..",
1149
+ "..",
1150
+ "..",
1151
+ "resources",
1152
+ "workflows",
1153
+ `${sourceWorkflow}.yaml`
1154
+ ),
1155
+ join5(
1156
+ __dirname3,
1157
+ "..",
1158
+ "..",
1159
+ "core",
1160
+ "resources",
1161
+ "workflows",
1162
+ `${sourceWorkflow}.yaml`
1163
+ ),
1164
+ join5(process.cwd(), "resources", "workflows", `${sourceWorkflow}.yaml`)
1165
+ ];
1166
+ const foundPath = possibleSourcePaths.find((p) => existsSync3(p));
1167
+ if (!foundPath) {
1168
+ console.error(`\u274C Could not find source workflow: ${sourceWorkflow}`);
1169
+ process.exit(1);
1170
+ }
1171
+ const sourceContent = readFileSync(foundPath, "utf8");
1172
+ const vibeDir = join5(process.cwd(), ".vibe");
1173
+ const workflowsDir = join5(vibeDir, "workflows");
1174
+ if (!existsSync3(vibeDir)) {
1175
+ mkdirSync(vibeDir, { recursive: true });
1176
+ }
1177
+ if (!existsSync3(workflowsDir)) {
1178
+ mkdirSync(workflowsDir, { recursive: true });
1179
+ }
1180
+ const customContent = sourceContent.replace(
1181
+ new RegExp(`name: '${sourceWorkflow}'`, "g"),
1182
+ `name: '${customName}'`
1183
+ );
1184
+ const workflowPath = join5(workflowsDir, `${customName}.yaml`);
1185
+ if (existsSync3(workflowPath)) {
1186
+ console.error(
1187
+ `\u274C Workflow '${customName}' already exists at ${workflowPath}`
1188
+ );
1189
+ process.exit(1);
1190
+ }
1191
+ writeFileSync(workflowPath, customContent);
1192
+ console.log(
1193
+ `\u2705 Copied '${sourceWorkflow}' workflow to '${customName}' at ${workflowPath}`
1194
+ );
1195
+ console.log("\u{1F4A1} Edit the file to customize your workflow");
1196
+ } catch (error) {
1197
+ console.error("Error copying workflow:", error);
1198
+ process.exit(1);
1199
+ }
1200
+ }
1201
+ async function handleSetup(target, mode) {
1202
+ try {
1203
+ const isSkillTarget = SkillGeneratorRegistry.exists(target);
1204
+ const isConfigTarget = GeneratorRegistry.exists(target);
1205
+ if (!isSkillTarget && !isConfigTarget) {
1206
+ const skillTargets = SkillGeneratorRegistry.getGeneratorNames();
1207
+ const configTargets = GeneratorRegistry.getGeneratorNames();
1208
+ const allTargets = [.../* @__PURE__ */ new Set([...skillTargets, ...configTargets])];
1209
+ console.error(`\u274C Unknown target: ${target}`);
1210
+ console.error(`Available targets: ${allTargets.join(", ")}`);
1211
+ process.exit(1);
1212
+ }
1213
+ if (mode === "config") {
1214
+ if (!isConfigTarget) {
1215
+ const configTargets = GeneratorRegistry.getGeneratorNames();
1216
+ console.error(`\u274C Target "${target}" does not support config mode`);
1217
+ console.error(`Config mode targets: ${configTargets.join(", ")}`);
1218
+ process.exit(1);
1219
+ }
1220
+ await generateConfig(target, process.cwd());
1221
+ } else {
1222
+ if (!isSkillTarget) {
1223
+ const skillTargets = SkillGeneratorRegistry.getGeneratorNames();
1224
+ console.error(`\u274C Target "${target}" does not support skill mode`);
1225
+ console.error(`Skill mode targets: ${skillTargets.join(", ")}`);
1226
+ console.error(`\u{1F4A1} Try: setup ${target} --mode config`);
1227
+ process.exit(1);
1228
+ }
1229
+ await generateSkill(target, process.cwd());
1230
+ }
1231
+ } catch (error) {
1232
+ console.error(`\u274C Failed to generate ${mode}: ${error}`);
1233
+ process.exit(1);
1234
+ }
1235
+ }
1236
+ function handleSetupList() {
1237
+ const skillTargets = SkillGeneratorRegistry.getGeneratorNames();
1238
+ const configTargets = GeneratorRegistry.getGeneratorNames();
1239
+ const allTargets = [.../* @__PURE__ */ new Set([...skillTargets, ...configTargets])].sort();
1240
+ console.log("\u{1F4CB} Available setup targets:\n");
1241
+ console.log(" Target".padEnd(20) + "Modes");
1242
+ console.log(" " + "-".repeat(35));
1243
+ for (const target of allTargets) {
1244
+ const modes = [];
1245
+ if (skillTargets.includes(target)) modes.push("skill");
1246
+ if (configTargets.includes(target)) modes.push("config");
1247
+ console.log(` ${target.padEnd(18)} ${modes.join(", ")}`);
1248
+ }
1249
+ console.log("\n\u{1F4A1} Usage:");
1250
+ console.log(" setup <target> Generate skill files (default)");
1251
+ console.log(
1252
+ " setup <target> --mode config Generate full agent configuration"
1253
+ );
1254
+ console.log(" setup <target> --mode skill Generate skill files only");
1255
+ }
1256
+ function handleCrowdList() {
1257
+ try {
1258
+ const possibleAgentsPaths = [
1259
+ join5(__dirname3, "..", "..", "..", "resources", "agents"),
1260
+ join5(__dirname3, "..", "..", "core", "resources", "agents")
1261
+ ];
1262
+ let agentsDir = null;
1263
+ for (const path of possibleAgentsPaths) {
1264
+ if (existsSync3(path)) {
1265
+ agentsDir = path;
1266
+ break;
1267
+ }
1268
+ }
1269
+ if (!agentsDir) {
1270
+ console.error("\u274C Could not find agents directory");
1271
+ process.exit(1);
1272
+ }
1273
+ const files = readdirSync(agentsDir).filter(
1274
+ (f) => f.endsWith(".yaml") || f.endsWith(".yml")
1275
+ );
1276
+ if (files.length === 0) {
1277
+ console.log("\u{1F4CB} No crowd agent configurations found");
1278
+ return;
1279
+ }
1280
+ console.log("\u{1F4CB} Available crowd agent configurations:\n");
1281
+ for (const file of files) {
1282
+ const agentPath = join5(agentsDir, file);
1283
+ const content = readFileSync(agentPath, "utf8");
1284
+ const nameMatch = content.match(/^name:\s*(.+)$/m);
1285
+ const displayNameMatch = content.match(/^displayName:\s*(.+)$/m);
1286
+ const name = nameMatch ? nameMatch[1]?.trim() ?? file.replace(/\.ya?ml$/, "") : file.replace(/\.ya?ml$/, "");
1287
+ const displayName = displayNameMatch?.[1]?.trim() ?? name;
1288
+ console.log(` ${name.padEnd(18)} ${displayName}`);
1289
+ }
1290
+ console.log(
1291
+ '\n\u{1F4A1} Use "crowd copy" to copy these configurations to your project'
1292
+ );
1293
+ } catch (error) {
1294
+ console.error("Error listing crowd agents:", error);
1295
+ process.exit(1);
1296
+ }
1297
+ }
1298
+ function handleCrowdCopy(outputDir) {
1299
+ try {
1300
+ const possibleAgentsPaths = [
1301
+ join5(__dirname3, "..", "..", "..", "resources", "agents"),
1302
+ join5(__dirname3, "..", "..", "core", "resources", "agents")
1303
+ ];
1304
+ let sourceAgentsDir = null;
1305
+ for (const path of possibleAgentsPaths) {
1306
+ if (existsSync3(path)) {
1307
+ sourceAgentsDir = path;
1308
+ break;
1309
+ }
1310
+ }
1311
+ if (!sourceAgentsDir) {
1312
+ console.error("\u274C Could not find source agents directory");
1313
+ process.exit(1);
1314
+ }
1315
+ const targetDir = outputDir || join5(process.cwd(), ".crowd", "agents");
1316
+ if (!existsSync3(targetDir)) {
1317
+ mkdirSync(targetDir, { recursive: true });
1318
+ }
1319
+ const files = readdirSync(sourceAgentsDir).filter(
1320
+ (f) => f.endsWith(".yaml") || f.endsWith(".yml")
1321
+ );
1322
+ if (files.length === 0) {
1323
+ console.error("\u274C No crowd agent configurations found to copy");
1324
+ process.exit(1);
1325
+ }
1326
+ console.log(
1327
+ `\u{1F4CB} Copying ${files.length} crowd agent configuration(s) to ${targetDir}
1328
+ `
1329
+ );
1330
+ let copiedCount = 0;
1331
+ let skippedCount = 0;
1332
+ for (const file of files) {
1333
+ const sourcePath = join5(sourceAgentsDir, file);
1334
+ const targetPath = join5(targetDir, file);
1335
+ if (existsSync3(targetPath)) {
1336
+ console.log(`\u23ED\uFE0F ${file} (already exists, skipping)`);
1337
+ skippedCount++;
1338
+ } else {
1339
+ const content = readFileSync(sourcePath, "utf8");
1340
+ writeFileSync(targetPath, content);
1341
+ console.log(`\u2705 ${file}`);
1342
+ copiedCount++;
1343
+ }
1344
+ }
1345
+ console.log(
1346
+ `
1347
+ \u{1F389} Copied ${copiedCount} crowd agent configuration(s)${skippedCount > 0 ? ` (skipped ${skippedCount} existing)` : ""}`
1348
+ );
1349
+ console.log(`
1350
+ \u{1F4A1} Crowd agent configurations are now in: ${targetDir}`);
1351
+ console.log("\u{1F4A1} Configure these agents in your crowd-mcp setup");
1352
+ } catch (error) {
1353
+ console.error("Error copying crowd agents:", error);
1354
+ process.exit(1);
1355
+ }
1356
+ }
1357
+ function showHelp() {
1358
+ const skillTargets = SkillGeneratorRegistry.getGeneratorNames();
1359
+ const configTargets = GeneratorRegistry.getGeneratorNames();
1360
+ const allTargets = [.../* @__PURE__ */ new Set([...skillTargets, ...configTargets])].sort();
1361
+ console.log(`
1362
+ Responsible Vibe CLI Tools
1363
+
1364
+ USAGE:
1365
+ npx @codemcp/workflows [COMMAND]
1366
+ npx @codemcp/workflows Start the interactive visualizer (default)
1367
+
1368
+ SETUP COMMANDS:
1369
+ setup <target> Generate skill files for a coding tool (default mode)
1370
+ setup <target> --mode config Generate full agent configuration
1371
+ setup <target> --mode skill Generate skill files only
1372
+ setup list List available targets
1373
+
1374
+ WORKFLOW COMMANDS:
1375
+ workflow list List available workflows
1376
+ workflow copy <source> <name> Copy a workflow with custom name
1377
+
1378
+ CROWD AGENT COMMANDS:
1379
+ crowd list List available crowd agent configurations
1380
+ crowd copy [--output-dir DIR] Copy crowd agent configs to project
1381
+
1382
+ UTILITY COMMANDS:
1383
+ visualize Start the interactive workflow visualizer
1384
+ validate <workflow.yaml> Validate a workflow file
1385
+ system-prompt Show the system prompt for LLM integration
1386
+
1387
+ OPTIONS:
1388
+ --help, -h Show this help message
1389
+
1390
+ AVAILABLE TARGETS:
1391
+ ${allTargets.join(", ")}
1392
+
1393
+ DESCRIPTION:
1394
+ CLI tools for the responsible-vibe development workflow system.
1395
+ By default, starts the interactive workflow visualizer.
1396
+
1397
+ MORE INFO:
1398
+ GitHub: https://github.com/mrsimpson/responsible-vibe-mcp
1399
+ npm: https://www.npmjs.com/package/@codemcp/workflows
1400
+ `);
1401
+ }
1402
+ function showSystemPrompt() {
1403
+ try {
1404
+ const loader = new StateMachineLoader2();
1405
+ const stateMachine = loader.loadStateMachine(process.cwd());
1406
+ const systemPrompt = generateSystemPrompt2(stateMachine);
1407
+ console.log(systemPrompt);
1408
+ } catch (error) {
1409
+ console.error("Error generating system prompt:", error);
1410
+ process.exit(1);
1411
+ }
1412
+ }
1413
+ async function runCli() {
1414
+ const { shouldExit } = await parseCliArgs();
1415
+ if (shouldExit) {
1416
+ return;
1417
+ }
1418
+ }
1419
+ export {
1420
+ runCli
1421
+ };