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,701 +0,0 @@
1
- # /// script
2
- # requires-python = ">=3.10"
3
- # dependencies = ["ruamel.yaml>=0.18"]
4
- # ///
5
- """Parse epic files and deterministically generate or refresh sprint-status.yaml.
6
-
7
- Prints ONLY JSON to stdout — argparse failures included. Errors are emitted as
8
- JSON to stdout with a non-zero exit code. Writes are atomic (temp file, fsync,
9
- ``os.replace``) and the original file bytes are restored atomically if
10
- post-write validation fails.
11
-
12
- Subcommands:
13
- generate Parse epics, merge with any existing status file, write the result.
14
- --dry-run reports (including drift: in_sync, illegal, orphans)
15
- without writing. --fresh ignores existing statuses for a pristine
16
- rebuild; --set key=status applies explicit, user-confirmed statuses
17
- on top — the repair path is allowed to downgrade.
18
- status Summarize an existing status file: counts, risks, open action
19
- items, and the next recommended action. No writes.
20
- validate Report whether an existing status file is structurally valid:
21
- parseable, recognized keys, legal statuses, well-formed
22
- action_items. No writes; exit 0 whether valid or not.
23
-
24
- The LLM decides *which* files are epics (discovery is judgment); this script
25
- owns everything after that decision: parsing, key derivation, ordering, status
26
- preservation, story-file detection, action-item carry-over, and validation.
27
- Legacy v6 statuses (drafted, contexted) are normalized on read everywhere, so
28
- they merge and count by their modern meaning and are reported, never reset.
29
- """
30
-
31
- import argparse
32
- import hashlib
33
- import io
34
- import json
35
- import os
36
- import re
37
- import sys
38
- import tempfile
39
- from pathlib import Path
40
-
41
- from ruamel.yaml import YAML
42
- from ruamel.yaml.comments import CommentedMap
43
-
44
- EPIC_RE = re.compile(r"^#{1,3}\s*Epic\s+(\d+)\s*:?\s*(.*?)\s*#*\s*$", re.IGNORECASE)
45
- STORY_RE = re.compile(
46
- r"^#{2,4}\s*Story\s+(\d+)\.(\d+[a-z]?)\s*:?\s*(.*?)\s*#*\s*$", re.IGNORECASE
47
- )
48
- # Heading lines that mention Epic/Story but failed the strict patterns above.
49
- SUSPECT_RE = re.compile(r"^#{1,4}\s.*\b(?:epic|story)\b", re.IGNORECASE)
50
- FENCE_RE = re.compile(r"^\s{0,3}(?:```|~~~)")
51
-
52
- # The key grammar for sprint-status.yaml. The trailing [a-z]? matches
53
- # split-story keys like 2-6a-...; bmad-retrospective's sprint_status.py reads
54
- # the same file with the same grammar.
55
- EPIC_KEY_RE = re.compile(r"^epic-(\d+)$")
56
- RETRO_KEY_RE = re.compile(r"^epic-(\d+)-retrospective$")
57
- STORY_KEY_RE = re.compile(r"^(\d+)-(\d+)([a-z]?)-.+")
58
-
59
- STORY_RANK = {"backlog": 0, "ready-for-dev": 1, "in-progress": 2, "review": 3, "done": 4}
60
- EPIC_RANK = {"backlog": 0, "in-progress": 1, "done": 2}
61
- RETRO_RANK = {"optional": 0, "done": 1}
62
- RANKS = {"epic": EPIC_RANK, "story": STORY_RANK, "retro": RETRO_RANK}
63
- ACTION_STATUSES = ("open", "in-progress", "done")
64
-
65
- # v6 wrote these; they still exist in the wild (v6-shims/bmad-create-story
66
- # actively writes 'contexted'). Normalized on every read so no subcommand ever
67
- # treats a valid legacy file as illegal or resets its progress.
68
- LEGACY_STATUS = {"drafted": "ready-for-dev", "contexted": "in-progress"}
69
-
70
- STALE_DAYS_DEFAULT = 7
71
- DATE_FORMAT = "%m-%d-%Y %H:%M"
72
- # Hand-edited files drift toward ISO stamps; accept them rather than silently
73
- # disabling the staleness check.
74
- STAMP_FORMATS = (DATE_FORMAT, "%Y-%m-%d %H:%M", "%Y-%m-%d")
75
-
76
- # Kept byte-identical (modulo the leading "# ") with the STATUS DEFINITIONS
77
- # block in sprint-status-template.yaml; test_sprint_plan.py asserts the two
78
- # never drift.
79
- HEADER_COMMENT = """\
80
- STATUS DEFINITIONS:
81
- ==================
82
- Epic Status:
83
- - backlog: Epic not yet started
84
- - in-progress: Epic actively being worked on
85
- - done: All stories in epic completed
86
-
87
- Story Status:
88
- - backlog: Story only exists in epic file
89
- - ready-for-dev: Story file created, ready for development
90
- - in-progress: Developer actively working on implementation
91
- - review: Implementation complete, ready for review
92
- - done: Story completed
93
-
94
- Retrospective Status:
95
- - optional: Can be completed but not required
96
- - done: Retrospective has been completed
97
-
98
- Action Item Status:
99
- - open: Committed during a retrospective, not yet addressed
100
- - in-progress: Actively being worked on
101
- - done: Completed
102
-
103
- WORKFLOW NOTES:
104
- ===============
105
- - Epic transitions to 'in-progress' automatically when its first story starts (via build's sprint sync)
106
- - Stories can be worked in parallel if team capacity allows
107
- - Developer typically creates the next story after the previous one is 'done' to incorporate learnings
108
- - Dev moves story to 'review', then runs code-review (fresh context, different LLM recommended)
109
- - Retrospective appends its action items to action_items; the status view surfaces open ones
110
- """
111
-
112
-
113
- def _fail(message, **extra):
114
- print(json.dumps({"ok": False, "error": message, **extra}, default=str))
115
- sys.exit(1)
116
-
117
-
118
- class JsonArgumentParser(argparse.ArgumentParser):
119
- """Emit argparse failures on the JSON-only stdout contract, not usage text.
120
-
121
- Built with ``add_help=False`` everywhere: the built-in help action prints
122
- plain usage to stdout with exit 0, which would break the machine consumer
123
- this script serves. ``-h`` therefore routes through ``error()`` as an
124
- ordinary unrecognized argument; the skill's SKILL.md carries the usage a
125
- human needs.
126
- """
127
-
128
- def error(self, message):
129
- print(json.dumps({"ok": False, "error": f"argument error: {message}"}))
130
- sys.exit(2)
131
-
132
-
133
- def _slug(text, maxlen=60):
134
- # Unicode-aware: a non-Latin title must keep its own characters in the key
135
- # rather than every such story collapsing onto one shared placeholder.
136
- slug = re.sub(r"[^\w]+", "-", str(text).lower(), flags=re.UNICODE).strip("-")
137
- slug = slug[:maxlen].strip("-")
138
- if not slug:
139
- # Nothing sluggable (punctuation/emoji only): a short content hash keeps
140
- # the key deterministic and distinct instead of a bare "untitled".
141
- slug = hashlib.sha256(str(text).encode("utf-8")).hexdigest()[:8]
142
- return slug
143
-
144
-
145
- def classify_key(key):
146
- """Return (kind, epic_num) for a recognized key, else None."""
147
- m = RETRO_KEY_RE.match(key)
148
- if m:
149
- return "retro", int(m.group(1))
150
- m = EPIC_KEY_RE.match(key)
151
- if m:
152
- return "epic", int(m.group(1))
153
- m = STORY_KEY_RE.match(key)
154
- if m:
155
- return "story", int(m.group(1))
156
- return None
157
-
158
-
159
- def _story_sort_key(key):
160
- m = STORY_KEY_RE.match(key)
161
- if not m:
162
- return (10**9, 10**9, "", key)
163
- return (int(m.group(1)), int(m.group(2)), m.group(3), key)
164
-
165
-
166
- def _normalize(raw):
167
- """Map a raw status through the legacy vocabulary. Returns (status, was_legacy)."""
168
- status = LEGACY_STATUS.get(raw, raw)
169
- return status, raw in LEGACY_STATUS
170
-
171
-
172
- def parse_epics(paths):
173
- """Return (entries, warnings). Entries are (key, kind, epic_num) in file order."""
174
- epics = {} # epic_num -> [story keys in order]
175
- warnings = []
176
- for path in paths:
177
- try:
178
- lines = Path(path).read_text(encoding="utf-8").splitlines()
179
- except OSError as exc:
180
- _fail(f"cannot read epic file {path}: {exc}")
181
- in_fence = False
182
- for lineno, line in enumerate(lines, 1):
183
- if FENCE_RE.match(line):
184
- in_fence = not in_fence
185
- continue
186
- if in_fence:
187
- continue
188
- epic_m = EPIC_RE.match(line)
189
- if epic_m:
190
- epics.setdefault(int(epic_m.group(1)), [])
191
- continue
192
- story_m = STORY_RE.match(line)
193
- if story_m:
194
- epic_num = int(story_m.group(1))
195
- story_num = story_m.group(2)
196
- key = f"{epic_num}-{story_num}-{_slug(story_m.group(3))}"
197
- stories = epics.setdefault(epic_num, [])
198
- if key in stories:
199
- warnings.append(f"duplicate story heading '{key}' at {path}:{lineno}")
200
- else:
201
- stories.append(key)
202
- continue
203
- if SUSPECT_RE.match(line):
204
- warnings.append(f"unparsed Epic/Story-like heading at {path}:{lineno}: {line.strip()}")
205
- entries = []
206
- for epic_num in sorted(epics):
207
- entries.append((f"epic-{epic_num}", "epic", epic_num))
208
- for story_key in epics[epic_num]:
209
- entries.append((story_key, "story", epic_num))
210
- entries.append((f"epic-{epic_num}-retrospective", "retro", epic_num))
211
- return entries, warnings
212
-
213
-
214
- def _make_yaml():
215
- yaml = YAML(typ="rt")
216
- yaml.preserve_quotes = True
217
- # Pin the emitter to the indentation the sprint-status template ships with.
218
- # Without this, ruamel re-dumps block sequences at its own default offset and
219
- # every write silently de-indents pre-existing, untouched action_items.
220
- yaml.indent(mapping=2, sequence=4, offset=2)
221
- yaml.encoding = "utf-8"
222
- return yaml
223
-
224
-
225
- def _load_existing(path):
226
- yaml = _make_yaml()
227
- if not Path(path).exists():
228
- return yaml, None
229
- try:
230
- with io.open(path, "r", encoding="utf-8") as fh:
231
- data = yaml.load(fh)
232
- except Exception as exc:
233
- _fail(f"existing status file is not valid YAML: {exc}", status_file=str(path))
234
- if data is not None and not isinstance(data, dict):
235
- _fail(
236
- f"existing status file is valid YAML but not a mapping (got {type(data).__name__})",
237
- status_file=str(path),
238
- )
239
- return yaml, data
240
-
241
-
242
- def _merge_status(kind, computed, existing_raw, key, warnings, report):
243
- """Return the higher-ranked of computed/existing; never downgrade."""
244
- rank = RANKS[kind]
245
- if existing_raw is None:
246
- return computed
247
- existing, was_legacy = _normalize(existing_raw)
248
- if was_legacy:
249
- report["legacy_mapped"].append({"key": key, "from": existing_raw, "to": existing})
250
- if existing not in rank:
251
- warnings.append(f"illegal status '{existing_raw}' on '{key}' replaced with '{computed}'")
252
- report["illegal"].append({"key": key, "status": existing_raw})
253
- return computed
254
- return existing if rank[existing] >= rank[computed] else computed
255
-
256
-
257
- def build_status(entries, existing_data, stories_dir, warnings):
258
- """Return (development_status CommentedMap, merge report dict)."""
259
- existing_status = {}
260
- if existing_data is not None:
261
- existing_status = dict(existing_data.get("development_status") or {})
262
- report = {
263
- "new_entries": [],
264
- "preserved": 0,
265
- "changed": 0,
266
- "upgraded_from_disk": [],
267
- "dropped_orphans": [],
268
- "legacy_mapped": [],
269
- "illegal": [],
270
- }
271
- # One directory scan instead of a stat() per story.
272
- story_files = set()
273
- if stories_dir and Path(stories_dir).is_dir():
274
- story_files = {p.name for p in Path(stories_dir).glob("*.md")}
275
- dev = CommentedMap()
276
- first_epic = True
277
- for key, kind, _epic_num in entries:
278
- default = {"epic": "backlog", "story": "backlog", "retro": "optional"}[kind]
279
- computed = default
280
- if kind == "story" and f"{key}.md" in story_files:
281
- computed = "ready-for-dev"
282
- merged = _merge_status(kind, computed, existing_status.get(key), key, warnings, report)
283
- if key not in existing_status:
284
- report["new_entries"].append(key)
285
- elif merged == _normalize(existing_status[key])[0]:
286
- report["preserved"] += 1
287
- else:
288
- report["changed"] += 1
289
- if kind == "story" and computed == "ready-for-dev" and existing_status.get(key) in (None, "backlog"):
290
- report["upgraded_from_disk"].append(key)
291
- dev[key] = merged
292
- if kind == "epic" and not first_epic:
293
- dev.yaml_set_comment_before_after_key(key, before="\n")
294
- if kind == "epic":
295
- first_epic = False
296
- computed_keys = {key for key, _, _ in entries}
297
- # Old statuses ride along so the LLM can transplant them after a rename —
298
- # the values would otherwise be destroyed by the write.
299
- report["dropped_orphans"] = [
300
- {"key": k, "status": existing_status[k]}
301
- for k in existing_status
302
- if k not in computed_keys
303
- ]
304
- report["in_sync"] = (
305
- not report["new_entries"]
306
- and not report["dropped_orphans"]
307
- and not report["illegal"]
308
- and not report["legacy_mapped"]
309
- and report["changed"] == 0
310
- )
311
- return dev, report
312
-
313
-
314
- def _counts(dev):
315
- counts = {}
316
- for value in dev.values():
317
- counts[value] = counts.get(value, 0) + 1
318
- return counts
319
-
320
-
321
- def _dump_bytes(yaml, doc):
322
- """Serialize before any file is touched, so a dump failure cannot leave a
323
- partial file anywhere."""
324
- buf = io.BytesIO()
325
- yaml.dump(doc, buf)
326
- return buf.getvalue()
327
-
328
-
329
- def _atomic_write(path, payload, mode=None):
330
- """Replace ``path``'s contents with ``payload`` atomically.
331
-
332
- Temp file alongside the target, fsynced, taking the target's permission
333
- bits (mkstemp creates 0600, which would silently narrow the file), then
334
- renamed over it. ``path`` is resolved through symlinks first: renaming onto
335
- a symlink would detach the link and leave the real file stale.
336
- """
337
- path = os.path.realpath(path)
338
- directory = os.path.dirname(path) or "."
339
- os.makedirs(directory, exist_ok=True)
340
- fd, tmp = tempfile.mkstemp(prefix=".sprint-status-", suffix=".tmp", dir=directory)
341
- try:
342
- with os.fdopen(fd, "wb") as fh:
343
- fh.write(payload)
344
- fh.flush()
345
- os.fsync(fh.fileno())
346
- if mode is not None:
347
- os.chmod(tmp, mode)
348
- os.replace(tmp, path)
349
- except BaseException:
350
- try:
351
- os.unlink(tmp)
352
- except OSError:
353
- pass
354
- raise
355
-
356
-
357
- def _parse_sets(pairs, valid_keys):
358
- """Validate --set key=status pairs against the generated plan and vocabulary."""
359
- parsed = []
360
- for pair in pairs:
361
- key, sep, status = pair.partition("=")
362
- if not sep or not key or not status:
363
- _fail(f"--set expects key=status, got '{pair}'")
364
- if key not in valid_keys:
365
- _fail(f"--set key '{key}' is not in the generated plan", valid_keys=sorted(valid_keys))
366
- kind, _ = classify_key(key)
367
- if status not in RANKS[kind]:
368
- _fail(
369
- f"--set status '{status}' is not legal for {kind} '{key}'",
370
- legal=sorted(RANKS[kind]),
371
- )
372
- parsed.append((key, status))
373
- return parsed
374
-
375
-
376
- def cmd_generate(args):
377
- entries, warnings = parse_epics(args.epic_file)
378
- if not entries:
379
- _fail("no epics or stories parsed from the given epic files", epic_files=args.epic_file)
380
- yaml, existing = _load_existing(args.status_file)
381
- status_path = Path(args.status_file)
382
- original_bytes = status_path.read_bytes() if status_path.exists() else None
383
- original_mode = (os.stat(status_path).st_mode & 0o777) if status_path.exists() else None
384
-
385
- merge_source = None if args.fresh else existing
386
- dev, report = build_status(entries, merge_source, args.stories_dir, warnings)
387
-
388
- # Explicit, user-confirmed statuses (the fix flow). Applied last: repair is
389
- # the one path allowed to downgrade.
390
- explicit = _parse_sets(args.set or [], set(dev.keys()))
391
- for key, status in explicit:
392
- dev[key] = status
393
- report["explicit_set"] = [f"{k}={s}" for k, s in explicit]
394
-
395
- def _meta(field, arg_value, default):
396
- if arg_value is not None:
397
- return arg_value
398
- if existing is not None and existing.get(field):
399
- return str(existing[field])
400
- return default
401
-
402
- generated = args.date
403
- if existing is not None and existing.get("generated"):
404
- generated = str(existing["generated"])
405
-
406
- if existing is not None and not args.fresh:
407
- # Round-trip the existing document: unknown top-level keys and their
408
- # comments survive; only the managed fields and development_status are
409
- # replaced.
410
- doc = existing
411
- else:
412
- doc = CommentedMap()
413
- doc.yaml_set_start_comment(HEADER_COMMENT)
414
- doc["generated"] = generated
415
- doc["last_updated"] = args.date
416
- doc["project"] = args.project
417
- doc["project_key"] = _meta("project_key", args.project_key, "NOKEY")
418
- doc["tracking_system"] = _meta("tracking_system", args.tracking_system, "file-system")
419
- doc["story_location"] = _meta("story_location", args.story_location, args.stories_dir)
420
- doc["development_status"] = dev
421
- if "action_items" not in doc and existing is not None and existing.get("action_items") is not None:
422
- doc["action_items"] = existing["action_items"]
423
- doc.yaml_set_comment_before_after_key(
424
- "action_items",
425
- before="\nAction items committed during retrospectives (section created by the retrospective workflow)",
426
- )
427
-
428
- result = {
429
- "ok": True,
430
- "action": "generate",
431
- "status_file": str(args.status_file),
432
- "dry_run": bool(args.dry_run),
433
- "fresh": bool(args.fresh),
434
- "epics": sum(1 for _, kind, _ in entries if kind == "epic"),
435
- "stories": sum(1 for _, kind, _ in entries if kind == "story"),
436
- "counts": _counts(dev),
437
- "generated": generated,
438
- "last_updated": args.date,
439
- "warnings": warnings,
440
- **report,
441
- }
442
-
443
- if args.dry_run:
444
- print(json.dumps(result, default=str))
445
- return
446
-
447
- try:
448
- payload = _dump_bytes(yaml, doc)
449
- _atomic_write(args.status_file, payload, original_mode)
450
- verify_yaml = _make_yaml()
451
- with io.open(args.status_file, "r", encoding="utf-8") as fh:
452
- reread = verify_yaml.load(fh)
453
- if dict(reread.get("development_status") or {}) != {k: v for k, v in dev.items()}:
454
- raise ValueError("development_status mismatch after write")
455
- for field in ("generated", "last_updated", "project"):
456
- if str(reread.get(field)) != str(doc[field]):
457
- raise ValueError(f"{field} mismatch after write")
458
- except Exception as exc:
459
- if original_bytes is not None:
460
- try:
461
- _atomic_write(args.status_file, original_bytes, original_mode)
462
- restored = True
463
- except Exception:
464
- restored = False
465
- else:
466
- Path(args.status_file).unlink(missing_ok=True)
467
- restored = True
468
- _fail(f"write or validation failed, original {'restored' if restored else 'NOT restored'}: {exc}",
469
- restored=restored)
470
- print(json.dumps(result, default=str))
471
-
472
-
473
- def _parse_stamp(value):
474
- from datetime import datetime
475
-
476
- for fmt in STAMP_FORMATS:
477
- try:
478
- return datetime.strptime(str(value), fmt)
479
- except ValueError:
480
- continue
481
- return None
482
-
483
-
484
- def cmd_status(args):
485
- from datetime import timedelta
486
-
487
- _, data = _load_existing(args.status_file)
488
- if data is None:
489
- _fail("status file does not exist — run sprint planning to generate it",
490
- status_file=str(args.status_file))
491
- dev = dict(data.get("development_status") or {})
492
- if not dev:
493
- _fail("development_status missing or empty — re-run sprint planning",
494
- status_file=str(args.status_file))
495
-
496
- warnings = []
497
- counts = {"story": {}, "epic": {}, "retro": {}}
498
- by_status = {}
499
- legacy_mapped, illegal, unrecognized = [], [], []
500
- epic_nums, story_epic_nums = set(), set()
501
- epic_status, retro_status = {}, {}
502
- for key, raw in dev.items():
503
- key = str(key)
504
- parsed = classify_key(key)
505
- if parsed is None:
506
- unrecognized.append({"key": key, "status": raw})
507
- continue
508
- kind, epic_num = parsed
509
- status, was_legacy = _normalize(raw)
510
- if was_legacy:
511
- legacy_mapped.append({"key": key, "from": raw, "to": status})
512
- if status not in RANKS[kind]:
513
- illegal.append({"key": key, "status": raw})
514
- continue
515
- counts[kind][status] = counts[kind].get(status, 0) + 1
516
- if kind == "story":
517
- by_status.setdefault(status, []).append(key)
518
- story_epic_nums.add(epic_num)
519
- elif kind == "epic":
520
- epic_nums.add(epic_num)
521
- epic_status[epic_num] = status
522
- else:
523
- retro_status[epic_num] = status
524
- for stories in by_status.values():
525
- stories.sort(key=_story_sort_key)
526
-
527
- action_items = data.get("action_items") or []
528
- open_items = []
529
- for i, item in enumerate(action_items):
530
- if not isinstance(item, dict):
531
- warnings.append(f"action_items[{i}] is not a mapping and was skipped: {item!r}")
532
- continue
533
- status = item.get("status")
534
- if status not in ACTION_STATUSES:
535
- warnings.append(f"action_items[{i}] has a missing or unknown status ({status!r})")
536
- continue
537
- if status in ("open", "in-progress"):
538
- open_items.append({k: item.get(k) for k in ("epic", "action", "owner", "status")})
539
-
540
- risks = []
541
- stamp = data.get("last_updated") or data.get("generated")
542
- if args.date and stamp:
543
- now, then = _parse_stamp(args.date), _parse_stamp(stamp)
544
- if now is None or then is None:
545
- warnings.append(
546
- f"timestamp format not recognized (--date {args.date!r}, file {stamp!r}); "
547
- "staleness check skipped"
548
- )
549
- elif now - then > timedelta(days=args.stale_days):
550
- risks.append(f"sprint-status.yaml may be stale (last updated {stamp})")
551
- for stories in by_status.values():
552
- for key in stories:
553
- num = classify_key(key)[1]
554
- if num not in epic_nums:
555
- risks.append(f"orphaned story '{key}' has no epic-{num} entry")
556
- for num, status in epic_status.items():
557
- if status == "in-progress" and num not in story_epic_nums:
558
- risks.append(f"in-progress epic 'epic-{num}' has no stories")
559
- if by_status.get("review"):
560
- risks.append(f"{len(by_status['review'])} story(ies) in review — run bmad-code-review")
561
- if unrecognized:
562
- risks.append(f"{len(unrecognized)} unrecognized key(s) in development_status — run validate")
563
-
564
- recommendation = None
565
- if by_status.get("in-progress"):
566
- recommendation = {"skill": "bmad-build", "story_key": by_status["in-progress"][0],
567
- "reason": "resume the in-progress story"}
568
- elif by_status.get("review"):
569
- recommendation = {"skill": "bmad-code-review", "story_key": by_status["review"][0],
570
- "reason": "review the completed implementation"}
571
- elif by_status.get("ready-for-dev"):
572
- recommendation = {"skill": "bmad-build", "story_key": by_status["ready-for-dev"][0],
573
- "reason": "start the next ready story"}
574
- elif by_status.get("backlog"):
575
- recommendation = {"skill": "bmad-build", "story_key": by_status["backlog"][0],
576
- "reason": "start the first backlog story"}
577
- else:
578
- optional_retros = sorted(num for num, status in retro_status.items() if status == "optional")
579
- if optional_retros:
580
- recommendation = {"skill": "bmad-retrospective", "story_key": None,
581
- "reason": f"all stories done — epic-{optional_retros[0]}-retrospective is still open"}
582
-
583
- print(json.dumps({
584
- "ok": True, "action": "status", "status_file": str(args.status_file),
585
- "project": data.get("project"), "project_key": data.get("project_key"),
586
- "tracking_system": data.get("tracking_system"),
587
- "generated": data.get("generated"), "last_updated": data.get("last_updated"),
588
- "stories": counts["story"], "epics": counts["epic"], "retrospectives": counts["retro"],
589
- "legacy_mapped": legacy_mapped, "illegal": illegal, "unrecognized": unrecognized,
590
- "open_action_items": open_items, "risks": risks, "warnings": warnings,
591
- "recommendation": recommendation,
592
- "all_done": recommendation is None,
593
- }, default=str))
594
-
595
-
596
- def cmd_validate(args):
597
- problems = []
598
- legacy_mapped = []
599
- path = Path(args.status_file)
600
- if not path.exists():
601
- print(json.dumps({
602
- "ok": True, "action": "validate", "status_file": str(args.status_file),
603
- "valid": False, "problems": ["status file does not exist"], "legacy_mapped": [],
604
- }))
605
- return
606
- yaml = _make_yaml()
607
- try:
608
- with io.open(args.status_file, "r", encoding="utf-8") as fh:
609
- data = yaml.load(fh)
610
- except Exception as exc:
611
- print(json.dumps({
612
- "ok": True, "action": "validate", "status_file": str(args.status_file),
613
- "valid": False, "problems": [f"not valid YAML: {exc}"], "legacy_mapped": [],
614
- }, default=str))
615
- return
616
- if not isinstance(data, dict):
617
- problems.append(f"top level is not a mapping (got {type(data).__name__})")
618
- else:
619
- for field in ("generated", "last_updated", "project", "development_status"):
620
- if data.get(field) is None:
621
- problems.append(f"missing required key '{field}'")
622
- for field in ("generated", "last_updated"):
623
- value = data.get(field)
624
- if value is not None and _parse_stamp(value) is None:
625
- problems.append(f"'{field}' timestamp {str(value)!r} does not match '{DATE_FORMAT}'")
626
- dev = data.get("development_status")
627
- if dev is not None and not isinstance(dev, dict):
628
- problems.append("development_status is not a mapping")
629
- elif dev:
630
- for key, raw in dev.items():
631
- parsed = classify_key(str(key))
632
- if parsed is None:
633
- problems.append(f"unrecognized key '{key}' (expected epic-N, N-M-slug, or epic-N-retrospective)")
634
- continue
635
- kind, _ = parsed
636
- status, was_legacy = _normalize(raw)
637
- if was_legacy:
638
- legacy_mapped.append({"key": str(key), "from": raw, "to": status})
639
- if status not in RANKS[kind]:
640
- problems.append(f"illegal {kind} status {str(raw)!r} on '{key}'")
641
- elif isinstance(data.get("development_status"), dict):
642
- problems.append("development_status is empty")
643
- items = data.get("action_items")
644
- if items is not None:
645
- if not isinstance(items, list):
646
- problems.append("action_items is not a list")
647
- else:
648
- for i, item in enumerate(items):
649
- if not isinstance(item, dict):
650
- problems.append(f"action_items[{i}] is not a mapping")
651
- elif item.get("status") not in ACTION_STATUSES:
652
- problems.append(
653
- f"action_items[{i}] has a missing or unknown status ({item.get('status')!r})"
654
- )
655
- print(json.dumps({
656
- "ok": True, "action": "validate", "status_file": str(args.status_file),
657
- "valid": not problems, "problems": problems, "legacy_mapped": legacy_mapped,
658
- }, default=str))
659
-
660
-
661
- def build_parser():
662
- parser = JsonArgumentParser(prog="sprint_plan.py", add_help=False)
663
- sub = parser.add_subparsers(dest="command", required=True, parser_class=JsonArgumentParser)
664
-
665
- gen = sub.add_parser("generate", add_help=False)
666
- gen.add_argument("--epic-file", action="append", required=True)
667
- gen.add_argument("--status-file", required=True)
668
- gen.add_argument("--stories-dir", required=True)
669
- gen.add_argument("--project", required=True)
670
- gen.add_argument("--date", required=True)
671
- gen.add_argument("--project-key", default=None)
672
- gen.add_argument("--tracking-system", default=None)
673
- gen.add_argument("--story-location", default=None)
674
- gen.add_argument("--dry-run", action="store_true")
675
- gen.add_argument("--fresh", action="store_true")
676
- gen.add_argument("--set", action="append", metavar="KEY=STATUS")
677
- gen.set_defaults(func=cmd_generate)
678
-
679
- st = sub.add_parser("status", add_help=False)
680
- st.add_argument("--status-file", required=True)
681
- st.add_argument("--date", default=None)
682
- st.add_argument("--stale-days", type=int, default=STALE_DAYS_DEFAULT)
683
- st.set_defaults(func=cmd_status)
684
-
685
- val = sub.add_parser("validate", add_help=False)
686
- val.add_argument("--status-file", required=True)
687
- val.set_defaults(func=cmd_validate)
688
- return parser
689
-
690
-
691
- def main(argv=None):
692
- args = build_parser().parse_args(argv)
693
- args.func(args)
694
-
695
-
696
- if __name__ == "__main__":
697
- if sys.platform == "win32":
698
- # Piped output on Windows defaults to a legacy code page, not UTF-8.
699
- sys.stdout.reconfigure(encoding="utf-8")
700
- sys.stderr.reconfigure(encoding="utf-8")
701
- main()