bmad-method 6.12.3 → 7.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 (388) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +107 -54
  3. package/agents.json +640 -0
  4. package/bin/bmad-method.js +4 -0
  5. package/messages.yaml +260 -0
  6. package/modules.yaml +56 -0
  7. package/package.json +32 -110
  8. package/src/agent-picks.js +77 -0
  9. package/src/agents.js +141 -0
  10. package/src/bmad-scripts.js +167 -0
  11. package/src/cli.js +266 -0
  12. package/src/commands/agent-choice.js +67 -0
  13. package/src/commands/apply.js +38 -0
  14. package/src/commands/deps.js +25 -0
  15. package/src/commands/ending.js +54 -0
  16. package/src/commands/existing-install.js +50 -0
  17. package/src/commands/install-plan.js +130 -0
  18. package/src/commands/install-steps.js +66 -0
  19. package/src/commands/install.js +86 -0
  20. package/src/commands/status.js +39 -0
  21. package/src/commands/update.js +106 -0
  22. package/src/installed.js +48 -0
  23. package/src/messages.js +84 -0
  24. package/src/modules.js +221 -0
  25. package/src/preflight.js +124 -0
  26. package/src/project-lock.js +68 -0
  27. package/src/prompts.js +626 -0
  28. package/src/report.js +199 -0
  29. package/src/run.js +124 -0
  30. package/src/self-update.js +88 -0
  31. package/src/skills-cli.js +133 -0
  32. package/src/version.js +11 -0
  33. package/.claude-plugin/marketplace.json +0 -53
  34. package/AGENTS.md +0 -24
  35. package/CLAUDE.md +0 -1
  36. package/README_CN.md +0 -98
  37. package/README_KR.md +0 -90
  38. package/README_VN.md +0 -99
  39. package/bmad-modules.yaml +0 -140
  40. package/body.md +0 -17
  41. package/greptile.json +0 -52
  42. package/removals.txt +0 -87
  43. package/src/bmm-skills/agents/bmad-agent-analyst/SKILL.md +0 -76
  44. package/src/bmm-skills/agents/bmad-agent-analyst/customize.toml +0 -103
  45. package/src/bmm-skills/agents/bmad-agent-architect/SKILL.md +0 -76
  46. package/src/bmm-skills/agents/bmad-agent-architect/customize.toml +0 -63
  47. package/src/bmm-skills/agents/bmad-agent-dev/SKILL.md +0 -76
  48. package/src/bmm-skills/agents/bmad-agent-dev/customize.toml +0 -81
  49. package/src/bmm-skills/agents/bmad-agent-pm/SKILL.md +0 -76
  50. package/src/bmm-skills/agents/bmad-agent-pm/customize.toml +0 -73
  51. package/src/bmm-skills/agents/bmad-agent-ux-designer/SKILL.md +0 -76
  52. package/src/bmm-skills/agents/bmad-agent-ux-designer/customize.toml +0 -58
  53. package/src/bmm-skills/module-help.csv +0 -19
  54. package/src/bmm-skills/module.yaml +0 -85
  55. package/src/bmm-skills/plan/bmad-architecture/SKILL.md +0 -85
  56. package/src/bmm-skills/plan/bmad-architecture/assets/spine-template.md +0 -79
  57. package/src/bmm-skills/plan/bmad-architecture/customize.toml +0 -101
  58. package/src/bmm-skills/plan/bmad-architecture/references/headless.md +0 -26
  59. package/src/bmm-skills/plan/bmad-architecture/references/reviewer-gate.md +0 -13
  60. package/src/bmm-skills/plan/bmad-architecture/scripts/lint_spine.py +0 -261
  61. package/src/bmm-skills/plan/bmad-architecture/scripts/tests/test_lint_spine.py +0 -270
  62. package/src/bmm-skills/plan/bmad-create-epics-and-stories/SKILL.md +0 -93
  63. package/src/bmm-skills/plan/bmad-create-epics-and-stories/customize.toml +0 -39
  64. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -263
  65. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -242
  66. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
  67. package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -141
  68. package/src/bmm-skills/plan/bmad-create-epics-and-stories/templates/epics-template.md +0 -62
  69. package/src/bmm-skills/plan/bmad-generate-project-context/SKILL.md +0 -12
  70. package/src/bmm-skills/plan/bmad-prd/SKILL.md +0 -94
  71. package/src/bmm-skills/plan/bmad-prd/assets/headless-schemas.md +0 -76
  72. package/src/bmm-skills/plan/bmad-prd/assets/prd-template.md +0 -165
  73. package/src/bmm-skills/plan/bmad-prd/assets/prd-validation-checklist.md +0 -135
  74. package/src/bmm-skills/plan/bmad-prd/assets/validation-report-template.html +0 -325
  75. package/src/bmm-skills/plan/bmad-prd/customize.toml +0 -148
  76. package/src/bmm-skills/plan/bmad-prd/references/headless.md +0 -39
  77. package/src/bmm-skills/plan/bmad-prd/references/validate.md +0 -97
  78. package/src/bmm-skills/plan/bmad-prfaq/SKILL.md +0 -135
  79. package/src/bmm-skills/plan/bmad-prfaq/agents/artifact-analyzer.md +0 -60
  80. package/src/bmm-skills/plan/bmad-prfaq/agents/web-researcher.md +0 -49
  81. package/src/bmm-skills/plan/bmad-prfaq/assets/prfaq-template.md +0 -62
  82. package/src/bmm-skills/plan/bmad-prfaq/bmad-manifest.json +0 -16
  83. package/src/bmm-skills/plan/bmad-prfaq/customize.toml +0 -39
  84. package/src/bmm-skills/plan/bmad-prfaq/references/customer-faq.md +0 -55
  85. package/src/bmm-skills/plan/bmad-prfaq/references/internal-faq.md +0 -51
  86. package/src/bmm-skills/plan/bmad-prfaq/references/press-release.md +0 -60
  87. package/src/bmm-skills/plan/bmad-prfaq/references/verdict.md +0 -83
  88. package/src/bmm-skills/plan/bmad-product-brief/SKILL.md +0 -91
  89. package/src/bmm-skills/plan/bmad-product-brief/assets/brief-template.md +0 -41
  90. package/src/bmm-skills/plan/bmad-product-brief/customize.toml +0 -100
  91. package/src/bmm-skills/plan/bmad-project-context/SKILL.md +0 -121
  92. package/src/bmm-skills/plan/bmad-project-context/customize.toml +0 -24
  93. package/src/bmm-skills/plan/bmad-project-context/references/best-practices.md +0 -84
  94. package/src/bmm-skills/plan/bmad-project-context/references/template.md +0 -55
  95. package/src/bmm-skills/plan/bmad-spec/SKILL.md +0 -160
  96. package/src/bmm-skills/plan/bmad-spec/assets/headless-schemas.md +0 -33
  97. package/src/bmm-skills/plan/bmad-spec/assets/spec-template.md +0 -49
  98. package/src/bmm-skills/plan/bmad-spec/assets/stories-schema.md +0 -44
  99. package/src/bmm-skills/plan/bmad-spec/customize.toml +0 -52
  100. package/src/bmm-skills/plan/bmad-sprint-planning/SKILL.md +0 -62
  101. package/src/bmm-skills/plan/bmad-sprint-planning/customize.toml +0 -39
  102. package/src/bmm-skills/plan/bmad-sprint-planning/references/fix-sprint-status.md +0 -30
  103. package/src/bmm-skills/plan/bmad-sprint-planning/references/generate-tracking.md +0 -25
  104. package/src/bmm-skills/plan/bmad-sprint-planning/references/readiness-gate.md +0 -20
  105. package/src/bmm-skills/plan/bmad-sprint-planning/references/status-view.md +0 -14
  106. package/src/bmm-skills/plan/bmad-sprint-planning/references/validate.md +0 -10
  107. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/__pycache__/sprint_plan.cpython-311.pyc +0 -0
  108. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/sprint_plan.py +0 -701
  109. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/__pycache__/test_sprint_plan.cpython-311-pytest-9.1.1.pyc +0 -0
  110. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/test_sprint_plan.py +0 -524
  111. package/src/bmm-skills/plan/bmad-sprint-planning/sprint-status-template.yaml +0 -71
  112. package/src/bmm-skills/plan/bmad-ux/SKILL.md +0 -90
  113. package/src/bmm-skills/plan/bmad-ux/assets/color-themes.md +0 -9
  114. package/src/bmm-skills/plan/bmad-ux/assets/design-directions.md +0 -9
  115. package/src/bmm-skills/plan/bmad-ux/assets/design-example-editorial.md +0 -158
  116. package/src/bmm-skills/plan/bmad-ux/assets/design-example-mobile.md +0 -93
  117. package/src/bmm-skills/plan/bmad-ux/assets/design-example-shadcn.md +0 -109
  118. package/src/bmm-skills/plan/bmad-ux/assets/excalidraw-wireframe.md +0 -19
  119. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-mobile.md +0 -112
  120. package/src/bmm-skills/plan/bmad-ux/assets/experience-example-shadcn.md +0 -133
  121. package/src/bmm-skills/plan/bmad-ux/assets/headless-schemas.md +0 -84
  122. package/src/bmm-skills/plan/bmad-ux/assets/key-screens.md +0 -29
  123. package/src/bmm-skills/plan/bmad-ux/assets/validation-report-template.html +0 -319
  124. package/src/bmm-skills/plan/bmad-ux/customize.toml +0 -100
  125. package/src/bmm-skills/plan/bmad-ux/references/creative-tools.md +0 -19
  126. package/src/bmm-skills/plan/bmad-ux/references/design-md-spec.md +0 -50
  127. package/src/bmm-skills/plan/bmad-ux/references/headless.md +0 -37
  128. package/src/bmm-skills/plan/bmad-ux/references/validate.md +0 -115
  129. package/src/bmm-skills/ship/bmad-build/SKILL.md +0 -13
  130. package/src/bmm-skills/ship/bmad-build/compile-epic-context.md +0 -62
  131. package/src/bmm-skills/ship/bmad-build/customize.toml +0 -152
  132. package/src/bmm-skills/ship/bmad-build/references/claims-check.md +0 -14
  133. package/src/bmm-skills/ship/bmad-build/references/deletion-check.md +0 -14
  134. package/src/bmm-skills/ship/bmad-build/review-prompts/edge-case-hunter.md +0 -112
  135. package/src/bmm-skills/ship/bmad-build/review-prompts/verification-gap.md +0 -113
  136. package/src/bmm-skills/ship/bmad-build/spec-template.md +0 -111
  137. package/src/bmm-skills/ship/bmad-build/step-01-clarify-and-route.md +0 -100
  138. package/src/bmm-skills/ship/bmad-build/step-02-plan.md +0 -62
  139. package/src/bmm-skills/ship/bmad-build/step-03-implement.md +0 -51
  140. package/src/bmm-skills/ship/bmad-build/step-04-review.md +0 -85
  141. package/src/bmm-skills/ship/bmad-build/step-05-present.md +0 -43
  142. package/src/bmm-skills/ship/bmad-build/step-oneshot.md +0 -107
  143. package/src/bmm-skills/ship/bmad-build/sync-sprint-status.md +0 -5
  144. package/src/bmm-skills/ship/bmad-build/workflow.md +0 -84
  145. package/src/bmm-skills/ship/bmad-build-auto/SKILL.md +0 -13
  146. package/src/bmm-skills/ship/bmad-build-auto/compile-epic-context.md +0 -62
  147. package/src/bmm-skills/ship/bmad-build-auto/customize.toml +0 -119
  148. package/src/bmm-skills/ship/bmad-build-auto/references/claims-check.md +0 -14
  149. package/src/bmm-skills/ship/bmad-build-auto/references/deletion-check.md +0 -14
  150. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/edge-case-hunter.md +0 -112
  151. package/src/bmm-skills/ship/bmad-build-auto/review-prompts/verification-gap.md +0 -113
  152. package/src/bmm-skills/ship/bmad-build-auto/spec-template.md +0 -96
  153. package/src/bmm-skills/ship/bmad-build-auto/step-01-clarify-and-route.md +0 -84
  154. package/src/bmm-skills/ship/bmad-build-auto/step-02-plan.md +0 -27
  155. package/src/bmm-skills/ship/bmad-build-auto/step-03-implement.md +0 -48
  156. package/src/bmm-skills/ship/bmad-build-auto/step-04-review.md +0 -116
  157. package/src/bmm-skills/ship/bmad-build-auto/workflow.md +0 -104
  158. package/src/bmm-skills/ship/bmad-code-review/SKILL.md +0 -90
  159. package/src/bmm-skills/ship/bmad-code-review/customize.toml +0 -110
  160. package/src/bmm-skills/ship/bmad-code-review/references/claims-check.md +0 -14
  161. package/src/bmm-skills/ship/bmad-code-review/references/deletion-check.md +0 -14
  162. package/src/bmm-skills/ship/bmad-code-review/review-prompts/edge-case-hunter.md +0 -112
  163. package/src/bmm-skills/ship/bmad-code-review/review-prompts/verification-gap.md +0 -113
  164. package/src/bmm-skills/ship/bmad-code-review/steps/step-01-gather-context.md +0 -94
  165. package/src/bmm-skills/ship/bmad-code-review/steps/step-02-review.md +0 -32
  166. package/src/bmm-skills/ship/bmad-code-review/steps/step-03-triage.md +0 -54
  167. package/src/bmm-skills/ship/bmad-code-review/steps/step-04-present.md +0 -134
  168. package/src/bmm-skills/ship/bmad-correct-course/SKILL.md +0 -308
  169. package/src/bmm-skills/ship/bmad-correct-course/checklist.md +0 -288
  170. package/src/bmm-skills/ship/bmad-correct-course/customize.toml +0 -39
  171. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/SKILL.md +0 -176
  172. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/checklist.md +0 -33
  173. package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/customize.toml +0 -39
  174. package/src/bmm-skills/ship/bmad-retrospective/SKILL.md +0 -94
  175. package/src/bmm-skills/ship/bmad-retrospective/customize.toml +0 -39
  176. package/src/bmm-skills/ship/bmad-retrospective/references/acceptance-verdict.md +0 -55
  177. package/src/bmm-skills/ship/bmad-retrospective/references/aggregate-views.md +0 -17
  178. package/src/bmm-skills/ship/bmad-retrospective/references/evidence-gathering.md +0 -30
  179. package/src/bmm-skills/ship/bmad-retrospective/references/retro-document.md +0 -84
  180. package/src/bmm-skills/ship/bmad-retrospective/references/team-discussion.md +0 -22
  181. package/src/bmm-skills/ship/bmad-retrospective/scripts/__pycache__/sprint_status.cpython-311.pyc +0 -0
  182. package/src/bmm-skills/ship/bmad-retrospective/scripts/git_evidence.py +0 -308
  183. package/src/bmm-skills/ship/bmad-retrospective/scripts/sprint_status.py +0 -750
  184. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_git_evidence.cpython-311-pytest-9.1.1.pyc +0 -0
  185. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_sprint_status.cpython-311-pytest-9.1.1.pyc +0 -0
  186. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/fixtures/sprint-status-template.yaml +0 -71
  187. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_git_evidence.py +0 -750
  188. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_sprint_status.py +0 -1579
  189. package/src/bmm-skills/ship/bmad-walkthrough/SKILL.md +0 -68
  190. package/src/bmm-skills/ship/bmad-walkthrough/customize.toml +0 -39
  191. package/src/bmm-skills/ship/bmad-walkthrough/generate-trail.md +0 -38
  192. package/src/bmm-skills/ship/bmad-walkthrough/step-01-orientation.md +0 -105
  193. package/src/bmm-skills/ship/bmad-walkthrough/step-02-walkthrough.md +0 -89
  194. package/src/bmm-skills/ship/bmad-walkthrough/step-03-detail-pass.md +0 -106
  195. package/src/bmm-skills/ship/bmad-walkthrough/step-04-testing.md +0 -74
  196. package/src/bmm-skills/ship/bmad-walkthrough/step-05-wrapup.md +0 -30
  197. package/src/bmm-skills/v6-shims/README.md +0 -29
  198. package/src/bmm-skills/v6-shims/bmad-checkpoint-preview/SKILL.md +0 -21
  199. package/src/bmm-skills/v6-shims/bmad-create-architecture/SKILL.md +0 -32
  200. package/src/bmm-skills/v6-shims/bmad-create-architecture/customize.toml +0 -39
  201. package/src/bmm-skills/v6-shims/bmad-create-prd/SKILL.md +0 -32
  202. package/src/bmm-skills/v6-shims/bmad-create-prd/customize.toml +0 -39
  203. package/src/bmm-skills/v6-shims/bmad-create-story/SKILL.md +0 -436
  204. package/src/bmm-skills/v6-shims/bmad-create-story/checklist.md +0 -357
  205. package/src/bmm-skills/v6-shims/bmad-create-story/customize.toml +0 -39
  206. package/src/bmm-skills/v6-shims/bmad-create-story/discover-inputs.md +0 -88
  207. package/src/bmm-skills/v6-shims/bmad-create-story/template.md +0 -49
  208. package/src/bmm-skills/v6-shims/bmad-dev-auto/SKILL.md +0 -21
  209. package/src/bmm-skills/v6-shims/bmad-dev-story/SKILL.md +0 -504
  210. package/src/bmm-skills/v6-shims/bmad-dev-story/checklist.md +0 -80
  211. package/src/bmm-skills/v6-shims/bmad-dev-story/customize.toml +0 -39
  212. package/src/bmm-skills/v6-shims/bmad-document-project/SKILL.md +0 -16
  213. package/src/bmm-skills/v6-shims/bmad-domain-research/SKILL.md +0 -16
  214. package/src/bmm-skills/v6-shims/bmad-edit-prd/SKILL.md +0 -32
  215. package/src/bmm-skills/v6-shims/bmad-edit-prd/customize.toml +0 -40
  216. package/src/bmm-skills/v6-shims/bmad-market-research/SKILL.md +0 -16
  217. package/src/bmm-skills/v6-shims/bmad-quick-dev/SKILL.md +0 -21
  218. package/src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md +0 -28
  219. package/src/bmm-skills/v6-shims/bmad-sprint-status/customize.toml +0 -39
  220. package/src/bmm-skills/v6-shims/bmad-technical-research/SKILL.md +0 -16
  221. package/src/bmm-skills/v6-shims/bmad-validate-prd/SKILL.md +0 -32
  222. package/src/bmm-skills/v6-shims/bmad-validate-prd/customize.toml +0 -40
  223. package/src/core-skills/bmad-advanced-elicitation/SKILL.md +0 -64
  224. package/src/core-skills/bmad-advanced-elicitation/assets/methods.csv +0 -72
  225. package/src/core-skills/bmad-advanced-elicitation/customize.toml +0 -54
  226. package/src/core-skills/bmad-advanced-elicitation/scripts/pick_methods.py +0 -233
  227. package/src/core-skills/bmad-advanced-elicitation/scripts/tests/test_pick_methods.py +0 -228
  228. package/src/core-skills/bmad-brainstorming/SKILL.md +0 -80
  229. package/src/core-skills/bmad-brainstorming/assets/brain-icons.json +0 -166
  230. package/src/core-skills/bmad-brainstorming/assets/brain-methods.csv +0 -109
  231. package/src/core-skills/bmad-brainstorming/assets/brain-selector.html +0 -328
  232. package/src/core-skills/bmad-brainstorming/customize.toml +0 -83
  233. package/src/core-skills/bmad-brainstorming/references/converge.md +0 -24
  234. package/src/core-skills/bmad-brainstorming/references/finalize.md +0 -26
  235. package/src/core-skills/bmad-brainstorming/references/headless.md +0 -54
  236. package/src/core-skills/bmad-brainstorming/references/in-chat-techniques.md +0 -18
  237. package/src/core-skills/bmad-brainstorming/references/mode-autonomous.md +0 -10
  238. package/src/core-skills/bmad-brainstorming/references/mode-facilitator.md +0 -11
  239. package/src/core-skills/bmad-brainstorming/references/mode-partner.md +0 -16
  240. package/src/core-skills/bmad-brainstorming/references/resume.md +0 -5
  241. package/src/core-skills/bmad-brainstorming/scripts/brain.py +0 -789
  242. package/src/core-skills/bmad-brainstorming/scripts/tests/test_brain.py +0 -289
  243. package/src/core-skills/bmad-customize/SKILL.md +0 -111
  244. package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +0 -235
  245. package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +0 -249
  246. package/src/core-skills/bmad-deep-recon/SKILL.md +0 -82
  247. package/src/core-skills/bmad-deep-recon/assets/research.template.md +0 -18
  248. package/src/core-skills/bmad-deep-recon/customize.toml +0 -212
  249. package/src/core-skills/bmad-deep-recon/references/draft.md +0 -8
  250. package/src/core-skills/bmad-deep-recon/references/finalize.md +0 -11
  251. package/src/core-skills/bmad-deep-recon/references/html-briefing.md +0 -16
  252. package/src/core-skills/bmad-deep-recon/references/lifecycle.md +0 -11
  253. package/src/core-skills/bmad-deep-recon/references/process.md +0 -10
  254. package/src/core-skills/bmad-deep-recon/references/run.md +0 -73
  255. package/src/core-skills/bmad-deep-recon/references/selection.md +0 -13
  256. package/src/core-skills/bmad-deep-recon/references/synthesis.md +0 -16
  257. package/src/core-skills/bmad-deep-recon/references/verification.md +0 -29
  258. package/src/core-skills/bmad-deep-recon/scripts/recon_kit.py +0 -326
  259. package/src/core-skills/bmad-deep-recon/scripts/tests/test_recon_kit.py +0 -144
  260. package/src/core-skills/bmad-deep-recon/types/academic-lit.md +0 -19
  261. package/src/core-skills/bmad-deep-recon/types/competitive.md +0 -19
  262. package/src/core-skills/bmad-deep-recon/types/domain.md +0 -19
  263. package/src/core-skills/bmad-deep-recon/types/market.md +0 -19
  264. package/src/core-skills/bmad-deep-recon/types/technical.md +0 -19
  265. package/src/core-skills/bmad-deep-recon/types/user-voice.md +0 -19
  266. package/src/core-skills/bmad-forge-idea/SKILL.md +0 -107
  267. package/src/core-skills/bmad-forge-idea/customize.toml +0 -41
  268. package/src/core-skills/bmad-forge-idea/scripts/resolve_personas.py +0 -277
  269. package/src/core-skills/bmad-forge-idea/scripts/tests/test_resolve_personas.py +0 -160
  270. package/src/core-skills/bmad-help/SKILL.md +0 -77
  271. package/src/core-skills/bmad-party-mode/SKILL.md +0 -60
  272. package/src/core-skills/bmad-party-mode/customize.toml +0 -211
  273. package/src/core-skills/bmad-party-mode/references/create-party.md +0 -70
  274. package/src/core-skills/bmad-party-mode/references/mode-agent-team.md +0 -13
  275. package/src/core-skills/bmad-party-mode/references/mode-auto.md +0 -13
  276. package/src/core-skills/bmad-party-mode/references/mode-subagent.md +0 -31
  277. package/src/core-skills/bmad-party-mode/references/party-memory.md +0 -51
  278. package/src/core-skills/bmad-party-mode/scripts/resolve_party.py +0 -300
  279. package/src/core-skills/bmad-party-mode/scripts/tests/test_resolve_party.py +0 -183
  280. package/src/core-skills/bmad-review/SKILL.md +0 -50
  281. package/src/core-skills/bmad-review/customize.toml +0 -141
  282. package/src/core-skills/bmad-review/references/editorial-common.md +0 -56
  283. package/src/core-skills/bmad-review/references/lens-adversarial.md +0 -19
  284. package/src/core-skills/bmad-review/references/lens-edge-case-hunter.md +0 -72
  285. package/src/core-skills/bmad-review/references/lens-prose.md +0 -7
  286. package/src/core-skills/bmad-review/references/lens-structure.md +0 -9
  287. package/src/core-skills/bmad-review/references/lens-verification-gap.md +0 -92
  288. package/src/core-skills/bmad-review/references/structure-models.md +0 -44
  289. package/src/core-skills/bmad-review/scripts/tests/test_word_metrics.py +0 -62
  290. package/src/core-skills/bmad-review/scripts/word_metrics.py +0 -102
  291. package/src/core-skills/module-help.csv +0 -10
  292. package/src/core-skills/module.yaml +0 -38
  293. package/src/core-skills/v6-shims/README.md +0 -25
  294. package/src/core-skills/v6-shims/bmad-editorial-review/SKILL.md +0 -8
  295. package/src/core-skills/v6-shims/bmad-editorial-review/customize.toml +0 -31
  296. package/src/core-skills/v6-shims/bmad-editorial-review-prose/SKILL.md +0 -8
  297. package/src/core-skills/v6-shims/bmad-editorial-review-structure/SKILL.md +0 -8
  298. package/src/core-skills/v6-shims/bmad-review-adversarial-general/SKILL.md +0 -8
  299. package/src/core-skills/v6-shims/bmad-review-edge-case-hunter/SKILL.md +0 -8
  300. package/src/core-skills/v6-shims/bmad-review-verification-gap/SKILL.md +0 -8
  301. package/src/scripts/__pycache__/config_utils.cpython-311.pyc +0 -0
  302. package/src/scripts/config_utils.py +0 -119
  303. package/src/scripts/memlog.py +0 -228
  304. package/src/scripts/render_skill.py +0 -401
  305. package/src/scripts/resolve_config.py +0 -82
  306. package/src/scripts/resolve_customization.py +0 -164
  307. package/src/scripts/tests/__pycache__/test_config_utils.cpython-311.pyc +0 -0
  308. package/src/scripts/tests/__pycache__/test_resolve_config.cpython-311.pyc +0 -0
  309. package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-311.pyc +0 -0
  310. package/src/scripts/tests/test_config_utils.py +0 -85
  311. package/src/scripts/tests/test_memlog.py +0 -306
  312. package/src/scripts/tests/test_resolve_config.py +0 -117
  313. package/src/scripts/tests/test_resolve_customization.py +0 -179
  314. package/tools/bundle-web-bundles.js +0 -117
  315. package/tools/format-workflow-md.js +0 -263
  316. package/tools/installer/README.md +0 -60
  317. package/tools/installer/bmad-cli.js +0 -105
  318. package/tools/installer/cli-utils.js +0 -57
  319. package/tools/installer/commands/install.js +0 -151
  320. package/tools/installer/commands/status.js +0 -65
  321. package/tools/installer/commands/uninstall.js +0 -167
  322. package/tools/installer/core/config.js +0 -76
  323. package/tools/installer/core/existing-install.js +0 -121
  324. package/tools/installer/core/install-paths.js +0 -132
  325. package/tools/installer/core/installer.js +0 -1826
  326. package/tools/installer/core/legacy-warnings.js +0 -151
  327. package/tools/installer/core/manifest-generator.js +0 -883
  328. package/tools/installer/core/manifest.js +0 -439
  329. package/tools/installer/core/shim-policy.js +0 -159
  330. package/tools/installer/core/uv-check.js +0 -195
  331. package/tools/installer/core/wsl-node-check.js +0 -109
  332. package/tools/installer/file-ops.js +0 -204
  333. package/tools/installer/fs-native.js +0 -116
  334. package/tools/installer/ide/_config-driven.js +0 -972
  335. package/tools/installer/ide/manager.js +0 -324
  336. package/tools/installer/ide/platform-codes.js +0 -80
  337. package/tools/installer/ide/platform-codes.yaml +0 -363
  338. package/tools/installer/ide/shared/installed-skills.js +0 -50
  339. package/tools/installer/ide/shared/path-utils.js +0 -219
  340. package/tools/installer/ide/shared/skill-manifest.js +0 -57
  341. package/tools/installer/install-messages.yaml +0 -44
  342. package/tools/installer/list-options.js +0 -210
  343. package/tools/installer/message-loader.js +0 -83
  344. package/tools/installer/modules/channel-plan.js +0 -216
  345. package/tools/installer/modules/channel-resolver.js +0 -241
  346. package/tools/installer/modules/custom-module-manager.js +0 -924
  347. package/tools/installer/modules/external-manager.js +0 -673
  348. package/tools/installer/modules/git-env.js +0 -47
  349. package/tools/installer/modules/module-help-schema.js +0 -13
  350. package/tools/installer/modules/official-modules.js +0 -2289
  351. package/tools/installer/modules/plugin-resolver.js +0 -398
  352. package/tools/installer/modules/version-resolver.js +0 -336
  353. package/tools/installer/project-root.js +0 -224
  354. package/tools/installer/prompts.js +0 -804
  355. package/tools/installer/set-overrides.js +0 -330
  356. package/tools/installer/ui.js +0 -2225
  357. package/tools/installer/yaml-format.js +0 -245
  358. package/tools/javascript-conventions.md +0 -5
  359. package/tools/migrate-custom-module-paths.js +0 -124
  360. package/tools/skill-validator.md +0 -312
  361. package/tools/tests/__pycache__/test_validate_skills.cpython-311.pyc +0 -0
  362. package/tools/tests/fixtures/validate-skills/bmad/SKILL.md +0 -8
  363. package/tools/tests/fixtures/validate-skills/deprecated-shim/SKILL.md +0 -9
  364. package/tools/tests/fixtures/validate-skills/missing-trigger/SKILL.md +0 -9
  365. package/tools/tests/fixtures/validate-skills/with-trigger/SKILL.md +0 -8
  366. package/tools/tests/test_validate_skills.py +0 -476
  367. package/tools/validate-published-implementation-model.mjs +0 -59
  368. package/tools/validate-sidebar-order.js +0 -388
  369. package/tools/validate-svg-changes.sh +0 -356
  370. package/tools/validate_skills.py +0 -698
  371. package/web-bundles/README.md +0 -46
  372. package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +0 -86
  373. package/web-bundles/brainstorming-coach/SKILL.md +0 -83
  374. package/web-bundles/brainstorming-coach/brain-methods.csv +0 -62
  375. package/web-bundles/bundles.json +0 -139
  376. package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +0 -88
  377. package/web-bundles/market-and-industry-research/SKILL.md +0 -59
  378. package/web-bundles/prd-coach/INSTRUCTIONS.md +0 -86
  379. package/web-bundles/prd-coach/SKILL.md +0 -101
  380. package/web-bundles/prd-coach/prd-template.md +0 -165
  381. package/web-bundles/prd-coach/prd-validation-checklist.md +0 -135
  382. package/web-bundles/prfaq-coach/INSTRUCTIONS.md +0 -86
  383. package/web-bundles/prfaq-coach/SKILL.md +0 -139
  384. package/web-bundles/product-brief-coach/INSTRUCTIONS.md +0 -86
  385. package/web-bundles/product-brief-coach/SKILL.md +0 -113
  386. package/web-bundles/ux-coach/INSTRUCTIONS.md +0 -92
  387. package/web-bundles/ux-coach/SKILL.md +0 -187
  388. package/web-bundles/ux-coach/ux-validation.md +0 -100
@@ -1,804 +0,0 @@
1
- /**
2
- * @clack/prompts wrapper for BMAD CLI
3
- *
4
- * This module provides a unified interface for CLI prompts using @clack/prompts.
5
- * It replaces Inquirer.js to fix Windows arrow key navigation issues (libuv #852).
6
- *
7
- * @module prompts
8
- */
9
-
10
- let _clack = null;
11
- let _clackCore = null;
12
- let _picocolors = null;
13
- const fs = require('node:fs');
14
- const os = require('node:os');
15
- const path = require('node:path');
16
-
17
- /**
18
- * Lazy-load @clack/prompts (ESM module)
19
- * @returns {Promise<Object>} The clack prompts module
20
- */
21
- async function getClack() {
22
- if (!_clack) {
23
- _clack = await import('@clack/prompts');
24
- }
25
- return _clack;
26
- }
27
-
28
- /**
29
- * Lazy-load @clack/core (ESM module)
30
- * @returns {Promise<Object>} The clack core module
31
- */
32
- async function getClackCore() {
33
- if (!_clackCore) {
34
- _clackCore = await import('@clack/core');
35
- }
36
- return _clackCore;
37
- }
38
-
39
- /**
40
- * Lazy-load picocolors
41
- * @returns {Promise<Object>} The picocolors module
42
- */
43
- async function getPicocolors() {
44
- if (!_picocolors) {
45
- _picocolors = (await import('picocolors')).default;
46
- }
47
- return _picocolors;
48
- }
49
-
50
- /**
51
- * Handle user cancellation gracefully
52
- * @param {any} value - The value to check
53
- * @param {string} [message='Operation cancelled'] - Message to display
54
- * @returns {boolean} True if cancelled
55
- */
56
- async function handleCancel(value, message = 'Operation cancelled') {
57
- const clack = await getClack();
58
- if (clack.isCancel(value)) {
59
- clack.cancel(message);
60
- process.exit(0);
61
- }
62
- return false;
63
- }
64
-
65
- /**
66
- * Display intro message
67
- * @param {string} message - The intro message
68
- */
69
- async function intro(message) {
70
- const clack = await getClack();
71
- clack.intro(message);
72
- }
73
-
74
- /**
75
- * Display outro message
76
- * @param {string} message - The outro message
77
- */
78
- async function outro(message) {
79
- const clack = await getClack();
80
- clack.outro(message);
81
- }
82
-
83
- /**
84
- * Display a note/info box
85
- * @param {string} message - The note content
86
- * @param {string} [title] - Optional title
87
- */
88
- async function note(message, title) {
89
- const clack = await getClack();
90
- clack.note(message, title);
91
- }
92
-
93
- /**
94
- * Display a spinner for async operations
95
- * Wraps @clack/prompts spinner with isSpinning state tracking
96
- * @returns {Object} Spinner controller with start, stop, message, error, cancel, clear, isSpinning
97
- */
98
- async function spinner() {
99
- const clack = await getClack();
100
- const s = clack.spinner();
101
- let spinning = false;
102
-
103
- return {
104
- start: (msg) => {
105
- if (spinning) {
106
- s.message(msg);
107
- } else {
108
- spinning = true;
109
- s.start(msg);
110
- }
111
- },
112
- stop: (msg) => {
113
- if (spinning) {
114
- spinning = false;
115
- s.stop(msg);
116
- }
117
- },
118
- message: (msg) => {
119
- if (spinning) s.message(msg);
120
- },
121
- error: (msg) => {
122
- spinning = false;
123
- s.error(msg);
124
- },
125
- cancel: (msg) => {
126
- spinning = false;
127
- s.cancel(msg);
128
- },
129
- clear: () => {
130
- spinning = false;
131
- s.clear();
132
- },
133
- get isSpinning() {
134
- return spinning;
135
- },
136
- get isCancelled() {
137
- return s.isCancelled;
138
- },
139
- };
140
- }
141
-
142
- /**
143
- * Single-select prompt (replaces Inquirer 'list' type)
144
- * @param {Object} options - Prompt options
145
- * @param {string} options.message - The question to ask
146
- * @param {Array} options.choices - Array of choices [{name, value, hint?}]
147
- * @param {any} [options.default] - Default selected value
148
- * @returns {Promise<any>} Selected value
149
- */
150
- async function select(options) {
151
- const clack = await getClack();
152
-
153
- // Convert Inquirer-style choices to clack format
154
- // Handle both object choices {name, value, hint} and primitive choices (string/number)
155
- const clackOptions = options.choices
156
- .filter((c) => c.type !== 'separator') // Skip separators for now
157
- .map((choice) => {
158
- if (typeof choice === 'string' || typeof choice === 'number') {
159
- return { value: choice, label: String(choice) };
160
- }
161
- return {
162
- value: choice.value === undefined ? choice.name : choice.value,
163
- label: choice.name || choice.label || String(choice.value),
164
- hint: choice.hint || choice.description,
165
- };
166
- });
167
-
168
- // Find initial value
169
- let initialValue;
170
- if (options.default !== undefined) {
171
- initialValue = options.default;
172
- }
173
-
174
- const result = await clack.select({
175
- message: options.message,
176
- options: clackOptions,
177
- initialValue,
178
- });
179
-
180
- await handleCancel(result);
181
- return result;
182
- }
183
-
184
- /**
185
- * Multi-select prompt (replaces Inquirer 'checkbox' type)
186
- * @param {Object} options - Prompt options
187
- * @param {string} options.message - The question to ask
188
- * @param {Array} options.choices - Array of choices [{name, value, checked?, hint?}]
189
- * @param {boolean} [options.required=false] - Whether at least one must be selected
190
- * @returns {Promise<Array>} Array of selected values
191
- */
192
- async function multiselect(options) {
193
- const clack = await getClack();
194
-
195
- // Support both clack-native (options) and Inquirer-style (choices) APIs
196
- let clackOptions;
197
- let initialValues;
198
-
199
- if (options.options) {
200
- // Native clack format: options with label/value
201
- clackOptions = options.options;
202
- initialValues = options.initialValues || [];
203
- } else {
204
- // Convert Inquirer-style choices to clack format
205
- // Handle both object choices {name, value, hint} and primitive choices (string/number)
206
- clackOptions = options.choices
207
- .filter((c) => c.type !== 'separator') // Skip separators
208
- .map((choice) => {
209
- if (typeof choice === 'string' || typeof choice === 'number') {
210
- return { value: choice, label: String(choice) };
211
- }
212
- return {
213
- value: choice.value === undefined ? choice.name : choice.value,
214
- label: choice.name || choice.label || String(choice.value),
215
- hint: choice.hint || choice.description,
216
- };
217
- });
218
-
219
- // Find initial values (pre-checked items)
220
- initialValues = options.choices
221
- .filter((c) => c.checked && c.type !== 'separator')
222
- .map((c) => (c.value === undefined ? c.name : c.value));
223
- }
224
-
225
- const result = await clack.multiselect({
226
- message: options.message,
227
- options: clackOptions,
228
- initialValues: initialValues.length > 0 ? initialValues : undefined,
229
- required: options.required || false,
230
- });
231
-
232
- await handleCancel(result);
233
- return result;
234
- }
235
-
236
- /**
237
- * Default filter function for autocomplete - case-insensitive label matching
238
- * @param {string} search - Search string
239
- * @param {Object} option - Option object with label
240
- * @returns {boolean} Whether the option matches
241
- */
242
- function defaultAutocompleteFilter(search, option) {
243
- const label = option.label ?? String(option.value ?? '');
244
- return label.toLowerCase().includes(search.toLowerCase());
245
- }
246
-
247
- /**
248
- * Autocomplete multi-select prompt with type-ahead filtering
249
- * Custom implementation that always shows "Space/Tab:" in the hint
250
- * @param {Object} options - Prompt options
251
- * @param {string} options.message - The question to ask
252
- * @param {Array} options.options - Array of choices [{label, value, hint?}]
253
- * @param {string} [options.placeholder] - Placeholder text for search input
254
- * @param {Array} [options.initialValues] - Array of initially selected values
255
- * @param {boolean} [options.required=false] - Whether at least one must be selected
256
- * @param {number} [options.maxItems=5] - Maximum visible items in scrollable list
257
- * @param {Function} [options.filter] - Custom filter function (search, option) => boolean
258
- * @param {Array} [options.lockedValues] - Values that are always selected and cannot be toggled off
259
- * @returns {Promise<Array>} Array of selected values
260
- */
261
- async function autocompleteMultiselect(options) {
262
- const core = await getClackCore();
263
- const clack = await getClack();
264
- const color = await getPicocolors();
265
-
266
- const filterFn = options.filter ?? defaultAutocompleteFilter;
267
- const lockedSet = new Set(options.lockedValues || []);
268
-
269
- const prompt = new core.AutocompletePrompt({
270
- options: options.options,
271
- multiple: true,
272
- filter: filterFn,
273
- validate: () => {
274
- if (options.required && prompt.selectedValues.length === 0) {
275
- return 'Please select at least one item';
276
- }
277
- },
278
- initialValue: [...new Set([...(options.initialValues || []), ...(options.lockedValues || [])])],
279
- render() {
280
- const barColor = this.state === 'error' ? color.yellow : color.cyan;
281
- const bar = barColor(clack.S_BAR);
282
- const barEnd = barColor(clack.S_BAR_END);
283
-
284
- const title = `${color.gray(clack.S_BAR)}\n${clack.symbol(this.state)} ${options.message}\n`;
285
-
286
- const userInput = this.userInput;
287
- const placeholder = options.placeholder || 'Type to search...';
288
- const hasPlaceholder = userInput === '' && placeholder !== undefined;
289
-
290
- // Show placeholder or user input with cursor
291
- const searchDisplay =
292
- this.isNavigating || hasPlaceholder ? color.dim(hasPlaceholder ? placeholder : userInput) : this.userInputWithCursor;
293
-
294
- const allOptions = this.options;
295
- const matchCount =
296
- this.filteredOptions.length === allOptions.length
297
- ? ''
298
- : color.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? '' : 'es'})`);
299
-
300
- // Render option with checkbox
301
- const renderOption = (opt, isHighlighted) => {
302
- const isSelected = this.selectedValues.includes(opt.value);
303
- const isLocked = lockedSet.has(opt.value);
304
- const label = opt.label ?? String(opt.value ?? '');
305
- const hintText = opt.hint && isHighlighted ? color.dim(` (${opt.hint})`) : '';
306
-
307
- let checkbox;
308
- if (isLocked) {
309
- checkbox = color.green(clack.S_CHECKBOX_SELECTED);
310
- const lockHint = color.dim(' (always installed)');
311
- return isHighlighted ? `${checkbox} ${label}${lockHint}` : `${checkbox} ${color.dim(label)}${lockHint}`;
312
- }
313
- checkbox = isSelected ? color.green(clack.S_CHECKBOX_SELECTED) : color.dim(clack.S_CHECKBOX_INACTIVE);
314
- return isHighlighted ? `${checkbox} ${label}${hintText}` : `${checkbox} ${color.dim(label)}`;
315
- };
316
-
317
- switch (this.state) {
318
- case 'submit': {
319
- const count = this.selectedValues.length;
320
- const emptyHint = count === 0 && options.emptyLabel ? ` (${options.emptyLabel})` : '';
321
- return `${title}${color.gray(clack.S_BAR)} ${color.dim(`${count} item${count === 1 ? '' : 's'} selected${emptyHint}`)}`;
322
- }
323
-
324
- case 'cancel': {
325
- return `${title}${color.gray(clack.S_BAR)} ${color.strikethrough(color.dim(userInput))}`;
326
- }
327
-
328
- default: {
329
- // Always show "SPACE:" regardless of isNavigating state
330
- const hints = [`${color.dim('↑/↓')} to navigate`, `${color.dim('TAB/SPACE:')} select`, `${color.dim('ENTER:')} confirm`];
331
-
332
- const noMatchesLine = this.filteredOptions.length === 0 && userInput ? [`${bar} ${color.yellow('No matches found')}`] : [];
333
-
334
- const errorLine = this.state === 'error' ? [`${bar} ${color.yellow(this.error)}`] : [];
335
-
336
- const emptyLine =
337
- this.selectedValues.length === 0 && options.emptyLabel
338
- ? [`${bar} ${color.dim(`Nothing selected: installs ${options.emptyLabel}`)}`]
339
- : [];
340
-
341
- const headerLines = [
342
- ...`${title}${bar}`.split('\n'),
343
- `${bar} ${searchDisplay}${matchCount}`,
344
- ...noMatchesLine,
345
- ...errorLine,
346
- ...emptyLine,
347
- ];
348
-
349
- const footerLines = [`${bar} ${color.dim(hints.join(' • '))}`, `${barEnd}`];
350
-
351
- const optionLines = clack.limitOptions({
352
- cursor: this.cursor,
353
- options: this.filteredOptions,
354
- style: renderOption,
355
- maxItems: options.maxItems || 5,
356
- output: options.output,
357
- rowPadding: headerLines.length + footerLines.length,
358
- });
359
-
360
- return [...headerLines, ...optionLines.map((line) => `${bar} ${line}`), ...footerLines].join('\n');
361
- }
362
- }
363
- },
364
- });
365
-
366
- // Prevent locked values from being toggled off
367
- if (lockedSet.size > 0) {
368
- const originalToggle = prompt.toggleSelected.bind(prompt);
369
- prompt.toggleSelected = function (value) {
370
- // If locked and already selected, skip the toggle (would deselect)
371
- if (lockedSet.has(value) && this.selectedValues.includes(value)) {
372
- return;
373
- }
374
- originalToggle(value);
375
- };
376
- }
377
-
378
- // === FIX: Make SPACE always act as selection key (not search input) ===
379
- // Override _isActionKey to treat SPACE like TAB - always an action key
380
- // This prevents SPACE from being added to the search input
381
- const originalIsActionKey = prompt._isActionKey.bind(prompt);
382
- prompt._isActionKey = function (char, key) {
383
- if (key && key.name === 'space') {
384
- return true;
385
- }
386
- return originalIsActionKey(char, key);
387
- };
388
-
389
- // Handle SPACE toggle when NOT navigating (internal code only handles it when isNavigating=true)
390
- prompt.on('key', (char, key) => {
391
- if (key && key.name === 'space' && !prompt.isNavigating) {
392
- const focused = prompt.filteredOptions[prompt.cursor];
393
- if (focused) prompt.toggleSelected(focused.value);
394
- }
395
- });
396
- // === END FIX ===
397
-
398
- const result = await prompt.prompt();
399
- await handleCancel(result);
400
- return result;
401
- }
402
-
403
- /**
404
- * Confirm prompt (replaces Inquirer 'confirm' type)
405
- * @param {Object} options - Prompt options
406
- * @param {string} options.message - The question to ask
407
- * @param {boolean} [options.default=true] - Default value
408
- * @returns {Promise<boolean>} User's answer
409
- */
410
- async function confirm(options) {
411
- const clack = await getClack();
412
-
413
- const result = await clack.confirm({
414
- message: options.message,
415
- initialValue: options.default === undefined ? true : options.default,
416
- });
417
-
418
- await handleCancel(result);
419
- return result;
420
- }
421
-
422
- /**
423
- * Text input prompt with Tab-to-fill-placeholder support (replaces Inquirer 'input' type)
424
- *
425
- * This custom implementation restores the Tab-to-fill-placeholder behavior that was
426
- * intentionally removed in @clack/prompts v1.0.0 (placeholder became purely visual).
427
- * Uses @clack/core's TextPrompt primitive with custom key handling.
428
- *
429
- * @param {Object} options - Prompt options
430
- * @param {string} options.message - The question to ask
431
- * @param {string} [options.default] - Default value
432
- * @param {string} [options.placeholder] - Placeholder text (defaults to options.default if not provided)
433
- * @param {Function} [options.validate] - Validation function
434
- * @returns {Promise<string>} User's input
435
- */
436
- async function text(options) {
437
- const core = await getClackCore();
438
- const color = await getPicocolors();
439
-
440
- // Use default as placeholder if placeholder not explicitly provided
441
- // This shows the default value as grayed-out hint text
442
- const placeholder = options.placeholder === undefined ? options.default : options.placeholder;
443
- const defaultValue = options.default;
444
-
445
- const prompt = new core.TextPrompt({
446
- defaultValue,
447
- validate: options.validate,
448
- render() {
449
- const title = `${color.gray('◆')} ${options.message}`;
450
-
451
- // Show placeholder as dim text when input is empty
452
- let valueDisplay;
453
- if (this.state === 'error') {
454
- valueDisplay = color.yellow(this.userInputWithCursor);
455
- } else if (this.userInput) {
456
- valueDisplay = this.userInputWithCursor;
457
- } else if (placeholder) {
458
- // Show placeholder with cursor indicator when empty
459
- valueDisplay = `${color.inverse(color.hidden('_'))}${color.dim(placeholder)}`;
460
- } else {
461
- valueDisplay = color.inverse(color.hidden('_'));
462
- }
463
-
464
- const bar = color.gray('│');
465
-
466
- // Handle different states
467
- if (this.state === 'submit') {
468
- return `${color.gray('◇')} ${options.message}\n${bar} ${color.dim(this.value || defaultValue || '')}`;
469
- }
470
-
471
- if (this.state === 'cancel') {
472
- return `${color.gray('◇')} ${options.message}\n${bar} ${color.strikethrough(color.dim(this.userInput || ''))}`;
473
- }
474
-
475
- if (this.state === 'error') {
476
- return `${color.yellow('▲')} ${options.message}\n${bar} ${valueDisplay}\n${color.yellow('│')} ${color.yellow(this.error)}`;
477
- }
478
-
479
- return `${title}\n${bar} ${valueDisplay}\n${bar}`;
480
- },
481
- });
482
-
483
- // Add Tab key handler to fill placeholder into input
484
- prompt.on('key', (char) => {
485
- if (char === '\t' && placeholder && !prompt.userInput) {
486
- // Use _setUserInput with write=true to populate the readline and update internal state
487
- prompt._setUserInput(placeholder, true);
488
- }
489
- });
490
-
491
- const result = await prompt.prompt();
492
- await handleCancel(result);
493
-
494
- // TextPrompt's finalize handler already applies defaultValue for empty input
495
- return result;
496
- }
497
-
498
- /**
499
- * Password input prompt (replaces Inquirer 'password' type)
500
- * @param {Object} options - Prompt options
501
- * @param {string} options.message - The question to ask
502
- * @param {Function} [options.validate] - Validation function
503
- * @returns {Promise<string>} User's input
504
- */
505
- async function password(options) {
506
- const clack = await getClack();
507
-
508
- const result = await clack.password({
509
- message: options.message,
510
- validate: options.validate,
511
- });
512
-
513
- await handleCancel(result);
514
- return result;
515
- }
516
-
517
- /**
518
- * Run tasks with spinner feedback
519
- * @param {Array} tasks - Array of task objects [{title, task, enabled?}]
520
- * @returns {Promise<void>}
521
- */
522
- async function tasks(taskList) {
523
- const clack = await getClack();
524
- await clack.tasks(taskList);
525
- }
526
-
527
- /**
528
- * Log messages with styling
529
- */
530
- const log = {
531
- async info(message) {
532
- const clack = await getClack();
533
- clack.log.info(message);
534
- },
535
- async success(message) {
536
- const clack = await getClack();
537
- clack.log.success(message);
538
- },
539
- async warn(message) {
540
- const clack = await getClack();
541
- clack.log.warn(message);
542
- },
543
- async error(message) {
544
- const clack = await getClack();
545
- clack.log.error(message);
546
- },
547
- async message(message) {
548
- const clack = await getClack();
549
- clack.log.message(message);
550
- },
551
- async step(message) {
552
- const clack = await getClack();
553
- clack.log.step(message);
554
- },
555
- };
556
-
557
- /**
558
- * Display cancellation message
559
- * @param {string} [message='Operation cancelled'] - The cancellation message
560
- */
561
- async function cancel(message = 'Operation cancelled') {
562
- const clack = await getClack();
563
- clack.cancel(message);
564
- }
565
-
566
- /**
567
- * Display content in a styled box
568
- * @param {string} content - The box content
569
- * @param {string} [title] - Optional title
570
- * @param {Object} [options] - Box options (contentAlign, titleAlign, width, rounded, formatBorder, etc.)
571
- */
572
- async function box(content, title, options) {
573
- const clack = await getClack();
574
- clack.box(content, title, options);
575
- }
576
-
577
- /**
578
- * Autocomplete single-select prompt with type-ahead filtering
579
- * @param {Object} options - Autocomplete options
580
- * @param {string} options.message - The prompt message
581
- * @param {Array} options.options - Array of choices [{value, label, hint?}]
582
- * @param {string} [options.placeholder] - Placeholder text
583
- * @param {number} [options.maxItems] - Maximum visible items
584
- * @param {Function} [options.filter] - Custom filter function
585
- * @returns {Promise<any>} Selected value
586
- */
587
- async function autocomplete(options) {
588
- const clack = await getClack();
589
- const result = await clack.autocomplete(options);
590
- await handleCancel(result);
591
- return result;
592
- }
593
-
594
- function expandHome(input) {
595
- if (!input) return input;
596
- if (input === '~') return os.homedir();
597
- if (input.startsWith('~/') || input.startsWith('~\\')) {
598
- return path.join(os.homedir(), input.slice(2));
599
- }
600
- return input;
601
- }
602
-
603
- /**
604
- * Resolve raw prompt input to an absolute directory path.
605
- * Mirrors UI.expandUserPath so what the prompt returns matches what the
606
- * installer later resolves.
607
- */
608
- function resolveDirectoryInput(input, options = {}) {
609
- const cwd = options.cwd || process.cwd();
610
- const rawInput = typeof input === 'string' ? input.trim() : '';
611
- // An empty line means "use the default", which is resolved the same way as
612
- // typed text so a `~/…` or relative default still returns an absolute path.
613
- const effective = rawInput || (options.default || '').trim();
614
- if (!effective) return cwd;
615
- return path.resolve(cwd, expandHome(effective));
616
- }
617
-
618
- /**
619
- * Directory prompt.
620
- *
621
- * A plain text entry: what is on the input line is what gets submitted,
622
- * resolved to an absolute path.
623
- *
624
- * The line is pre-filled with the default (the current working directory,
625
- * which is where installs usually run from) as real editable text rather than
626
- * a placeholder, so it can be edited down or extended instead of retyped.
627
- * Clearing it and pressing Enter still accepts the default.
628
- *
629
- * @param {Object} options - Prompt options
630
- * @param {string} options.message - Prompt message
631
- * @param {string} [options.default] - Default directory, pre-filled on the input line
632
- * @param {string} [options.placeholder] - Placeholder shown only if the line is cleared
633
- * @param {Function} [options.validate] - Sync validation function
634
- * @param {Object} [options.input] - Input stream (defaults to process.stdin; tests inject)
635
- * @param {Object} [options.output] - Output stream (defaults to process.stdout; tests inject)
636
- * @returns {Promise<string>} Resolved absolute directory path
637
- */
638
- async function directory(options) {
639
- const core = await getClackCore();
640
- const color = await getPicocolors();
641
-
642
- const prompt = new core.TextPrompt({
643
- ...(options.input ? { input: options.input } : {}),
644
- ...(options.output ? { output: options.output } : {}),
645
- initialValue: options.default,
646
- defaultValue: options.default,
647
- validate: options.validate,
648
- render() {
649
- const bar = color.gray('│');
650
- const userInput = this.userInput;
651
-
652
- switch (this.state) {
653
- case 'submit': {
654
- return `${color.gray('◇')} ${options.message}\n${bar} ${color.dim(this.value || '')}`;
655
- }
656
- case 'cancel': {
657
- return `${color.gray('◇')} ${options.message}\n${bar} ${color.strikethrough(color.dim(userInput || ''))}`;
658
- }
659
- default: {
660
- const placeholder = options.placeholder || options.default;
661
- const inputDisplay = userInput ? this.userInputWithCursor : `${color.inverse(color.hidden('_'))}${color.dim(placeholder || '')}`;
662
- const lines = [`${color.gray('◆')} ${options.message}`, `${bar} ${inputDisplay}`];
663
- if (this.state === 'error') lines.push(`${color.yellow('│')} ${color.yellow(this.error)}`);
664
- lines.push(color.gray('└'));
665
- return lines.join('\n');
666
- }
667
- }
668
- },
669
- });
670
-
671
- const result = await prompt.prompt();
672
- await handleCancel(result);
673
- return resolveDirectoryInput(result, options);
674
- }
675
-
676
- /**
677
- * Get the color utility (picocolors instance from @clack/prompts)
678
- * @returns {Promise<Object>} The color utility (picocolors)
679
- */
680
- async function getColor() {
681
- return await getPicocolors();
682
- }
683
-
684
- /**
685
- * Execute an array of Inquirer-style questions using @clack/prompts
686
- * This provides compatibility with dynamic question arrays
687
- * @param {Array} questions - Array of Inquirer-style question objects
688
- * @returns {Promise<Object>} Object with answers keyed by question name
689
- */
690
- async function prompt(questions) {
691
- const answers = {};
692
-
693
- for (const question of questions) {
694
- const { type, name, message, choices, default: defaultValue, validate, when } = question;
695
-
696
- // Handle conditional questions via 'when' property
697
- if (when !== undefined) {
698
- const shouldAsk = typeof when === 'function' ? await when(answers) : when;
699
- if (!shouldAsk) continue;
700
- }
701
-
702
- let answer;
703
-
704
- switch (type) {
705
- case 'input': {
706
- // Note: @clack/prompts doesn't support async validation, so validate must be sync
707
- answer = await text({
708
- message,
709
- default: typeof defaultValue === 'function' ? defaultValue(answers) : defaultValue,
710
- validate: validate
711
- ? (val) => {
712
- const result = validate(val, answers);
713
- if (result instanceof Promise) {
714
- throw new TypeError('Async validation is not supported by @clack/prompts. Please use synchronous validation.');
715
- }
716
- return result === true ? undefined : result;
717
- }
718
- : undefined,
719
- });
720
- break;
721
- }
722
-
723
- case 'confirm': {
724
- answer = await confirm({
725
- message,
726
- default: typeof defaultValue === 'function' ? defaultValue(answers) : defaultValue,
727
- });
728
- break;
729
- }
730
-
731
- case 'list': {
732
- answer = await select({
733
- message,
734
- choices: choices || [],
735
- default: typeof defaultValue === 'function' ? defaultValue(answers) : defaultValue,
736
- });
737
- break;
738
- }
739
-
740
- case 'checkbox': {
741
- answer = await multiselect({
742
- message,
743
- choices: choices || [],
744
- required: false,
745
- });
746
- break;
747
- }
748
-
749
- case 'password': {
750
- // Note: @clack/prompts doesn't support async validation, so validate must be sync
751
- answer = await password({
752
- message,
753
- validate: validate
754
- ? (val) => {
755
- const result = validate(val, answers);
756
- if (result instanceof Promise) {
757
- throw new TypeError('Async validation is not supported by @clack/prompts. Please use synchronous validation.');
758
- }
759
- return result === true ? undefined : result;
760
- }
761
- : undefined,
762
- });
763
- break;
764
- }
765
-
766
- default: {
767
- // Default to text input for unknown types
768
- answer = await text({
769
- message,
770
- default: typeof defaultValue === 'function' ? defaultValue(answers) : defaultValue,
771
- });
772
- }
773
- }
774
-
775
- answers[name] = answer;
776
- }
777
-
778
- return answers;
779
- }
780
-
781
- module.exports = {
782
- getClack,
783
- getColor,
784
- handleCancel,
785
- intro,
786
- outro,
787
- cancel,
788
- note,
789
- box,
790
- spinner,
791
- select,
792
- multiselect,
793
- autocompleteMultiselect,
794
- autocomplete,
795
- directory,
796
- // Exported for tests
797
- resolveDirectoryInput,
798
- confirm,
799
- text,
800
- password,
801
- tasks,
802
- log,
803
- prompt,
804
- };