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,698 +0,0 @@
1
- #!/usr/bin/env python3
2
- # /// script
3
- # requires-python = ">=3.11"
4
- # ///
5
- """Deterministic Skill Validator
6
-
7
- Validates 10 deterministic rules across skill directories.
8
- Acts as a fast first-pass complement to the inference-based skill validator.
9
-
10
- What it checks:
11
- - SKILL-01: SKILL.md exists
12
- - SKILL-02: SKILL.md frontmatter has name
13
- - SKILL-03: SKILL.md frontmatter has description
14
- - SKILL-04: name format (lowercase, hyphens, no forbidden substrings)
15
- - SKILL-05: name matches directory basename
16
- - SKILL-06: description quality (length, "Use when"/"Use if")
17
- - SKILL-07: SKILL.md has body content after frontmatter
18
- - PATH-02: no installed_path variable
19
- - SEQ-02: no time estimates
20
- - TPL-01: template files must not contain compile-time {{.var}} substitutions
21
-
22
- Usage:
23
- uv run --python 3.11 tools/validate_skills.py # All skills, human-readable
24
- uv run --python 3.11 tools/validate_skills.py path/to/skill-dir # Single skill
25
- uv run --python 3.11 tools/validate_skills.py --strict # Exit 1 on HIGH+ findings
26
- uv run --python 3.11 tools/validate_skills.py --json # JSON output
27
- """
28
-
29
- from __future__ import annotations
30
-
31
- import argparse
32
- import json
33
- import os
34
- import re
35
- import sys
36
-
37
- sys.dont_write_bytecode = True
38
-
39
- PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
40
- SRC_DIR = os.path.join(PROJECT_ROOT, "src")
41
-
42
- # JS RegExp#toString() forms — Python's re.Pattern repr is not load-bearing for messages.
43
- NAME_REGEX_DISPLAY = r"/^(?:bmad|bmad-[a-z0-9]+(?:-[a-z0-9]+)*)$/"
44
-
45
- NAME_REGEX = re.compile(r"^(?:bmad|bmad-[a-z0-9]+(?:-[a-z0-9]+)*)$")
46
- TIME_ESTIMATE_PATTERNS = [
47
- re.compile(r"takes?\s+\d+\s*min", re.I),
48
- re.compile(r"~\s*\d+\s*min", re.I),
49
- re.compile(r"estimated\s+time", re.I),
50
- re.compile(r"\bETA\b"),
51
- ]
52
- TEMPLATE_FILENAME_REGEX = re.compile(r"template", re.I)
53
- COMPILE_TIME_SUB_REGEX = re.compile(r"\{\{\.\w+\}\}")
54
- INSTALLED_PATH_RE = re.compile(r"installed_path", re.I)
55
- USE_WHEN_RE = re.compile(r"use\s+when\b", re.I)
56
- USE_IF_RE = re.compile(r"use\s+if\b", re.I)
57
- DEPRECATED_RE = re.compile(r"^\s*deprecated\b", re.I)
58
-
59
- SKIP_DIRS = {"node_modules", ".git"}
60
- SCAN_EXTENSIONS = {".md", ".yaml", ".yml"}
61
-
62
- SEVERITY_ORDER = {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2, "LOW": 3}
63
-
64
-
65
- # --- Output Escaping ---
66
-
67
-
68
- def escape_annotation(s: str) -> str:
69
- return s.replace("%", "%25").replace("\r", "%0D").replace("\n", "%0A")
70
-
71
-
72
- def escape_table_cell(s: str) -> str:
73
- return str(s).replace("|", "\\|")
74
-
75
-
76
- def _relpath(to_path: str, start: str) -> str:
77
- rel = os.path.relpath(to_path, start)
78
- return "" if rel == "." else rel
79
-
80
-
81
- def _finding(
82
- rule: str,
83
- title: str,
84
- severity: str,
85
- file: str,
86
- detail: str,
87
- fix: str,
88
- line: int | None = None,
89
- ) -> dict:
90
- item = {
91
- "rule": rule,
92
- "title": title,
93
- "severity": severity,
94
- "file": file,
95
- "detail": detail,
96
- "fix": fix,
97
- }
98
- if line is not None:
99
- item["line"] = line
100
- return item
101
-
102
-
103
- # --- Frontmatter Parsing ---
104
-
105
-
106
- def _frontmatter_block(content: str) -> str | None:
107
- trimmed = content.lstrip()
108
- if not trimmed.startswith("---"):
109
- return None
110
-
111
- end_index = trimmed.find("\n---\n", 3)
112
- if end_index == -1:
113
- if trimmed.endswith("\n---"):
114
- end_index = len(trimmed) - 4
115
- else:
116
- return None
117
-
118
- return trimmed[3:end_index].strip()
119
-
120
-
121
- def _strip_quotes(value: str) -> str:
122
- if (value.startswith("'") and value.endswith("'")) or (
123
- value.startswith('"') and value.endswith('"')
124
- ):
125
- return value[1:-1]
126
- return value
127
-
128
-
129
- def parse_frontmatter(content: str) -> dict[str, str] | None:
130
- fm_block = _frontmatter_block(content)
131
- if fm_block is None:
132
- return None
133
- if fm_block == "":
134
- return {}
135
-
136
- result: dict[str, str] = {}
137
- for line in fm_block.split("\n"):
138
- colon_index = line.find(":")
139
- if colon_index == -1:
140
- continue
141
- # Skip indented lines (nested YAML values)
142
- if line[:1] in (" ", "\t"):
143
- continue
144
- key = line[:colon_index].strip()
145
- value = line[colon_index + 1 :].strip()
146
- result[key] = _strip_quotes(value)
147
- return result
148
-
149
-
150
- def parse_frontmatter_multiline(content: str) -> dict[str, str] | None:
151
- fm_block = _frontmatter_block(content)
152
- if fm_block is None:
153
- return None
154
- if fm_block == "":
155
- return {}
156
-
157
- result: dict[str, str] = {}
158
- current_key: str | None = None
159
- current_value = ""
160
-
161
- for line in fm_block.split("\n"):
162
- colon_index = line.find(":")
163
- # New key: column 0 (no leading whitespace) and colon not at index 0
164
- if colon_index > 0 and line[:1] not in (" ", "\t"):
165
- if current_key is not None:
166
- result[current_key] = _strip_quotes(current_value.strip())
167
- current_key = line[:colon_index].strip()
168
- current_value = line[colon_index + 1 :]
169
- elif current_key is not None:
170
- if line.lstrip().startswith("#"):
171
- continue
172
- current_value += "\n" + line
173
-
174
- if current_key is not None:
175
- result[current_key] = _strip_quotes(current_value.strip())
176
- return result
177
-
178
-
179
- # --- Safe File Reading ---
180
-
181
-
182
- def safe_read_file(file_path: str, findings: list[dict], rel_file: str | None) -> str | None:
183
- try:
184
- with open(file_path, encoding="utf-8", errors="replace", newline="") as f:
185
- return f.read()
186
- except OSError as error:
187
- findings.append(
188
- _finding(
189
- "READ-ERR",
190
- "File Read Error",
191
- "MEDIUM",
192
- rel_file or os.path.basename(file_path),
193
- f"Cannot read file: {error}",
194
- "Check file permissions and ensure the file exists.",
195
- )
196
- )
197
- return None
198
-
199
-
200
- # --- Code Block Stripping ---
201
-
202
-
203
- def _blank(match: re.Match[str]) -> str:
204
- return re.sub(r"[^\n]", "", match.group(0))
205
-
206
-
207
- def strip_code_blocks(content: str) -> str:
208
- return re.sub(r"```.*?```", _blank, content, flags=re.DOTALL)
209
-
210
-
211
- # --- Skill Discovery ---
212
-
213
-
214
- def discover_skill_dirs(root_dirs: list[str]) -> list[str]:
215
- skill_dirs: list[str] = []
216
-
217
- def walk(dir_path: str) -> None:
218
- if not os.path.exists(dir_path):
219
- return
220
- with os.scandir(dir_path) as it:
221
- entries = list(it)
222
- for entry in entries:
223
- if not entry.is_dir(follow_symlinks=False):
224
- continue
225
- if entry.name in SKIP_DIRS:
226
- continue
227
- full_path = entry.path
228
- if os.path.exists(os.path.join(full_path, "SKILL.md")):
229
- skill_dirs.append(full_path)
230
- walk(full_path)
231
-
232
- for root_dir in root_dirs:
233
- walk(root_dir)
234
- skill_dirs.sort()
235
- return skill_dirs
236
-
237
-
238
- # --- File Collection ---
239
-
240
-
241
- def collect_skill_files(skill_dir: str, findings: list[dict]) -> list[str]:
242
- files: list[str] = []
243
-
244
- def walk(current_dir: str) -> None:
245
- try:
246
- with os.scandir(current_dir) as it:
247
- entries = sorted(it, key=lambda e: e.name)
248
- except OSError as error:
249
- rel_file = _relpath(current_dir, skill_dir)
250
- findings.append(
251
- _finding(
252
- "READ-ERR",
253
- "File Read Error",
254
- "MEDIUM",
255
- rel_file or os.path.basename(current_dir),
256
- f"Cannot read file: {error}",
257
- "Check file permissions and ensure the file exists.",
258
- )
259
- )
260
- return
261
- for entry in entries:
262
- if entry.name in SKIP_DIRS:
263
- continue
264
- if entry.is_dir(follow_symlinks=False):
265
- walk(entry.path)
266
- elif entry.is_file(follow_symlinks=False):
267
- files.append(entry.path)
268
-
269
- walk(skill_dir)
270
- return files
271
-
272
-
273
- # --- Rule Checks ---
274
-
275
-
276
- def validate_skill(skill_dir: str) -> list[dict]:
277
- findings: list[dict] = []
278
- dir_name = os.path.basename(skill_dir)
279
- skill_md_path = os.path.join(skill_dir, "SKILL.md")
280
-
281
- all_files = collect_skill_files(skill_dir, findings)
282
-
283
- if not os.path.exists(skill_md_path):
284
- findings.append(
285
- _finding(
286
- "SKILL-01",
287
- "SKILL.md Must Exist",
288
- "CRITICAL",
289
- "SKILL.md",
290
- "SKILL.md not found in skill directory.",
291
- "Create SKILL.md as the skill entrypoint.",
292
- )
293
- )
294
- return findings
295
-
296
- skill_content = safe_read_file(skill_md_path, findings, "SKILL.md")
297
- if skill_content is None:
298
- return findings
299
- skill_fm = parse_frontmatter_multiline(skill_content)
300
-
301
- if not skill_fm or "name" not in skill_fm:
302
- findings.append(
303
- _finding(
304
- "SKILL-02",
305
- "SKILL.md Must Have name in Frontmatter",
306
- "CRITICAL",
307
- "SKILL.md",
308
- "Frontmatter is missing the `name` field.",
309
- "Add `name: <skill-name>` to the frontmatter.",
310
- )
311
- )
312
- elif skill_fm["name"] == "":
313
- findings.append(
314
- _finding(
315
- "SKILL-02",
316
- "SKILL.md Must Have name in Frontmatter",
317
- "CRITICAL",
318
- "SKILL.md",
319
- "Frontmatter `name` field is empty.",
320
- "Set `name` to the skill directory name (kebab-case).",
321
- )
322
- )
323
-
324
- if not skill_fm or "description" not in skill_fm:
325
- findings.append(
326
- _finding(
327
- "SKILL-03",
328
- "SKILL.md Must Have description in Frontmatter",
329
- "CRITICAL",
330
- "SKILL.md",
331
- "Frontmatter is missing the `description` field.",
332
- "Add `description: <what it does and when to use it>` to the frontmatter.",
333
- )
334
- )
335
- elif skill_fm["description"] == "":
336
- findings.append(
337
- _finding(
338
- "SKILL-03",
339
- "SKILL.md Must Have description in Frontmatter",
340
- "CRITICAL",
341
- "SKILL.md",
342
- "Frontmatter `description` field is empty.",
343
- "Add a description stating what the skill does and when to use it.",
344
- )
345
- )
346
-
347
- name = skill_fm.get("name") if skill_fm else None
348
- description = skill_fm.get("description") if skill_fm else None
349
-
350
- is_deprecated = isinstance(description, str) and bool(DEPRECATED_RE.search(description))
351
-
352
- if name and not NAME_REGEX.search(name):
353
- findings.append(
354
- _finding(
355
- "SKILL-04",
356
- "name Format",
357
- "HIGH",
358
- "SKILL.md",
359
- f'name "{name}" does not match pattern: {NAME_REGEX_DISPLAY}',
360
- "Rename to comply with lowercase letters, numbers, and hyphens only (max 64 chars).",
361
- )
362
- )
363
-
364
- if name and name != dir_name:
365
- findings.append(
366
- _finding(
367
- "SKILL-05",
368
- "name Must Match Directory Name",
369
- "HIGH",
370
- "SKILL.md",
371
- f'name "{name}" does not match directory name "{dir_name}".',
372
- f'Change name to "{dir_name}" or rename the directory.',
373
- )
374
- )
375
-
376
- if description:
377
- if len(description) > 1024:
378
- findings.append(
379
- _finding(
380
- "SKILL-06",
381
- "description Quality",
382
- "MEDIUM",
383
- "SKILL.md",
384
- f"description is {len(description)} characters (max 1024).",
385
- "Shorten the description to 1024 characters or less.",
386
- )
387
- )
388
-
389
- if not is_deprecated and not USE_WHEN_RE.search(description) and not USE_IF_RE.search(description):
390
- findings.append(
391
- _finding(
392
- "SKILL-06",
393
- "description Quality",
394
- "MEDIUM",
395
- "SKILL.md",
396
- 'description does not contain "Use when" or "Use if" trigger phrase.',
397
- 'Append a "Use when..." clause to explain when to invoke this skill.',
398
- )
399
- )
400
-
401
- trimmed = skill_content.lstrip()
402
- body_start = -1
403
- if trimmed.startswith("---"):
404
- end_idx = trimmed.find("\n---\n", 3)
405
- if end_idx != -1:
406
- body_start = end_idx + 4
407
- elif trimmed.endswith("\n---"):
408
- body_start = len(trimmed)
409
- else:
410
- body_start = 0
411
- body = trimmed[body_start:].strip() if body_start >= 0 else ""
412
- if body == "":
413
- findings.append(
414
- _finding(
415
- "SKILL-07",
416
- "SKILL.md Must Have Body Content",
417
- "HIGH",
418
- "SKILL.md",
419
- "SKILL.md has no content after frontmatter. L2 instructions are required.",
420
- "Add markdown body with skill instructions after the closing ---.",
421
- )
422
- )
423
-
424
- for file_path in all_files:
425
- ext = os.path.splitext(file_path)[1]
426
- if ext not in SCAN_EXTENSIONS:
427
- continue
428
-
429
- rel_file = _relpath(file_path, skill_dir)
430
- content = safe_read_file(file_path, findings, rel_file)
431
- if content is None:
432
- continue
433
-
434
- fm = parse_frontmatter(content)
435
- if fm and "installed_path" in fm:
436
- findings.append(
437
- _finding(
438
- "PATH-02",
439
- "No installed_path Variable",
440
- "HIGH",
441
- rel_file,
442
- "Frontmatter contains `installed_path:` key.",
443
- "Remove `installed_path` from frontmatter. Use relative paths instead.",
444
- )
445
- )
446
-
447
- stripped = strip_code_blocks(content)
448
- for i, line in enumerate(stripped.split("\n")):
449
- if INSTALLED_PATH_RE.search(line):
450
- findings.append(
451
- _finding(
452
- "PATH-02",
453
- "No installed_path Variable",
454
- "HIGH",
455
- rel_file,
456
- "`installed_path` reference found in content.",
457
- "Remove all installed_path usage. Use relative paths (`./path` or `../path`) instead.",
458
- line=i + 1,
459
- )
460
- )
461
-
462
- for file_path in all_files:
463
- ext = os.path.splitext(file_path)[1]
464
- if ext not in SCAN_EXTENSIONS:
465
- continue
466
-
467
- rel_file = _relpath(file_path, skill_dir)
468
- content = safe_read_file(file_path, findings, rel_file)
469
- if content is None:
470
- continue
471
- stripped = strip_code_blocks(content)
472
-
473
- for i, line in enumerate(stripped.split("\n")):
474
- for pattern in TIME_ESTIMATE_PATTERNS:
475
- if pattern.search(line):
476
- findings.append(
477
- _finding(
478
- "SEQ-02",
479
- "No Time Estimates",
480
- "LOW",
481
- rel_file,
482
- f'Time estimate pattern found: "{line.strip()}"',
483
- "Remove time estimates — AI execution speed varies too much.",
484
- line=i + 1,
485
- )
486
- )
487
- break
488
-
489
- for file_path in all_files:
490
- if os.path.splitext(file_path)[1] != ".md":
491
- continue
492
- base = os.path.basename(file_path)
493
- if not TEMPLATE_FILENAME_REGEX.search(base):
494
- continue
495
-
496
- rel_file = _relpath(file_path, skill_dir)
497
- content = safe_read_file(file_path, findings, rel_file)
498
- if content is None:
499
- continue
500
-
501
- for i, line in enumerate(content.split("\n")):
502
- match = COMPILE_TIME_SUB_REGEX.search(line)
503
- if match:
504
- findings.append(
505
- _finding(
506
- "TPL-01",
507
- "Template files must not contain compile-time substitutions",
508
- "HIGH",
509
- rel_file,
510
- f"Template file contains compile-time substitution `{match.group(0)}` — this would be baked at render time and leak a machine-local value into every spec produced from the template.",
511
- "Remove the `{{.var}}` reference. Use single-curly `{var}` if the value should be resolved at LLM runtime by the consumer of the generated spec.",
512
- line=i + 1,
513
- )
514
- )
515
-
516
- return findings
517
-
518
-
519
- # --- Output Formatting ---
520
-
521
-
522
- def format_human_readable(
523
- results: list[dict],
524
- project_root: str,
525
- src_dir: str,
526
- strict: bool,
527
- json_output: bool,
528
- github_actions: bool,
529
- ) -> tuple[str, bool]:
530
- output: list[str] = []
531
- total_findings = 0
532
- severity_counts = {"CRITICAL": 0, "HIGH": 0, "MEDIUM": 0, "LOW": 0}
533
-
534
- mode = "STRICT (exit 1 on HIGH+)" if strict else "WARNING (exit 0)"
535
- if json_output:
536
- mode += " + JSON"
537
- output.extend(
538
- [
539
- f"\nValidating skills in: {src_dir}",
540
- f"Mode: {mode}\n",
541
- ]
542
- )
543
-
544
- total_skills = 0
545
- skills_with_findings = 0
546
-
547
- for result in results:
548
- skill_dir = result["skillDir"]
549
- findings = result["findings"]
550
- total_skills += 1
551
- rel_dir = _relpath(skill_dir, project_root)
552
-
553
- if findings:
554
- skills_with_findings += 1
555
- output.append(f"\n{rel_dir}")
556
-
557
- for f in findings:
558
- total_findings += 1
559
- severity_counts[f["severity"]] += 1
560
- location = f" (line {f['line']})" if f.get("line") else ""
561
- output.extend(
562
- [
563
- f" [{f['severity']}] {f['rule']} — {f['title']}",
564
- f" File: {f['file']}{location}",
565
- f" {f['detail']}",
566
- ]
567
- )
568
-
569
- if github_actions:
570
- abs_file = os.path.join(skill_dir, f["file"])
571
- gh_file = _relpath(abs_file, project_root)
572
- line = f.get("line") or 1
573
- level = "notice" if f["severity"] == "LOW" else "warning"
574
- message = escape_annotation(f"{f['rule']}: {f['detail']}")
575
- print(f"::{level} file={gh_file},line={line}::{message}")
576
-
577
- output.extend(
578
- [
579
- f"\n{'─' * 60}",
580
- "\nSummary:",
581
- f" Skills scanned: {total_skills}",
582
- f" Skills with findings: {skills_with_findings}",
583
- f" Total findings: {total_findings}",
584
- ]
585
- )
586
-
587
- if total_findings > 0:
588
- output.extend(["", " | Severity | Count |", " |----------|-------|"])
589
- for sev in ("CRITICAL", "HIGH", "MEDIUM", "LOW"):
590
- if severity_counts[sev] > 0:
591
- output.append(f" | {sev:<8} | {severity_counts[sev]:>5} |")
592
-
593
- has_high_plus = severity_counts["CRITICAL"] > 0 or severity_counts["HIGH"] > 0
594
-
595
- if total_findings == 0:
596
- output.append("\n All skills passed validation!")
597
- elif strict and has_high_plus:
598
- output.append("\n [STRICT MODE] HIGH+ findings found — exiting with failure.")
599
- elif strict:
600
- output.append("\n [STRICT MODE] Only MEDIUM/LOW findings — pass.")
601
- else:
602
- output.append("\n Run with --strict to treat HIGH+ findings as errors.")
603
-
604
- output.append("")
605
-
606
- step_summary = os.environ.get("GITHUB_STEP_SUMMARY")
607
- if step_summary:
608
- summary = "## Skill Validation\n\n"
609
- if total_findings > 0:
610
- summary += "| Skill | Rule | Severity | File | Detail |\n"
611
- summary += "|-------|------|----------|------|--------|\n"
612
- for result in results:
613
- rel_dir = _relpath(result["skillDir"], project_root)
614
- for f in result["findings"]:
615
- summary += (
616
- f"| {escape_table_cell(rel_dir)} | {f['rule']} | {f['severity']} | "
617
- f"{escape_table_cell(f['file'])} | {escape_table_cell(f['detail'])} |\n"
618
- )
619
- summary += "\n"
620
- summary += f"**{total_skills} skills scanned, {total_findings} findings**\n"
621
- with open(step_summary, "a", encoding="utf-8") as fh:
622
- fh.write(summary)
623
-
624
- return "\n".join(output), has_high_plus
625
-
626
-
627
- def format_json(results: list[dict], project_root: str) -> tuple[str, bool]:
628
- all_findings: list[dict] = []
629
- for result in results:
630
- rel_dir = _relpath(result["skillDir"], project_root)
631
- for f in result["findings"]:
632
- all_findings.append(
633
- {
634
- "skill": rel_dir,
635
- "rule": f["rule"],
636
- "title": f["title"],
637
- "severity": f["severity"],
638
- "file": f["file"],
639
- "line": f.get("line") or None,
640
- "detail": f["detail"],
641
- "fix": f["fix"],
642
- }
643
- )
644
-
645
- all_findings.sort(key=lambda item: SEVERITY_ORDER[item["severity"]])
646
- has_high_plus = any(f["severity"] in ("CRITICAL", "HIGH") for f in all_findings)
647
- return json.dumps(all_findings, indent=2, ensure_ascii=False), has_high_plus
648
-
649
-
650
- # --- Main ---
651
-
652
-
653
- def run(
654
- project_root: str,
655
- skill_dir: str | None = None,
656
- strict: bool = False,
657
- json_output: bool = False,
658
- ) -> int:
659
- src_dir = os.path.join(project_root, "src")
660
- github_actions = bool(os.environ.get("GITHUB_ACTIONS"))
661
-
662
- if skill_dir is not None:
663
- target = os.path.abspath(skill_dir)
664
- if not os.path.isdir(target):
665
- print(f'Error: "{skill_dir}" is not a valid directory.', file=sys.stderr)
666
- return 2
667
- skill_dirs = [target]
668
- else:
669
- skill_dirs = discover_skill_dirs([src_dir])
670
-
671
- if not skill_dirs:
672
- print("No skill directories found.", file=sys.stderr)
673
- return 2
674
-
675
- results = [{"skillDir": d, "findings": validate_skill(d)} for d in skill_dirs]
676
-
677
- if json_output:
678
- output, has_high_plus = format_json(results, project_root)
679
- else:
680
- output, has_high_plus = format_human_readable(
681
- results, project_root, src_dir, strict, json_output, github_actions
682
- )
683
- print(output)
684
-
685
- return 1 if strict and has_high_plus else 0
686
-
687
-
688
- def main(argv: list[str] | None = None) -> int:
689
- parser = argparse.ArgumentParser(description="Validate skill directories against deterministic rules.")
690
- parser.add_argument("--strict", action="store_true", help="exit 1 on HIGH+ findings")
691
- parser.add_argument("--json", action="store_true", dest="json_output", help="JSON output")
692
- parser.add_argument("skill_dir", nargs="?", default=None, help="single skill directory")
693
- args = parser.parse_args(argv)
694
- return run(PROJECT_ROOT, skill_dir=args.skill_dir, strict=args.strict, json_output=args.json_output)
695
-
696
-
697
- if __name__ == "__main__":
698
- sys.exit(main())