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.
- package/LICENSE +1 -1
- package/README.md +107 -54
- package/agents.json +640 -0
- package/bin/bmad-method.js +4 -0
- package/messages.yaml +260 -0
- package/modules.yaml +56 -0
- package/package.json +32 -110
- package/src/agent-picks.js +77 -0
- package/src/agents.js +141 -0
- package/src/bmad-scripts.js +167 -0
- package/src/cli.js +266 -0
- package/src/commands/agent-choice.js +67 -0
- package/src/commands/apply.js +38 -0
- package/src/commands/deps.js +25 -0
- package/src/commands/ending.js +54 -0
- package/src/commands/existing-install.js +50 -0
- package/src/commands/install-plan.js +130 -0
- package/src/commands/install-steps.js +66 -0
- package/src/commands/install.js +86 -0
- package/src/commands/status.js +39 -0
- package/src/commands/update.js +106 -0
- package/src/installed.js +48 -0
- package/src/messages.js +84 -0
- package/src/modules.js +221 -0
- package/src/preflight.js +124 -0
- package/src/project-lock.js +68 -0
- package/src/prompts.js +626 -0
- package/src/report.js +199 -0
- package/src/run.js +124 -0
- package/src/self-update.js +88 -0
- package/src/skills-cli.js +133 -0
- package/src/version.js +11 -0
- package/.claude-plugin/marketplace.json +0 -53
- package/AGENTS.md +0 -24
- package/CLAUDE.md +0 -1
- package/README_CN.md +0 -98
- package/README_KR.md +0 -90
- package/README_VN.md +0 -99
- package/bmad-modules.yaml +0 -140
- package/body.md +0 -17
- package/greptile.json +0 -52
- package/removals.txt +0 -87
- package/src/bmm-skills/agents/bmad-agent-analyst/SKILL.md +0 -76
- package/src/bmm-skills/agents/bmad-agent-analyst/customize.toml +0 -103
- package/src/bmm-skills/agents/bmad-agent-architect/SKILL.md +0 -76
- package/src/bmm-skills/agents/bmad-agent-architect/customize.toml +0 -63
- package/src/bmm-skills/agents/bmad-agent-dev/SKILL.md +0 -76
- package/src/bmm-skills/agents/bmad-agent-dev/customize.toml +0 -81
- package/src/bmm-skills/agents/bmad-agent-pm/SKILL.md +0 -76
- package/src/bmm-skills/agents/bmad-agent-pm/customize.toml +0 -73
- package/src/bmm-skills/agents/bmad-agent-ux-designer/SKILL.md +0 -76
- package/src/bmm-skills/agents/bmad-agent-ux-designer/customize.toml +0 -58
- package/src/bmm-skills/module-help.csv +0 -19
- package/src/bmm-skills/module.yaml +0 -85
- package/src/bmm-skills/plan/bmad-architecture/SKILL.md +0 -85
- package/src/bmm-skills/plan/bmad-architecture/assets/spine-template.md +0 -79
- package/src/bmm-skills/plan/bmad-architecture/customize.toml +0 -101
- package/src/bmm-skills/plan/bmad-architecture/references/headless.md +0 -26
- package/src/bmm-skills/plan/bmad-architecture/references/reviewer-gate.md +0 -13
- package/src/bmm-skills/plan/bmad-architecture/scripts/lint_spine.py +0 -261
- package/src/bmm-skills/plan/bmad-architecture/scripts/tests/test_lint_spine.py +0 -270
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/SKILL.md +0 -93
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/customize.toml +0 -39
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-01-validate-prerequisites.md +0 -263
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-02-design-epics.md +0 -242
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-03-create-stories.md +0 -255
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/steps/step-04-final-validation.md +0 -141
- package/src/bmm-skills/plan/bmad-create-epics-and-stories/templates/epics-template.md +0 -62
- package/src/bmm-skills/plan/bmad-generate-project-context/SKILL.md +0 -12
- package/src/bmm-skills/plan/bmad-prd/SKILL.md +0 -94
- package/src/bmm-skills/plan/bmad-prd/assets/headless-schemas.md +0 -76
- package/src/bmm-skills/plan/bmad-prd/assets/prd-template.md +0 -165
- package/src/bmm-skills/plan/bmad-prd/assets/prd-validation-checklist.md +0 -135
- package/src/bmm-skills/plan/bmad-prd/assets/validation-report-template.html +0 -325
- package/src/bmm-skills/plan/bmad-prd/customize.toml +0 -148
- package/src/bmm-skills/plan/bmad-prd/references/headless.md +0 -39
- package/src/bmm-skills/plan/bmad-prd/references/validate.md +0 -97
- package/src/bmm-skills/plan/bmad-prfaq/SKILL.md +0 -135
- package/src/bmm-skills/plan/bmad-prfaq/agents/artifact-analyzer.md +0 -60
- package/src/bmm-skills/plan/bmad-prfaq/agents/web-researcher.md +0 -49
- package/src/bmm-skills/plan/bmad-prfaq/assets/prfaq-template.md +0 -62
- package/src/bmm-skills/plan/bmad-prfaq/bmad-manifest.json +0 -16
- package/src/bmm-skills/plan/bmad-prfaq/customize.toml +0 -39
- package/src/bmm-skills/plan/bmad-prfaq/references/customer-faq.md +0 -55
- package/src/bmm-skills/plan/bmad-prfaq/references/internal-faq.md +0 -51
- package/src/bmm-skills/plan/bmad-prfaq/references/press-release.md +0 -60
- package/src/bmm-skills/plan/bmad-prfaq/references/verdict.md +0 -83
- package/src/bmm-skills/plan/bmad-product-brief/SKILL.md +0 -91
- package/src/bmm-skills/plan/bmad-product-brief/assets/brief-template.md +0 -41
- package/src/bmm-skills/plan/bmad-product-brief/customize.toml +0 -100
- package/src/bmm-skills/plan/bmad-project-context/SKILL.md +0 -121
- package/src/bmm-skills/plan/bmad-project-context/customize.toml +0 -24
- package/src/bmm-skills/plan/bmad-project-context/references/best-practices.md +0 -84
- package/src/bmm-skills/plan/bmad-project-context/references/template.md +0 -55
- package/src/bmm-skills/plan/bmad-spec/SKILL.md +0 -160
- package/src/bmm-skills/plan/bmad-spec/assets/headless-schemas.md +0 -33
- package/src/bmm-skills/plan/bmad-spec/assets/spec-template.md +0 -49
- package/src/bmm-skills/plan/bmad-spec/assets/stories-schema.md +0 -44
- package/src/bmm-skills/plan/bmad-spec/customize.toml +0 -52
- package/src/bmm-skills/plan/bmad-sprint-planning/SKILL.md +0 -62
- package/src/bmm-skills/plan/bmad-sprint-planning/customize.toml +0 -39
- package/src/bmm-skills/plan/bmad-sprint-planning/references/fix-sprint-status.md +0 -30
- package/src/bmm-skills/plan/bmad-sprint-planning/references/generate-tracking.md +0 -25
- package/src/bmm-skills/plan/bmad-sprint-planning/references/readiness-gate.md +0 -20
- package/src/bmm-skills/plan/bmad-sprint-planning/references/status-view.md +0 -14
- package/src/bmm-skills/plan/bmad-sprint-planning/references/validate.md +0 -10
- package/src/bmm-skills/plan/bmad-sprint-planning/scripts/__pycache__/sprint_plan.cpython-311.pyc +0 -0
- package/src/bmm-skills/plan/bmad-sprint-planning/scripts/sprint_plan.py +0 -701
- package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/__pycache__/test_sprint_plan.cpython-311-pytest-9.1.1.pyc +0 -0
- package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/test_sprint_plan.py +0 -524
- package/src/bmm-skills/plan/bmad-sprint-planning/sprint-status-template.yaml +0 -71
- package/src/bmm-skills/plan/bmad-ux/SKILL.md +0 -90
- package/src/bmm-skills/plan/bmad-ux/assets/color-themes.md +0 -9
- package/src/bmm-skills/plan/bmad-ux/assets/design-directions.md +0 -9
- package/src/bmm-skills/plan/bmad-ux/assets/design-example-editorial.md +0 -158
- package/src/bmm-skills/plan/bmad-ux/assets/design-example-mobile.md +0 -93
- package/src/bmm-skills/plan/bmad-ux/assets/design-example-shadcn.md +0 -109
- package/src/bmm-skills/plan/bmad-ux/assets/excalidraw-wireframe.md +0 -19
- package/src/bmm-skills/plan/bmad-ux/assets/experience-example-mobile.md +0 -112
- package/src/bmm-skills/plan/bmad-ux/assets/experience-example-shadcn.md +0 -133
- package/src/bmm-skills/plan/bmad-ux/assets/headless-schemas.md +0 -84
- package/src/bmm-skills/plan/bmad-ux/assets/key-screens.md +0 -29
- package/src/bmm-skills/plan/bmad-ux/assets/validation-report-template.html +0 -319
- package/src/bmm-skills/plan/bmad-ux/customize.toml +0 -100
- package/src/bmm-skills/plan/bmad-ux/references/creative-tools.md +0 -19
- package/src/bmm-skills/plan/bmad-ux/references/design-md-spec.md +0 -50
- package/src/bmm-skills/plan/bmad-ux/references/headless.md +0 -37
- package/src/bmm-skills/plan/bmad-ux/references/validate.md +0 -115
- package/src/bmm-skills/ship/bmad-build/SKILL.md +0 -13
- package/src/bmm-skills/ship/bmad-build/compile-epic-context.md +0 -62
- package/src/bmm-skills/ship/bmad-build/customize.toml +0 -152
- package/src/bmm-skills/ship/bmad-build/references/claims-check.md +0 -14
- package/src/bmm-skills/ship/bmad-build/references/deletion-check.md +0 -14
- package/src/bmm-skills/ship/bmad-build/review-prompts/edge-case-hunter.md +0 -112
- package/src/bmm-skills/ship/bmad-build/review-prompts/verification-gap.md +0 -113
- package/src/bmm-skills/ship/bmad-build/spec-template.md +0 -111
- package/src/bmm-skills/ship/bmad-build/step-01-clarify-and-route.md +0 -100
- package/src/bmm-skills/ship/bmad-build/step-02-plan.md +0 -62
- package/src/bmm-skills/ship/bmad-build/step-03-implement.md +0 -51
- package/src/bmm-skills/ship/bmad-build/step-04-review.md +0 -85
- package/src/bmm-skills/ship/bmad-build/step-05-present.md +0 -43
- package/src/bmm-skills/ship/bmad-build/step-oneshot.md +0 -107
- package/src/bmm-skills/ship/bmad-build/sync-sprint-status.md +0 -5
- package/src/bmm-skills/ship/bmad-build/workflow.md +0 -84
- package/src/bmm-skills/ship/bmad-build-auto/SKILL.md +0 -13
- package/src/bmm-skills/ship/bmad-build-auto/compile-epic-context.md +0 -62
- package/src/bmm-skills/ship/bmad-build-auto/customize.toml +0 -119
- package/src/bmm-skills/ship/bmad-build-auto/references/claims-check.md +0 -14
- package/src/bmm-skills/ship/bmad-build-auto/references/deletion-check.md +0 -14
- package/src/bmm-skills/ship/bmad-build-auto/review-prompts/edge-case-hunter.md +0 -112
- package/src/bmm-skills/ship/bmad-build-auto/review-prompts/verification-gap.md +0 -113
- package/src/bmm-skills/ship/bmad-build-auto/spec-template.md +0 -96
- package/src/bmm-skills/ship/bmad-build-auto/step-01-clarify-and-route.md +0 -84
- package/src/bmm-skills/ship/bmad-build-auto/step-02-plan.md +0 -27
- package/src/bmm-skills/ship/bmad-build-auto/step-03-implement.md +0 -48
- package/src/bmm-skills/ship/bmad-build-auto/step-04-review.md +0 -116
- package/src/bmm-skills/ship/bmad-build-auto/workflow.md +0 -104
- package/src/bmm-skills/ship/bmad-code-review/SKILL.md +0 -90
- package/src/bmm-skills/ship/bmad-code-review/customize.toml +0 -110
- package/src/bmm-skills/ship/bmad-code-review/references/claims-check.md +0 -14
- package/src/bmm-skills/ship/bmad-code-review/references/deletion-check.md +0 -14
- package/src/bmm-skills/ship/bmad-code-review/review-prompts/edge-case-hunter.md +0 -112
- package/src/bmm-skills/ship/bmad-code-review/review-prompts/verification-gap.md +0 -113
- package/src/bmm-skills/ship/bmad-code-review/steps/step-01-gather-context.md +0 -94
- package/src/bmm-skills/ship/bmad-code-review/steps/step-02-review.md +0 -32
- package/src/bmm-skills/ship/bmad-code-review/steps/step-03-triage.md +0 -54
- package/src/bmm-skills/ship/bmad-code-review/steps/step-04-present.md +0 -134
- package/src/bmm-skills/ship/bmad-correct-course/SKILL.md +0 -308
- package/src/bmm-skills/ship/bmad-correct-course/checklist.md +0 -288
- package/src/bmm-skills/ship/bmad-correct-course/customize.toml +0 -39
- package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/SKILL.md +0 -176
- package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/checklist.md +0 -33
- package/src/bmm-skills/ship/bmad-qa-generate-e2e-tests/customize.toml +0 -39
- package/src/bmm-skills/ship/bmad-retrospective/SKILL.md +0 -94
- package/src/bmm-skills/ship/bmad-retrospective/customize.toml +0 -39
- package/src/bmm-skills/ship/bmad-retrospective/references/acceptance-verdict.md +0 -55
- package/src/bmm-skills/ship/bmad-retrospective/references/aggregate-views.md +0 -17
- package/src/bmm-skills/ship/bmad-retrospective/references/evidence-gathering.md +0 -30
- package/src/bmm-skills/ship/bmad-retrospective/references/retro-document.md +0 -84
- package/src/bmm-skills/ship/bmad-retrospective/references/team-discussion.md +0 -22
- package/src/bmm-skills/ship/bmad-retrospective/scripts/__pycache__/sprint_status.cpython-311.pyc +0 -0
- package/src/bmm-skills/ship/bmad-retrospective/scripts/git_evidence.py +0 -308
- package/src/bmm-skills/ship/bmad-retrospective/scripts/sprint_status.py +0 -750
- package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_git_evidence.cpython-311-pytest-9.1.1.pyc +0 -0
- package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_sprint_status.cpython-311-pytest-9.1.1.pyc +0 -0
- package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/fixtures/sprint-status-template.yaml +0 -71
- package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_git_evidence.py +0 -750
- package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/test_sprint_status.py +0 -1579
- package/src/bmm-skills/ship/bmad-walkthrough/SKILL.md +0 -68
- package/src/bmm-skills/ship/bmad-walkthrough/customize.toml +0 -39
- package/src/bmm-skills/ship/bmad-walkthrough/generate-trail.md +0 -38
- package/src/bmm-skills/ship/bmad-walkthrough/step-01-orientation.md +0 -105
- package/src/bmm-skills/ship/bmad-walkthrough/step-02-walkthrough.md +0 -89
- package/src/bmm-skills/ship/bmad-walkthrough/step-03-detail-pass.md +0 -106
- package/src/bmm-skills/ship/bmad-walkthrough/step-04-testing.md +0 -74
- package/src/bmm-skills/ship/bmad-walkthrough/step-05-wrapup.md +0 -30
- package/src/bmm-skills/v6-shims/README.md +0 -29
- package/src/bmm-skills/v6-shims/bmad-checkpoint-preview/SKILL.md +0 -21
- package/src/bmm-skills/v6-shims/bmad-create-architecture/SKILL.md +0 -32
- package/src/bmm-skills/v6-shims/bmad-create-architecture/customize.toml +0 -39
- package/src/bmm-skills/v6-shims/bmad-create-prd/SKILL.md +0 -32
- package/src/bmm-skills/v6-shims/bmad-create-prd/customize.toml +0 -39
- package/src/bmm-skills/v6-shims/bmad-create-story/SKILL.md +0 -436
- package/src/bmm-skills/v6-shims/bmad-create-story/checklist.md +0 -357
- package/src/bmm-skills/v6-shims/bmad-create-story/customize.toml +0 -39
- package/src/bmm-skills/v6-shims/bmad-create-story/discover-inputs.md +0 -88
- package/src/bmm-skills/v6-shims/bmad-create-story/template.md +0 -49
- package/src/bmm-skills/v6-shims/bmad-dev-auto/SKILL.md +0 -21
- package/src/bmm-skills/v6-shims/bmad-dev-story/SKILL.md +0 -504
- package/src/bmm-skills/v6-shims/bmad-dev-story/checklist.md +0 -80
- package/src/bmm-skills/v6-shims/bmad-dev-story/customize.toml +0 -39
- package/src/bmm-skills/v6-shims/bmad-document-project/SKILL.md +0 -16
- package/src/bmm-skills/v6-shims/bmad-domain-research/SKILL.md +0 -16
- package/src/bmm-skills/v6-shims/bmad-edit-prd/SKILL.md +0 -32
- package/src/bmm-skills/v6-shims/bmad-edit-prd/customize.toml +0 -40
- package/src/bmm-skills/v6-shims/bmad-market-research/SKILL.md +0 -16
- package/src/bmm-skills/v6-shims/bmad-quick-dev/SKILL.md +0 -21
- package/src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md +0 -28
- package/src/bmm-skills/v6-shims/bmad-sprint-status/customize.toml +0 -39
- package/src/bmm-skills/v6-shims/bmad-technical-research/SKILL.md +0 -16
- package/src/bmm-skills/v6-shims/bmad-validate-prd/SKILL.md +0 -32
- package/src/bmm-skills/v6-shims/bmad-validate-prd/customize.toml +0 -40
- package/src/core-skills/bmad-advanced-elicitation/SKILL.md +0 -64
- package/src/core-skills/bmad-advanced-elicitation/assets/methods.csv +0 -72
- package/src/core-skills/bmad-advanced-elicitation/customize.toml +0 -54
- package/src/core-skills/bmad-advanced-elicitation/scripts/pick_methods.py +0 -233
- package/src/core-skills/bmad-advanced-elicitation/scripts/tests/test_pick_methods.py +0 -228
- package/src/core-skills/bmad-brainstorming/SKILL.md +0 -80
- package/src/core-skills/bmad-brainstorming/assets/brain-icons.json +0 -166
- package/src/core-skills/bmad-brainstorming/assets/brain-methods.csv +0 -109
- package/src/core-skills/bmad-brainstorming/assets/brain-selector.html +0 -328
- package/src/core-skills/bmad-brainstorming/customize.toml +0 -83
- package/src/core-skills/bmad-brainstorming/references/converge.md +0 -24
- package/src/core-skills/bmad-brainstorming/references/finalize.md +0 -26
- package/src/core-skills/bmad-brainstorming/references/headless.md +0 -54
- package/src/core-skills/bmad-brainstorming/references/in-chat-techniques.md +0 -18
- package/src/core-skills/bmad-brainstorming/references/mode-autonomous.md +0 -10
- package/src/core-skills/bmad-brainstorming/references/mode-facilitator.md +0 -11
- package/src/core-skills/bmad-brainstorming/references/mode-partner.md +0 -16
- package/src/core-skills/bmad-brainstorming/references/resume.md +0 -5
- package/src/core-skills/bmad-brainstorming/scripts/brain.py +0 -789
- package/src/core-skills/bmad-brainstorming/scripts/tests/test_brain.py +0 -289
- package/src/core-skills/bmad-customize/SKILL.md +0 -111
- package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +0 -235
- package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +0 -249
- package/src/core-skills/bmad-deep-recon/SKILL.md +0 -82
- package/src/core-skills/bmad-deep-recon/assets/research.template.md +0 -18
- package/src/core-skills/bmad-deep-recon/customize.toml +0 -212
- package/src/core-skills/bmad-deep-recon/references/draft.md +0 -8
- package/src/core-skills/bmad-deep-recon/references/finalize.md +0 -11
- package/src/core-skills/bmad-deep-recon/references/html-briefing.md +0 -16
- package/src/core-skills/bmad-deep-recon/references/lifecycle.md +0 -11
- package/src/core-skills/bmad-deep-recon/references/process.md +0 -10
- package/src/core-skills/bmad-deep-recon/references/run.md +0 -73
- package/src/core-skills/bmad-deep-recon/references/selection.md +0 -13
- package/src/core-skills/bmad-deep-recon/references/synthesis.md +0 -16
- package/src/core-skills/bmad-deep-recon/references/verification.md +0 -29
- package/src/core-skills/bmad-deep-recon/scripts/recon_kit.py +0 -326
- package/src/core-skills/bmad-deep-recon/scripts/tests/test_recon_kit.py +0 -144
- package/src/core-skills/bmad-deep-recon/types/academic-lit.md +0 -19
- package/src/core-skills/bmad-deep-recon/types/competitive.md +0 -19
- package/src/core-skills/bmad-deep-recon/types/domain.md +0 -19
- package/src/core-skills/bmad-deep-recon/types/market.md +0 -19
- package/src/core-skills/bmad-deep-recon/types/technical.md +0 -19
- package/src/core-skills/bmad-deep-recon/types/user-voice.md +0 -19
- package/src/core-skills/bmad-forge-idea/SKILL.md +0 -107
- package/src/core-skills/bmad-forge-idea/customize.toml +0 -41
- package/src/core-skills/bmad-forge-idea/scripts/resolve_personas.py +0 -277
- package/src/core-skills/bmad-forge-idea/scripts/tests/test_resolve_personas.py +0 -160
- package/src/core-skills/bmad-help/SKILL.md +0 -77
- package/src/core-skills/bmad-party-mode/SKILL.md +0 -60
- package/src/core-skills/bmad-party-mode/customize.toml +0 -211
- package/src/core-skills/bmad-party-mode/references/create-party.md +0 -70
- package/src/core-skills/bmad-party-mode/references/mode-agent-team.md +0 -13
- package/src/core-skills/bmad-party-mode/references/mode-auto.md +0 -13
- package/src/core-skills/bmad-party-mode/references/mode-subagent.md +0 -31
- package/src/core-skills/bmad-party-mode/references/party-memory.md +0 -51
- package/src/core-skills/bmad-party-mode/scripts/resolve_party.py +0 -300
- package/src/core-skills/bmad-party-mode/scripts/tests/test_resolve_party.py +0 -183
- package/src/core-skills/bmad-review/SKILL.md +0 -50
- package/src/core-skills/bmad-review/customize.toml +0 -141
- package/src/core-skills/bmad-review/references/editorial-common.md +0 -56
- package/src/core-skills/bmad-review/references/lens-adversarial.md +0 -19
- package/src/core-skills/bmad-review/references/lens-edge-case-hunter.md +0 -72
- package/src/core-skills/bmad-review/references/lens-prose.md +0 -7
- package/src/core-skills/bmad-review/references/lens-structure.md +0 -9
- package/src/core-skills/bmad-review/references/lens-verification-gap.md +0 -92
- package/src/core-skills/bmad-review/references/structure-models.md +0 -44
- package/src/core-skills/bmad-review/scripts/tests/test_word_metrics.py +0 -62
- package/src/core-skills/bmad-review/scripts/word_metrics.py +0 -102
- package/src/core-skills/module-help.csv +0 -10
- package/src/core-skills/module.yaml +0 -38
- package/src/core-skills/v6-shims/README.md +0 -25
- package/src/core-skills/v6-shims/bmad-editorial-review/SKILL.md +0 -8
- package/src/core-skills/v6-shims/bmad-editorial-review/customize.toml +0 -31
- package/src/core-skills/v6-shims/bmad-editorial-review-prose/SKILL.md +0 -8
- package/src/core-skills/v6-shims/bmad-editorial-review-structure/SKILL.md +0 -8
- package/src/core-skills/v6-shims/bmad-review-adversarial-general/SKILL.md +0 -8
- package/src/core-skills/v6-shims/bmad-review-edge-case-hunter/SKILL.md +0 -8
- package/src/core-skills/v6-shims/bmad-review-verification-gap/SKILL.md +0 -8
- package/src/scripts/__pycache__/config_utils.cpython-311.pyc +0 -0
- package/src/scripts/config_utils.py +0 -119
- package/src/scripts/memlog.py +0 -228
- package/src/scripts/render_skill.py +0 -401
- package/src/scripts/resolve_config.py +0 -82
- package/src/scripts/resolve_customization.py +0 -164
- package/src/scripts/tests/__pycache__/test_config_utils.cpython-311.pyc +0 -0
- package/src/scripts/tests/__pycache__/test_resolve_config.cpython-311.pyc +0 -0
- package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-311.pyc +0 -0
- package/src/scripts/tests/test_config_utils.py +0 -85
- package/src/scripts/tests/test_memlog.py +0 -306
- package/src/scripts/tests/test_resolve_config.py +0 -117
- package/src/scripts/tests/test_resolve_customization.py +0 -179
- package/tools/bundle-web-bundles.js +0 -117
- package/tools/format-workflow-md.js +0 -263
- package/tools/installer/README.md +0 -60
- package/tools/installer/bmad-cli.js +0 -105
- package/tools/installer/cli-utils.js +0 -57
- package/tools/installer/commands/install.js +0 -151
- package/tools/installer/commands/status.js +0 -65
- package/tools/installer/commands/uninstall.js +0 -167
- package/tools/installer/core/config.js +0 -76
- package/tools/installer/core/existing-install.js +0 -121
- package/tools/installer/core/install-paths.js +0 -132
- package/tools/installer/core/installer.js +0 -1826
- package/tools/installer/core/legacy-warnings.js +0 -151
- package/tools/installer/core/manifest-generator.js +0 -883
- package/tools/installer/core/manifest.js +0 -439
- package/tools/installer/core/shim-policy.js +0 -159
- package/tools/installer/core/uv-check.js +0 -195
- package/tools/installer/core/wsl-node-check.js +0 -109
- package/tools/installer/file-ops.js +0 -204
- package/tools/installer/fs-native.js +0 -116
- package/tools/installer/ide/_config-driven.js +0 -972
- package/tools/installer/ide/manager.js +0 -324
- package/tools/installer/ide/platform-codes.js +0 -80
- package/tools/installer/ide/platform-codes.yaml +0 -363
- package/tools/installer/ide/shared/installed-skills.js +0 -50
- package/tools/installer/ide/shared/path-utils.js +0 -219
- package/tools/installer/ide/shared/skill-manifest.js +0 -57
- package/tools/installer/install-messages.yaml +0 -44
- package/tools/installer/list-options.js +0 -210
- package/tools/installer/message-loader.js +0 -83
- package/tools/installer/modules/channel-plan.js +0 -216
- package/tools/installer/modules/channel-resolver.js +0 -241
- package/tools/installer/modules/custom-module-manager.js +0 -924
- package/tools/installer/modules/external-manager.js +0 -673
- package/tools/installer/modules/git-env.js +0 -47
- package/tools/installer/modules/module-help-schema.js +0 -13
- package/tools/installer/modules/official-modules.js +0 -2289
- package/tools/installer/modules/plugin-resolver.js +0 -398
- package/tools/installer/modules/version-resolver.js +0 -336
- package/tools/installer/project-root.js +0 -224
- package/tools/installer/prompts.js +0 -804
- package/tools/installer/set-overrides.js +0 -330
- package/tools/installer/ui.js +0 -2225
- package/tools/installer/yaml-format.js +0 -245
- package/tools/javascript-conventions.md +0 -5
- package/tools/migrate-custom-module-paths.js +0 -124
- package/tools/skill-validator.md +0 -312
- package/tools/tests/__pycache__/test_validate_skills.cpython-311.pyc +0 -0
- package/tools/tests/fixtures/validate-skills/bmad/SKILL.md +0 -8
- package/tools/tests/fixtures/validate-skills/deprecated-shim/SKILL.md +0 -9
- package/tools/tests/fixtures/validate-skills/missing-trigger/SKILL.md +0 -9
- package/tools/tests/fixtures/validate-skills/with-trigger/SKILL.md +0 -8
- package/tools/tests/test_validate_skills.py +0 -476
- package/tools/validate-published-implementation-model.mjs +0 -59
- package/tools/validate-sidebar-order.js +0 -388
- package/tools/validate-svg-changes.sh +0 -356
- package/tools/validate_skills.py +0 -698
- package/web-bundles/README.md +0 -46
- package/web-bundles/brainstorming-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/brainstorming-coach/SKILL.md +0 -83
- package/web-bundles/brainstorming-coach/brain-methods.csv +0 -62
- package/web-bundles/bundles.json +0 -139
- package/web-bundles/market-and-industry-research/INSTRUCTIONS.md +0 -88
- package/web-bundles/market-and-industry-research/SKILL.md +0 -59
- package/web-bundles/prd-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/prd-coach/SKILL.md +0 -101
- package/web-bundles/prd-coach/prd-template.md +0 -165
- package/web-bundles/prd-coach/prd-validation-checklist.md +0 -135
- package/web-bundles/prfaq-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/prfaq-coach/SKILL.md +0 -139
- package/web-bundles/product-brief-coach/INSTRUCTIONS.md +0 -86
- package/web-bundles/product-brief-coach/SKILL.md +0 -113
- package/web-bundles/ux-coach/INSTRUCTIONS.md +0 -92
- package/web-bundles/ux-coach/SKILL.md +0 -187
- package/web-bundles/ux-coach/ux-validation.md +0 -100
package/src/messages.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { join } from 'node:path'
|
|
3
|
+
import { parse } from 'yaml'
|
|
4
|
+
import { packageRoot } from './version.js'
|
|
5
|
+
|
|
6
|
+
const PLACEHOLDER = /\{(\w+)\}/g
|
|
7
|
+
|
|
8
|
+
export class MessagesError extends Error {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} [filePath]
|
|
12
|
+
* @returns {Promise<Record<string, any>>}
|
|
13
|
+
*/
|
|
14
|
+
export async function loadMessages(filePath = join(packageRoot, 'messages.yaml')) {
|
|
15
|
+
let text
|
|
16
|
+
try {
|
|
17
|
+
text = await readFile(filePath, 'utf8')
|
|
18
|
+
} catch (err) {
|
|
19
|
+
throw new MessagesError(`cannot read ${filePath}: ${errorText(err)}`)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let data
|
|
23
|
+
try {
|
|
24
|
+
data = parse(text)
|
|
25
|
+
} catch (err) {
|
|
26
|
+
throw new MessagesError(`invalid YAML in ${filePath}: ${errorText(err)}`)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!isRecord(data)) throw new MessagesError(`${filePath} must hold a mapping of keys`)
|
|
30
|
+
return data
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} template
|
|
35
|
+
* @param {Record<string, string | number>} [values]
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export function render(template, values = {}) {
|
|
39
|
+
return template.replace(PLACEHOLDER, (match, key) => {
|
|
40
|
+
const value = values[key]
|
|
41
|
+
if (value === undefined || value === null) throw new MessagesError(`no value for ${match}`)
|
|
42
|
+
return String(value)
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {Record<string, any>} messages
|
|
48
|
+
* @param {string} key
|
|
49
|
+
* @param {Record<string, string | number>} [values]
|
|
50
|
+
* @returns {string}
|
|
51
|
+
*/
|
|
52
|
+
export function message(messages, key, values) {
|
|
53
|
+
const found = lookup(messages, key)
|
|
54
|
+
if (typeof found !== 'string') throw new MessagesError(`unknown message key: ${key}`)
|
|
55
|
+
return render(found, values)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {Record<string, any>} messages
|
|
60
|
+
* @param {string} key
|
|
61
|
+
* @returns {unknown}
|
|
62
|
+
*/
|
|
63
|
+
function lookup(messages, key) {
|
|
64
|
+
/** @type {unknown} */
|
|
65
|
+
let current = messages
|
|
66
|
+
for (const part of key.split('.')) {
|
|
67
|
+
if (!isRecord(current)) return undefined
|
|
68
|
+
current = current[part]
|
|
69
|
+
}
|
|
70
|
+
return current
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {unknown} value
|
|
75
|
+
* @returns {value is Record<string, any>}
|
|
76
|
+
*/
|
|
77
|
+
function isRecord(value) {
|
|
78
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @param {unknown} err */
|
|
82
|
+
function errorText(err) {
|
|
83
|
+
return err instanceof Error ? err.message : String(err)
|
|
84
|
+
}
|
package/src/modules.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { homedir } from 'node:os'
|
|
3
|
+
import { join, resolve } from 'node:path'
|
|
4
|
+
import { parse } from 'yaml'
|
|
5
|
+
import { packageRoot } from './version.js'
|
|
6
|
+
|
|
7
|
+
/** @typedef {{ code: string, name: string, description: string, source: string, record: string, aliases?: string[], always?: boolean, default?: boolean, deprecated?: string, requires?: string[], custom?: boolean, ref?: string }} ModuleDefinition */
|
|
8
|
+
|
|
9
|
+
const SOURCE_PATTERN = /^[\w.-]+\/[\w.-]+(\/[\w.-]+)*$/
|
|
10
|
+
const SOURCE_OVERRIDE = 'BMAD_INSTALLER_SOURCE_OVERRIDE'
|
|
11
|
+
|
|
12
|
+
export class ModulesError extends Error {
|
|
13
|
+
/** @param {string} message */
|
|
14
|
+
constructor(message) {
|
|
15
|
+
super(message)
|
|
16
|
+
this.name = 'ModulesError'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class UnknownModuleError extends ModulesError {
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} code
|
|
23
|
+
* @param {ModuleDefinition[]} modules
|
|
24
|
+
*/
|
|
25
|
+
constructor(code, modules) {
|
|
26
|
+
super(`unknown module "${code}"`)
|
|
27
|
+
this.name = 'UnknownModuleError'
|
|
28
|
+
this.code = code
|
|
29
|
+
this.known = modules.filter((module) => !module.always).map((module) => module.code).join(', ')
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {unknown} value
|
|
35
|
+
* @param {string} where
|
|
36
|
+
* @param {string} field
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
function requireText(value, where, field) {
|
|
40
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
41
|
+
throw new ModulesError(`${where}: ${field} must be a non-empty string`)
|
|
42
|
+
}
|
|
43
|
+
return value
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {any} entry
|
|
48
|
+
* @param {number} index
|
|
49
|
+
* @param {Set<string>} taken
|
|
50
|
+
* @returns {ModuleDefinition}
|
|
51
|
+
*/
|
|
52
|
+
function validateModule(entry, index, taken) {
|
|
53
|
+
const code = requireText(entry?.code, `modules[${index}]`, 'code')
|
|
54
|
+
const where = `module "${code}"`
|
|
55
|
+
const source = requireText(entry.source, where, 'source')
|
|
56
|
+
if (!SOURCE_PATTERN.test(source)) {
|
|
57
|
+
throw new ModulesError(`${where}: source must look like owner/repo or owner/repo/path/to/folder`)
|
|
58
|
+
}
|
|
59
|
+
/** @type {ModuleDefinition} */
|
|
60
|
+
const module = {
|
|
61
|
+
code,
|
|
62
|
+
name: requireText(entry.name, where, 'name'),
|
|
63
|
+
description: requireText(entry.description, where, 'description'),
|
|
64
|
+
source,
|
|
65
|
+
record: requireText(entry.record, where, 'record'),
|
|
66
|
+
}
|
|
67
|
+
for (const claimed of [code, ...(entry.aliases ?? [])]) {
|
|
68
|
+
const text = requireText(claimed, where, 'aliases')
|
|
69
|
+
if (taken.has(text)) throw new ModulesError(`${where}: "${text}" is already used by another module`)
|
|
70
|
+
taken.add(text)
|
|
71
|
+
}
|
|
72
|
+
if (entry.aliases) module.aliases = [...entry.aliases]
|
|
73
|
+
if (entry.always === true) module.always = true
|
|
74
|
+
if (entry.default === true) module.default = true
|
|
75
|
+
if (entry.deprecated !== undefined) module.deprecated = requireText(entry.deprecated, where, 'deprecated')
|
|
76
|
+
if (entry.requires !== undefined) {
|
|
77
|
+
if (!Array.isArray(entry.requires)) throw new ModulesError(`${where}: requires must be a list of module codes`)
|
|
78
|
+
module.requires = entry.requires.map((/** @type {unknown} */ code) => requireText(code, where, 'requires'))
|
|
79
|
+
}
|
|
80
|
+
return module
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @param {string} [filePath]
|
|
85
|
+
* @returns {Promise<ModuleDefinition[]>}
|
|
86
|
+
*/
|
|
87
|
+
export async function loadModules(filePath = join(packageRoot, 'modules.yaml')) {
|
|
88
|
+
const document = parse(await readFile(filePath, 'utf8'))
|
|
89
|
+
const entries = document?.modules
|
|
90
|
+
if (!Array.isArray(entries) || entries.length === 0) {
|
|
91
|
+
throw new ModulesError('modules must be a non-empty array')
|
|
92
|
+
}
|
|
93
|
+
/** @type {Set<string>} */
|
|
94
|
+
const taken = new Set()
|
|
95
|
+
const modules = entries.map((entry, index) => validateModule(entry, index, taken))
|
|
96
|
+
for (const module of modules) {
|
|
97
|
+
for (const code of module.requires ?? []) {
|
|
98
|
+
if (!modules.some((other) => other.code === code)) {
|
|
99
|
+
throw new ModulesError(`module "${module.code}": requires names "${code}", which is not a module code`)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const override = process.env[SOURCE_OVERRIDE]
|
|
104
|
+
if (!override) return modules
|
|
105
|
+
const repo = repoOf((modules.find((module) => module.always) ?? modules[0]).source)
|
|
106
|
+
return modules.map((module) => ({ ...module, source: overrideSource(module.source, override, repo) }))
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {string} source
|
|
111
|
+
* @returns {string}
|
|
112
|
+
*/
|
|
113
|
+
export function repoOf(source) {
|
|
114
|
+
return source.split('#')[0].split('/').slice(0, 2).join('/')
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Swaps the repository of a module from `repo` for `override` and keeps the module's folder, so a
|
|
119
|
+
* local checkout or a ref such as `owner/repo#dev` stands in for the published one. A `#ref` in
|
|
120
|
+
* the override goes after the folder, where the skills CLI reads it.
|
|
121
|
+
* @param {string} source
|
|
122
|
+
* @param {string} override
|
|
123
|
+
* @param {string} repo
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
126
|
+
export function overrideSource(source, override, repo) {
|
|
127
|
+
if (repoOf(source) !== repo) return source
|
|
128
|
+
const [base, ref] = override.split('#')
|
|
129
|
+
const folder = source.split('/').slice(2).join('/')
|
|
130
|
+
return `${base.replace(/\/+$/, '')}${folder ? `/${folder}` : ''}${ref ? `#${ref}` : ''}`
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @param {ModuleDefinition[]} modules
|
|
135
|
+
* @param {string} codeOrAlias
|
|
136
|
+
* @returns {ModuleDefinition | undefined}
|
|
137
|
+
*/
|
|
138
|
+
export function findModule(modules, codeOrAlias) {
|
|
139
|
+
return modules.find((module) => module.code === codeOrAlias || (module.aliases ?? []).includes(codeOrAlias))
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A module code never holds a slash; anything that does before its `#ref` is a source the skills
|
|
144
|
+
* CLI can install from: `owner/repo/folder#ref`, a git URL or a local path. A ref may hold one.
|
|
145
|
+
* @param {string} token
|
|
146
|
+
*/
|
|
147
|
+
export function isModuleSource(token) {
|
|
148
|
+
const base = token.split('#')[0]
|
|
149
|
+
return base.includes('/') || base.includes('\\') || base === '.' || base === '~'
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A local path is made absolute against the shell's folder, since the skills CLI runs in the project.
|
|
154
|
+
* @param {string} source
|
|
155
|
+
* @param {string} [cwd]
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
export function normalizeSource(source, cwd = process.cwd()) {
|
|
159
|
+
if (/^~([\\/]|$)/.test(source)) return join(homedir(), source.slice(1))
|
|
160
|
+
if (/^\.{1,2}([\\/]|$)/.test(source)) return resolve(cwd, source)
|
|
161
|
+
return source
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The source on a branch or tag. A ref already in the source is replaced.
|
|
166
|
+
* @param {string} source
|
|
167
|
+
* @param {string} ref
|
|
168
|
+
* @returns {string}
|
|
169
|
+
*/
|
|
170
|
+
export function sourceAtRef(source, ref) {
|
|
171
|
+
return `${source.split('#')[0]}#${ref}`
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Module codes and aliases from modules.yaml, each with an optional `#ref` for a branch or tag,
|
|
176
|
+
* and sources for modules not in it. An alias comes back as its code.
|
|
177
|
+
* @param {string} value
|
|
178
|
+
* @param {ModuleDefinition[]} modules
|
|
179
|
+
* @returns {string[]}
|
|
180
|
+
*/
|
|
181
|
+
export function parseModulesFlag(value, modules) {
|
|
182
|
+
/** @type {string[]} */
|
|
183
|
+
const codes = []
|
|
184
|
+
for (const token of value.split(',')) {
|
|
185
|
+
const picked = token.trim()
|
|
186
|
+
if (picked === '') continue
|
|
187
|
+
const code = isModuleSource(picked) ? normalizeSource(picked) : listedCode(picked, modules)
|
|
188
|
+
if (!code) throw new UnknownModuleError(picked, modules)
|
|
189
|
+
if (!codes.includes(code)) codes.push(code)
|
|
190
|
+
}
|
|
191
|
+
return codes
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @param {string} picked
|
|
196
|
+
* @param {ModuleDefinition[]} modules
|
|
197
|
+
* @returns {string | undefined}
|
|
198
|
+
*/
|
|
199
|
+
function listedCode(picked, modules) {
|
|
200
|
+
const [name, ref] = picked.split('#')
|
|
201
|
+
const module = findModule(modules, name)
|
|
202
|
+
if (!module) return undefined
|
|
203
|
+
return ref ? `${module.code}#${ref}` : module.code
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A module from outside modules.yaml, named by where it comes from.
|
|
208
|
+
* @param {string} source
|
|
209
|
+
* @returns {ModuleDefinition}
|
|
210
|
+
*/
|
|
211
|
+
export function customModule(source) {
|
|
212
|
+
return { code: source, name: source, description: '', source, record: '', custom: true }
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @param {ModuleDefinition[]} modules
|
|
217
|
+
* @returns {string[]}
|
|
218
|
+
*/
|
|
219
|
+
export function defaultCodes(modules) {
|
|
220
|
+
return modules.filter((module) => module.default === true).map((module) => module.code)
|
|
221
|
+
}
|
package/src/preflight.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { determineAgent } from '@vercel/detect-agent'
|
|
2
|
+
import { message } from './messages.js'
|
|
3
|
+
|
|
4
|
+
/** @typedef {import('./run.js').Runner} Runner */
|
|
5
|
+
|
|
6
|
+
const UV_TIMEOUT_MS = 5000
|
|
7
|
+
const NODE_MAJOR_FLOOR = 22
|
|
8
|
+
const SKILLS_CLI_MINOR_FLOOR = 20
|
|
9
|
+
const WSL_PATH_PATTERN = /^\\\\wsl(\.localhost|\$)?\\/
|
|
10
|
+
const WSL_EXEC_PATHS = ['\\wsl$\\', '\\wsl.localhost\\']
|
|
11
|
+
const UV_VERSION_PATTERN = /uv\s+(\d+\.\d+(?:\.\d+)?)/
|
|
12
|
+
|
|
13
|
+
export class PreflightError extends Error {
|
|
14
|
+
name = 'PreflightError'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} [version]
|
|
19
|
+
* @returns {'ok' | 'warn' | 'too-old'}
|
|
20
|
+
*/
|
|
21
|
+
export function nodeVersionState(version = process.versions.node) {
|
|
22
|
+
const [major, minor] = version.replace(/^v/, '').split('.').map((part) => Number.parseInt(part, 10))
|
|
23
|
+
if (!Number.isFinite(major) || major < NODE_MAJOR_FLOOR) return 'too-old'
|
|
24
|
+
if (major === NODE_MAJOR_FLOOR && (!Number.isFinite(minor) || minor < SKILLS_CLI_MINOR_FLOOR)) return 'warn'
|
|
25
|
+
return 'ok'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Said only when something failed: a Node below the skills CLI's floor usually still works.
|
|
30
|
+
* @param {Record<string, any>} messages
|
|
31
|
+
* @param {string} [version]
|
|
32
|
+
* @returns {string | null}
|
|
33
|
+
*/
|
|
34
|
+
export function nodeFailureHint(messages, version = process.versions.node) {
|
|
35
|
+
return nodeVersionState(version) === 'warn' ? message(messages, 'nodeBelowSkillsFloor', { version }) : null
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {{ platform: string, env: NodeJS.ProcessEnv, cwd: string, execPath: string }} [input]
|
|
40
|
+
* @returns {boolean}
|
|
41
|
+
*/
|
|
42
|
+
export function wslRunningWindowsNode(input) {
|
|
43
|
+
const { platform, env, cwd, execPath } = input ?? {
|
|
44
|
+
platform: process.platform,
|
|
45
|
+
env: process.env,
|
|
46
|
+
cwd: process.cwd(),
|
|
47
|
+
execPath: process.execPath,
|
|
48
|
+
}
|
|
49
|
+
if (platform !== 'win32') return false
|
|
50
|
+
if (env.WSL_DISTRO_NAME || env.WSL_INTEROP) return true
|
|
51
|
+
if (env.PWD?.startsWith('/')) return true
|
|
52
|
+
if (WSL_PATH_PATTERN.test(cwd)) return true
|
|
53
|
+
return WSL_EXEC_PATHS.some((fragment) => execPath.includes(fragment))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @param {Runner} runner
|
|
58
|
+
* @returns {Promise<string | null>}
|
|
59
|
+
*/
|
|
60
|
+
export async function uvVersion(runner) {
|
|
61
|
+
const result = await runner({ argv: ['uv', '--version'], timeoutMs: UV_TIMEOUT_MS })
|
|
62
|
+
if (result.code !== 0) return null
|
|
63
|
+
const match = UV_VERSION_PATTERN.exec(result.stdout)
|
|
64
|
+
return match ? match[1] : null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** @returns {Promise<string | null>} */
|
|
68
|
+
export async function insideAgent() {
|
|
69
|
+
const result = await determineAgent()
|
|
70
|
+
return result.isAgent ? result.agent.name : null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {NodeJS.ReadStream} [stdin]
|
|
75
|
+
* @param {NodeJS.WriteStream} [stdout]
|
|
76
|
+
* @returns {boolean}
|
|
77
|
+
*/
|
|
78
|
+
export function hasTerminal(stdin = process.stdin, stdout = process.stdout) {
|
|
79
|
+
return Boolean(stdin?.isTTY && stdout?.isTTY)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @param {Record<string, any>} messages
|
|
84
|
+
* @param {string} [platform]
|
|
85
|
+
* @returns {string}
|
|
86
|
+
*/
|
|
87
|
+
export function uvInstallCommand(messages, platform = process.platform) {
|
|
88
|
+
const commands = messages.uvInstall ?? {}
|
|
89
|
+
return String(commands[platform] ?? commands.linux ?? '')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* `terminal` and `agent` are injectable so the command tests can drive the interactive path.
|
|
94
|
+
* Missing `uv` does not stop the run; callers decide how to warn and degrade when `uv` is null.
|
|
95
|
+
* @param {{ interactive: boolean, runner: Runner, messages: Record<string, any>, platform?: string, terminal?: () => boolean, agent?: () => Promise<string | null> }} options
|
|
96
|
+
* @returns {Promise<{ uv: string | null }>}
|
|
97
|
+
*/
|
|
98
|
+
export async function runPreflight(options) {
|
|
99
|
+
const {
|
|
100
|
+
interactive,
|
|
101
|
+
runner,
|
|
102
|
+
messages,
|
|
103
|
+
platform = process.platform,
|
|
104
|
+
terminal = hasTerminal,
|
|
105
|
+
agent: readAgent = insideAgent,
|
|
106
|
+
} = options
|
|
107
|
+
const version = process.versions.node
|
|
108
|
+
const state = nodeVersionState(version)
|
|
109
|
+
if (state === 'too-old') throw new PreflightError(message(messages, 'nodeTooOld', { version }))
|
|
110
|
+
|
|
111
|
+
const wsl = wslRunningWindowsNode({ platform, env: process.env, cwd: process.cwd(), execPath: process.execPath })
|
|
112
|
+
if (wsl) throw new PreflightError(message(messages, 'wslWindowsNode'))
|
|
113
|
+
|
|
114
|
+
const uv = await uvVersion(runner)
|
|
115
|
+
|
|
116
|
+
if (!interactive) return { uv }
|
|
117
|
+
|
|
118
|
+
if (!terminal()) throw new PreflightError(message(messages, 'needsTerminal'))
|
|
119
|
+
|
|
120
|
+
const agent = await readAgent()
|
|
121
|
+
if (agent) throw new PreflightError(message(messages, 'insideAgent', { agent }))
|
|
122
|
+
|
|
123
|
+
return { uv }
|
|
124
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
import { isAbsolute, join, posix, resolve } from 'node:path'
|
|
3
|
+
import { repoOf } from './modules.js'
|
|
4
|
+
|
|
5
|
+
/** @typedef {{ source?: string, sourceUrl?: string, sourceType?: string, ref?: string, skillPath?: string }} LockEntry */
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The skills CLI's project lock, `skills-lock.json`: where each skill was installed from.
|
|
9
|
+
* @param {string} directory
|
|
10
|
+
* @returns {Promise<Record<string, LockEntry>>}
|
|
11
|
+
*/
|
|
12
|
+
export async function readProjectLock(directory) {
|
|
13
|
+
try {
|
|
14
|
+
const lock = JSON.parse(await readFile(join(directory, 'skills-lock.json'), 'utf8'))
|
|
15
|
+
return lock?.skills && typeof lock.skills === 'object' ? lock.skills : {}
|
|
16
|
+
} catch {
|
|
17
|
+
return {}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The folder holding a module, from the lock entry of its record: the parent of the record's own
|
|
23
|
+
* folder, on the source and ref it came from. Mirrors the skills CLI's own update source, one
|
|
24
|
+
* folder up. Null when the entry cannot be installed again (a bare shorthand for a generic git host).
|
|
25
|
+
* @param {LockEntry | undefined} entry
|
|
26
|
+
* @param {string} directory
|
|
27
|
+
* @returns {string | null}
|
|
28
|
+
*/
|
|
29
|
+
export function moduleSourceFromLock(entry, directory) {
|
|
30
|
+
if (!entry || entry.sourceType === 'well-known' || entry.sourceType === 'node_modules') return null
|
|
31
|
+
const github = !entry.sourceType || entry.sourceType === 'github'
|
|
32
|
+
let source = github ? entry.source : entry.sourceUrl || entry.source
|
|
33
|
+
if (!source) return null
|
|
34
|
+
const bareShorthand = !source.includes(':') && !/^[./]/.test(source)
|
|
35
|
+
if ((entry.sourceType === 'git' || entry.sourceType === 'gitlab') && bareShorthand) return null
|
|
36
|
+
const skillFolder = (entry.skillPath ?? '').replace(/\/?SKILL\.md$/, '')
|
|
37
|
+
const folder = skillFolder ? posix.dirname(skillFolder) : '.'
|
|
38
|
+
if (entry.sourceType === 'local') return join(isAbsolute(source) ? source : resolve(directory, source), ...folder.split('/'))
|
|
39
|
+
const withFolder = github && folder !== '.' ? `${source.replace(/\/+$/, '')}/${folder}` : source
|
|
40
|
+
return entry.ref ? `${withFolder}#${entry.ref}` : withFolder
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The branch or tag a module in modules.yaml was installed from, when the lock entry of its
|
|
45
|
+
* record names one and comes from the module's own repository. Only the ref is taken: the folder
|
|
46
|
+
* stays the one modules.yaml gives, which survives a module moving inside its repository.
|
|
47
|
+
* @param {LockEntry | undefined} entry
|
|
48
|
+
* @param {string} source
|
|
49
|
+
* @returns {string | undefined}
|
|
50
|
+
*/
|
|
51
|
+
export function lockedRef(entry, source) {
|
|
52
|
+
if (!entry?.ref || source.includes('#')) return undefined
|
|
53
|
+
return lockedGitHubRepo(entry) === repoOf(source).toLowerCase() ? entry.ref : undefined
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The `owner/repo` on github.com a lock entry came from, in lower case: from a shorthand, or from
|
|
58
|
+
* an https or SSH git URL. Undefined for any other host or source type.
|
|
59
|
+
* @param {LockEntry} entry
|
|
60
|
+
* @returns {string | undefined}
|
|
61
|
+
*/
|
|
62
|
+
function lockedGitHubRepo(entry) {
|
|
63
|
+
if (!entry.sourceType || entry.sourceType === 'github') return entry.source?.toLowerCase()
|
|
64
|
+
if (entry.sourceType !== 'git') return undefined
|
|
65
|
+
const url = entry.sourceUrl || entry.source || ''
|
|
66
|
+
const match = /^(?:https:\/\/github\.com\/|git@github\.com:|ssh:\/\/git@github\.com\/)([\w.-]+\/[\w.-]+?)(?:\.git)?\/?$/i.exec(url)
|
|
67
|
+
return match?.[1].toLowerCase()
|
|
68
|
+
}
|