bmad-plus 0.12.1 → 0.13.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/CHANGELOG.md +637 -580
- package/README.md +123 -120
- package/osint-agent-package/agents/osint-investigator.md +12 -0
- package/osint-agent-package/skills/bmad-osint-investigate/osint/SKILL.md +491 -482
- package/osint-agent-package/skills/bmad-osint-investigate/osint/assets/dossier-template.md +126 -126
- package/osint-agent-package/skills/bmad-osint-investigate/osint/assets/lawful-basis-record.md +48 -48
- package/osint-agent-package/skills/bmad-osint-investigate/osint/references/content-extraction.md +100 -100
- package/osint-agent-package/skills/bmad-osint-investigate/osint/references/gdpr-osint.md +48 -48
- package/osint-agent-package/skills/bmad-osint-investigate/osint/references/platforms.md +130 -130
- package/osint-agent-package/skills/bmad-osint-investigate/osint/references/psychoprofile.md +69 -69
- package/osint-agent-package/skills/bmad-osint-investigate/osint/references/tools.md +281 -281
- package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/mcp-client.py +136 -136
- package/package.json +106 -91
- package/readme-international/README.de.md +625 -594
- package/readme-international/README.es.md +642 -611
- package/readme-international/README.fr.md +640 -609
- package/src/bmad-plus/agents/agent-orchestrator/SKILL.md +2 -0
- package/src/bmad-plus/agents/agent-shadow/SKILL.md +18 -0
- package/src/bmad-plus/data/role-triggers.yaml +52 -0
- package/src/bmad-plus/module.yaml +333 -283
- package/src/bmad-plus/packs/pack-animated/animated-website-agent.md +325 -325
- package/src/bmad-plus/packs/pack-animated/templates/animated-website-workflow.md +55 -55
- package/src/bmad-plus/packs/pack-backup/backup-agent.md +71 -71
- package/src/bmad-plus/packs/pack-backup/templates/backup-workflow.md +51 -51
- package/src/bmad-plus/packs/pack-dev-studio/README.md +162 -162
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/analyst-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/document-project.md +61 -61
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/domain-research.md +95 -95
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/market-research.md +95 -95
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/prfaq.md +134 -134
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/product-brief.md +80 -80
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/tech-writer-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/analysis/technical-research.md +95 -95
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/architect-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-architecture.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/create-epics-stories.md +92 -92
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/generate-project-context.md +80 -80
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/implementation-readiness.md +90 -90
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01-init.md +153 -153
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-01b-continue.md +173 -173
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-02-context.md +224 -224
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-03-starter.md +329 -329
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-04-decisions.md +318 -318
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-05-patterns.md +359 -359
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-06-structure.md +379 -379
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-07-validation.md +361 -361
- package/src/bmad-plus/packs/pack-dev-studio/categories/architecture/steps/step-08-complete.md +81 -81
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/checkpoint-preview.md +67 -67
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-01-gather-context.md +85 -85
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-02-review.md +35 -35
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-03-triage.md +49 -49
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review-steps/step-04-present.md +131 -131
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/code-review.md +89 -89
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/correct-course.md +300 -300
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/create-story.md +428 -428
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story-checklist.md +80 -80
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/dev-story.md +484 -484
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/investigate.md +193 -193
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/qa-e2e-tests.md +175 -175
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/quick-dev.md +110 -110
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/retrospective.md +1511 -1511
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-planning.md +298 -298
- package/src/bmad-plus/packs/pack-dev-studio/categories/implementation/sprint-status.md +296 -296
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-prd.md +29 -29
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/create-ux-design.md +74 -74
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/edit-prd.md +29 -29
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/pm-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/prd.md +89 -89
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/ux-designer-agent.md +73 -73
- package/src/bmad-plus/packs/pack-dev-studio/categories/planning/validate-prd.md +29 -29
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/advanced-elicitation.md +141 -141
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/adversarial-review.md +37 -37
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/bmad-help.md +75 -75
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/brainstorming.md +6 -6
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/customize.md +110 -110
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/distillator.md +176 -176
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/edge-case-hunter.md +67 -67
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-prose.md +86 -86
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/editorial-review-structure.md +179 -179
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/index-docs.md +66 -66
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/party-mode.md +127 -127
- package/src/bmad-plus/packs/pack-dev-studio/categories/utilities/shard-doc.md +105 -105
- package/src/bmad-plus/packs/pack-dev-studio/dev-studio-orchestrator.md +120 -120
- package/src/bmad-plus/packs/pack-dev-studio/shared/architecture-decision-template.md +12 -12
- package/src/bmad-plus/packs/pack-dev-studio/shared/bwml-spec.md +328 -328
- package/src/bmad-plus/packs/pack-dev-studio/shared/module-help.csv +32 -32
- package/src/bmad-plus/packs/pack-dev-studio/upstream-sync.yaml +81 -81
- package/src/bmad-plus/packs/pack-seo/SKILL.md +171 -171
- package/src/bmad-plus/packs/pack-seo/checklist.md +140 -140
- package/src/bmad-plus/packs/pack-seo/pagespeed-playbook.md +320 -320
- package/src/bmad-plus/packs/pack-seo/ref/audit-schema.json +187 -187
- package/src/bmad-plus/packs/pack-seo/ref/cwv-thresholds.md +87 -87
- package/src/bmad-plus/packs/pack-seo/ref/eeat-criteria.md +123 -123
- package/src/bmad-plus/packs/pack-seo/ref/geo-signals.md +167 -167
- package/src/bmad-plus/packs/pack-seo/ref/hreflang-rules.md +153 -153
- package/src/bmad-plus/packs/pack-seo/ref/quality-gates.md +133 -133
- package/src/bmad-plus/packs/pack-seo/ref/schema-catalog.md +91 -91
- package/src/bmad-plus/packs/pack-seo/ref/schema-templates.json +356 -356
- package/src/bmad-plus/packs/pack-seo/requirements.txt +17 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_apis.py +456 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_crawl.py +359 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_fetch.py +303 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_parse.py +255 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_report.py +409 -0
- package/src/bmad-plus/packs/pack-seo/scripts/seo_screenshot.py +202 -0
- package/src/bmad-plus/packs/pack-seo/seo-chief.md +294 -294
- package/src/bmad-plus/packs/pack-seo/seo-judge.md +241 -241
- package/src/bmad-plus/packs/pack-seo/seo-scout.md +171 -171
- package/src/bmad-plus/packs/pack-seo/templates/seo-audit-workflow.md +241 -241
- package/src/bmad-plus/packs/pack-shield/README.md +6 -6
- package/src/bmad-plus/packs/pack-shield/SKILL.md +2 -2
- package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/csrd-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/section508-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/wcag-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/ai-governance/eu-ai-act-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/ai-governance/iso42001-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/ai-governance/nist-ai-rmf-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/cis-controls-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/ism-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/iso27001-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nis2-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nist-800-53-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nist-csf-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/defense-export/cmmc-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/defense-export/ear-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/defense-export/itar-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/defense-export/tsa-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/dora-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/fedramp-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/hipaa-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/pci-dss-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/soc2-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/swift-csp-agent.md +11 -11
- package/src/bmad-plus/packs/pack-shield/shield-orchestrator.md +1 -1
- package/src/bmad-plus/skills/bmad-plus-autopilot/SKILL.md +1 -1
- package/tools/bmad-plus-npx.js +4 -2
- package/tools/build/adapters.config.js +60 -51
- package/tools/build/check-counts.js +626 -0
- package/tools/build/check-install-contract.js +298 -0
- package/tools/build/generate-adapters.js +252 -56
- package/tools/build/generate.js +187 -10
- package/tools/build/generated-adapters/.codex/AGENTS.md +20 -7
- package/tools/build/generated-adapters/.cursor/rules/bmad-plus.mdc +20 -7
- package/tools/build/generated-adapters/.opencode/AGENTS.md +20 -7
- package/tools/build/generated-adapters/AGENTS.md +20 -7
- package/tools/build/generated-adapters/CLAUDE.md +20 -7
- package/tools/build/generated-adapters/CONVENTIONS.md +20 -7
- package/tools/build/generated-adapters/GEMINI.md +20 -7
- package/tools/build/module.template.yaml +82 -0
- package/tools/cli/bmad-plus-cli.js +16 -1
- package/tools/cli/commands/autoconfig.js +470 -470
- package/tools/cli/commands/doctor.js +205 -233
- package/tools/cli/commands/install.js +543 -501
- package/tools/cli/commands/memory-journal-cmd.js +311 -311
- package/tools/cli/commands/memory.js +195 -195
- package/tools/cli/commands/scan.js +348 -348
- package/tools/cli/commands/uninstall.js +209 -101
- package/tools/cli/commands/update-check.js +31 -0
- package/tools/cli/commands/update-policy.js +39 -0
- package/tools/cli/commands/update.js +123 -134
- package/tools/cli/i18n.js +905 -845
- package/tools/cli/lib/README-memory-journal.md +125 -125
- package/tools/cli/lib/ide-config.js +10 -259
- package/tools/cli/lib/install-manifest.js +17 -0
- package/tools/cli/lib/installed-adapters.js +89 -0
- package/tools/cli/lib/npm-runner.js +177 -0
- package/tools/cli/lib/pack-copy.js +62 -66
- package/tools/cli/lib/packs.js +437 -3
- package/tools/cli/lib/python-provision.js +508 -508
- package/tools/cli/lib/stack-detect.js +102 -102
- package/tools/cli/lib/update-check.js +153 -0
- package/tools/cli/lib/update-dispatch.js +182 -0
- package/tools/cli/lib/update-policy.js +90 -0
- package/tools/cli/lib/update-transaction.js +334 -0
- package/tools/cli/lib/validate.js +50 -50
|
@@ -1,501 +1,543 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BMAD+ Install Command
|
|
3
|
-
* Installs agents, skills, and IDE configs into the current project
|
|
4
|
-
* Supports 10 languages: EN, FR, ES, DE, PT-BR, RU, ZH, HE, JA, IT
|
|
5
|
-
*
|
|
6
|
-
* Author: Laurent Rochetta
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const path = require('node:path');
|
|
10
|
-
const fs = require('node:fs');
|
|
11
|
-
const fsExtra = require('fs-extra');
|
|
12
|
-
const clack = require('@clack/prompts');
|
|
13
|
-
const pc = require('picocolors');
|
|
14
|
-
const { t, getLanguageOptions, getCommLanguageOptions } = require('../i18n');
|
|
15
|
-
const { PACKS } = require('../lib/packs');
|
|
16
|
-
const { copyPackFiles } = require('../lib/pack-copy');
|
|
17
|
-
const {
|
|
18
|
-
const {
|
|
19
|
-
const {
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const projectDir = path.resolve(options.directory || process.cwd());
|
|
51
|
-
const bmadSrc = path.join(__dirname, '..', '..', '..', 'src', 'bmad-plus');
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
clack.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
clack.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// ──
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
copiedFiles
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
fs.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
i.
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
i.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
`
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
)
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
if (selectedPacks.includes('
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (selectedPacks.includes('
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
)
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
i.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
1
|
+
/**
|
|
2
|
+
* BMAD+ Install Command
|
|
3
|
+
* Installs agents, skills, and IDE configs into the current project
|
|
4
|
+
* Supports 10 languages: EN, FR, ES, DE, PT-BR, RU, ZH, HE, JA, IT
|
|
5
|
+
*
|
|
6
|
+
* Author: Laurent Rochetta
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const path = require('node:path');
|
|
10
|
+
const fs = require('node:fs');
|
|
11
|
+
const fsExtra = require('fs-extra');
|
|
12
|
+
const clack = require('@clack/prompts');
|
|
13
|
+
const pc = require('picocolors');
|
|
14
|
+
const { t, getLanguageOptions, getCommLanguageOptions } = require('../i18n');
|
|
15
|
+
const { PACKS, DERIVED } = require('../lib/packs');
|
|
16
|
+
const { copyPackFiles, copyManagedFile } = require('../lib/pack-copy');
|
|
17
|
+
const { acquireProjectLock, inventoryOf, collectManagedFiles } = require('../lib/update-transaction');
|
|
18
|
+
const { initMemory } = require('../lib/memory-init');
|
|
19
|
+
const { generateUserFiles, IDE_CONFIGS } = require('../../build/generate-adapters');
|
|
20
|
+
const { writeIDEConfigs, safeAdapterPath } = require('../lib/installed-adapters');
|
|
21
|
+
const { readInstallManifest } = require('../lib/install-manifest');
|
|
22
|
+
const yaml = require('js-yaml');
|
|
23
|
+
const { validateUserName } = require('../lib/validate');
|
|
24
|
+
const { provisionPack } = require('../lib/python-provision');
|
|
25
|
+
|
|
26
|
+
const PYTHON_PACKS = DERIVED.pythonPacks;
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
command: 'install',
|
|
30
|
+
description: 'Install BMAD+ agents and skills into your project',
|
|
31
|
+
options: [
|
|
32
|
+
['-d, --directory <path>', 'Installation directory (default: current directory)'],
|
|
33
|
+
['-p, --packs <packs>', 'Comma-separated pack IDs: core,osint,all (default: interactive)'],
|
|
34
|
+
['-y, --yes', 'Accept all defaults, skip prompts'],
|
|
35
|
+
['-l, --lang <code>', 'Language code: en, fr, es, de, pt-br, ru, zh, he, ja, it (overrides auto-detection)'],
|
|
36
|
+
['--tools <tools>', 'Comma-separated IDE IDs, all, or none (default: auto-detect)'],
|
|
37
|
+
['--mode <mode>', 'Execution mode: manual, autopilot, hybrid (default: manual)'],
|
|
38
|
+
['--provision-python', 'Provision an isolated Python env for packs that need one (seo, memory)'],
|
|
39
|
+
],
|
|
40
|
+
action: async (options) => {
|
|
41
|
+
// A closed/piped stdin cannot answer prompts. Require explicit defaults
|
|
42
|
+
// before creating files, instead of silently exiting halfway through UI.
|
|
43
|
+
if (!options.yes && !process.stdin.isTTY) {
|
|
44
|
+
const i = t(options.lang || 'en');
|
|
45
|
+
clack.log.error(i.noninteractive_requires_yes('install'));
|
|
46
|
+
process.exitCode = 1;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const projectDir = path.resolve(options.directory || process.cwd());
|
|
51
|
+
const bmadSrc = path.join(__dirname, '..', '..', '..', 'src', 'bmad-plus');
|
|
52
|
+
const previousManifestPath = safeAdapterPath(projectDir, '_bmad/.bmad-plus-install.json');
|
|
53
|
+
const previousManifestBytes = fs.existsSync(previousManifestPath) ? fs.readFileSync(previousManifestPath) : null;
|
|
54
|
+
let previousManifest = null;
|
|
55
|
+
let manifestError;
|
|
56
|
+
if (fs.existsSync(previousManifestPath)) {
|
|
57
|
+
try {
|
|
58
|
+
previousManifest = readInstallManifest(previousManifestPath);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
manifestError = error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (options.mode && !['manual', 'autopilot', 'hybrid'].includes(options.mode)) throw new Error('Unknown execution mode: ' + options.mode);
|
|
64
|
+
|
|
65
|
+
// ── Step 0: Language Selection ──
|
|
66
|
+
const pkgJson = require('../../../package.json');
|
|
67
|
+
clack.intro(pc.bgCyan(pc.black(` BMAD+ Installer v${pkgJson.version} `)));
|
|
68
|
+
clack.log.info(pc.dim('✨ Created by Laurent Rochetta — github.com/lrochetta/BMAD-PLUS'));
|
|
69
|
+
|
|
70
|
+
let lang = options.lang || 'en';
|
|
71
|
+
if (!options.yes && !options.lang) {
|
|
72
|
+
const langChoice = await clack.select({
|
|
73
|
+
message: '🌐 Select your language / Choisissez votre langue / 选择语言',
|
|
74
|
+
options: getLanguageOptions(),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (clack.isCancel(langChoice)) {
|
|
78
|
+
clack.cancel('Installation cancelled.');
|
|
79
|
+
throw new Error('Installation cancelled.');
|
|
80
|
+
}
|
|
81
|
+
lang = langChoice;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const i = t(lang); // Get translations for selected language
|
|
85
|
+
|
|
86
|
+
// Verify source exists
|
|
87
|
+
if (!fs.existsSync(bmadSrc)) {
|
|
88
|
+
clack.log.error(`${i.source_not_found}: ${bmadSrc}`);
|
|
89
|
+
clack.outro(pc.red(i.failed));
|
|
90
|
+
throw new Error(`Source not found: ${bmadSrc}`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
clack.log.info(`${i.installing_to}: ${pc.cyan(projectDir)}`);
|
|
94
|
+
|
|
95
|
+
// ── Step 1: Pack Selection ──
|
|
96
|
+
let selectedPacks = ['core']; // Core always included
|
|
97
|
+
|
|
98
|
+
if (options.packs) {
|
|
99
|
+
const requested = options.packs.split(',').map(p => p.trim());
|
|
100
|
+
if (requested.includes('all')) {
|
|
101
|
+
selectedPacks = Object.keys(PACKS).filter(k => !PACKS[k].disabled);
|
|
102
|
+
} else {
|
|
103
|
+
selectedPacks = [...new Set(['core', ...requested.filter(p => PACKS[p] && !PACKS[p].disabled)])];
|
|
104
|
+
}
|
|
105
|
+
} else if (!options.yes) {
|
|
106
|
+
const packChoice = await clack.multiselect({
|
|
107
|
+
message: i.select_packs,
|
|
108
|
+
options: Object.entries(PACKS)
|
|
109
|
+
.filter(([, p]) => !p.required)
|
|
110
|
+
.map(([key, pack]) => ({
|
|
111
|
+
value: key,
|
|
112
|
+
label: `${pack.icon} ${pack.name}`,
|
|
113
|
+
hint: pack.disabled ? i.soon : (pack.desc || pack.description || ''),
|
|
114
|
+
disabled: pack.disabled,
|
|
115
|
+
})),
|
|
116
|
+
required: false,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
if (clack.isCancel(packChoice)) {
|
|
120
|
+
clack.cancel(i.cancelled);
|
|
121
|
+
throw new Error(i.cancelled);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
selectedPacks = [...new Set(['core', ...packChoice])];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
clack.log.success(`${i.selected_packs}: ${selectedPacks.map(p => `${PACKS[p].icon} ${PACKS[p].name}`).join(', ')}`);
|
|
128
|
+
|
|
129
|
+
// ── Step 2: IDE Detection ──
|
|
130
|
+
let detectedIDEs = [];
|
|
131
|
+
|
|
132
|
+
if (options.tools) {
|
|
133
|
+
if (options.tools === 'none' || options.tools === 'skip') {
|
|
134
|
+
detectedIDEs = [];
|
|
135
|
+
} else if (options.tools === 'all') {
|
|
136
|
+
detectedIDEs = Object.keys(IDE_CONFIGS);
|
|
137
|
+
} else {
|
|
138
|
+
detectedIDEs = options.tools.split(',').map(t => t.trim()).filter(t => IDE_CONFIGS[t]);
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
// Auto-detect
|
|
142
|
+
for (const [id, ide] of Object.entries(IDE_CONFIGS)) {
|
|
143
|
+
for (const marker of ide.detect) {
|
|
144
|
+
if (fs.existsSync(path.join(projectDir, marker))) {
|
|
145
|
+
detectedIDEs.push(id);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// If nothing detected, ask
|
|
152
|
+
if (detectedIDEs.length === 0 && !options.yes) {
|
|
153
|
+
const ideChoice = await clack.multiselect({
|
|
154
|
+
message: i.select_ide,
|
|
155
|
+
options: Object.entries(IDE_CONFIGS).map(([key, ide]) => ({
|
|
156
|
+
value: key,
|
|
157
|
+
label: ide.name,
|
|
158
|
+
})),
|
|
159
|
+
required: false,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (!clack.isCancel(ideChoice)) {
|
|
163
|
+
detectedIDEs = ideChoice;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Default to all if --yes
|
|
168
|
+
if (detectedIDEs.length === 0 && options.yes) {
|
|
169
|
+
detectedIDEs = Object.keys(IDE_CONFIGS);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (detectedIDEs.length > 0) {
|
|
174
|
+
clack.log.info(`${i.detected_ides}: ${detectedIDEs.map(id => IDE_CONFIGS[id].name).join(', ')}`);
|
|
175
|
+
} else if (options.tools === 'none' || options.tools === 'skip') {
|
|
176
|
+
clack.log.info(pc.dim('⏭️ IDE config skipped (--tools none) — existing configs preserved'));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ── Step 3: User Config ──
|
|
180
|
+
let userName = process.env.USER || process.env.USERNAME || 'Developer';
|
|
181
|
+
let commLang = 'French';
|
|
182
|
+
let execMode = options.mode || 'manual';
|
|
183
|
+
|
|
184
|
+
if (!options.yes) {
|
|
185
|
+
const userConfig = await clack.group({
|
|
186
|
+
userName: () => clack.text({
|
|
187
|
+
message: i.enter_name,
|
|
188
|
+
placeholder: userName,
|
|
189
|
+
defaultValue: userName,
|
|
190
|
+
}),
|
|
191
|
+
commLang: () => clack.select({
|
|
192
|
+
message: i.comm_language,
|
|
193
|
+
options: getCommLanguageOptions(),
|
|
194
|
+
}),
|
|
195
|
+
execMode: () => clack.select({
|
|
196
|
+
message: i.exec_mode,
|
|
197
|
+
options: [
|
|
198
|
+
{ value: 'manual', label: i.exec_manual },
|
|
199
|
+
{ value: 'autopilot', label: i.exec_autopilot },
|
|
200
|
+
{ value: 'hybrid', label: i.exec_hybrid },
|
|
201
|
+
],
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
if (clack.isCancel(userConfig)) {
|
|
206
|
+
clack.cancel(i.cancelled);
|
|
207
|
+
throw new Error(i.cancelled);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Validate user-provided name
|
|
211
|
+
const rawName = userConfig.userName;
|
|
212
|
+
const fb = process.env.USER || process.env.USERNAME || 'Developer';
|
|
213
|
+
const { name: validatedName, warnings } = validateUserName(rawName, fb);
|
|
214
|
+
for (const w of warnings) clack.log.warn(w);
|
|
215
|
+
userName = validatedName;
|
|
216
|
+
commLang = userConfig.commLang;
|
|
217
|
+
execMode = options.mode || userConfig.execMode;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const releaseLock = acquireProjectLock(projectDir);
|
|
221
|
+
try {
|
|
222
|
+
const { safeTarget } = require('../../build/generate-adapters');
|
|
223
|
+
const plannedFiles = collectManagedFiles({ projectDir, packs: selectedPacks });
|
|
224
|
+
if (detectedIDEs.length) plannedFiles.push(...generateUserFiles(DERIVED, {
|
|
225
|
+
packs: selectedPacks, tools: detectedIDEs, userName, language: commLang,
|
|
226
|
+
}));
|
|
227
|
+
for (const { file } of plannedFiles) safeTarget(projectDir, file);
|
|
228
|
+
safeTarget(projectDir, '_bmad/config.yaml');
|
|
229
|
+
safeTarget(projectDir, '_bmad/.bmad-plus-install.json');
|
|
230
|
+
for (const directory of ['.agents/skills', '.agents/data', '_bmad', '_bmad-output/discovery', '_bmad-output/build', 'docs']) {
|
|
231
|
+
safeTarget(projectDir, directory + '/.bmad-preflight');
|
|
232
|
+
}
|
|
233
|
+
const currentManifestBytes = fs.existsSync(previousManifestPath) ? fs.readFileSync(previousManifestPath) : null;
|
|
234
|
+
if (previousManifestBytes === null ? currentManifestBytes !== null :
|
|
235
|
+
currentManifestBytes === null || !previousManifestBytes.equals(currentManifestBytes)) {
|
|
236
|
+
throw new Error('Installation changed while preparing install. Please retry.');
|
|
237
|
+
}
|
|
238
|
+
// Preserve the unreadable manifest before repair; do not trust its ownership
|
|
239
|
+
// hashes. The adapter writer will retain locally edited user instructions.
|
|
240
|
+
if (manifestError) {
|
|
241
|
+
const backupBase = '_bmad/.bmad-plus-install.json.corrupt.bak';
|
|
242
|
+
let backupFile = backupBase;
|
|
243
|
+
let index = 1;
|
|
244
|
+
while (fs.existsSync(safeAdapterPath(projectDir, backupFile))) backupFile = `${backupBase}.${index++}`;
|
|
245
|
+
const backupPath = safeAdapterPath(projectDir, backupFile);
|
|
246
|
+
fs.copyFileSync(safeAdapterPath(projectDir, '_bmad/.bmad-plus-install.json'), backupPath, fs.constants.COPYFILE_EXCL);
|
|
247
|
+
clack.log.warn(`${i.manifest_invalid(manifestError.message)}\nBackup: ${backupPath}`);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ── Step 4: Install Files ──
|
|
251
|
+
const spinner = clack.spinner();
|
|
252
|
+
spinner.start(i.installing_files);
|
|
253
|
+
|
|
254
|
+
const targetAgentsDir = path.join(projectDir, '.agents', 'skills');
|
|
255
|
+
const targetDataDir = path.join(projectDir, '.agents', 'data');
|
|
256
|
+
const targetBmadDir = path.join(projectDir, '_bmad');
|
|
257
|
+
|
|
258
|
+
// Create directories
|
|
259
|
+
fsExtra.ensureDirSync(targetAgentsDir);
|
|
260
|
+
fsExtra.ensureDirSync(targetDataDir);
|
|
261
|
+
fsExtra.ensureDirSync(targetBmadDir);
|
|
262
|
+
|
|
263
|
+
let copiedAgents = 0;
|
|
264
|
+
let copiedSkills = 0;
|
|
265
|
+
let copiedFiles = 0;
|
|
266
|
+
const previousInventory = inventoryOf(previousManifest || {}) || {};
|
|
267
|
+
const fileInventory = { ...previousInventory };
|
|
268
|
+
let inventoryComplete = true;
|
|
269
|
+
const onFileConflict = file => {
|
|
270
|
+
if (!previousInventory[file]) inventoryComplete = false;
|
|
271
|
+
clack.log.warn(`${file}: locally changed or unowned content preserved.`);
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const projectRoot = path.join(bmadSrc, '..', '..');
|
|
275
|
+
|
|
276
|
+
for (const packId of selectedPacks) {
|
|
277
|
+
const pack = PACKS[packId];
|
|
278
|
+
if (!pack || pack.disabled) continue;
|
|
279
|
+
|
|
280
|
+
const result = copyPackFiles({
|
|
281
|
+
bmadSrc,
|
|
282
|
+
targetAgentsDir,
|
|
283
|
+
targetDataDir,
|
|
284
|
+
projectRoot,
|
|
285
|
+
pack,
|
|
286
|
+
projectDir, inventory: fileInventory, previousInventory, onConflict: onFileConflict,
|
|
287
|
+
});
|
|
288
|
+
copiedAgents += result.copiedAgents;
|
|
289
|
+
copiedSkills += result.copiedSkills;
|
|
290
|
+
copiedFiles += result.copiedFiles;
|
|
291
|
+
|
|
292
|
+
// Memory pack: initialize brain with existing brain detection.
|
|
293
|
+
// Non-fatal: a read-only or missing home dir (containers, CI) must not
|
|
294
|
+
// abort the install mid-flight and leave a manifest-less partial tree.
|
|
295
|
+
if (packId === 'memory' && pack.packDir) {
|
|
296
|
+
try {
|
|
297
|
+
initMemory({ projectDir, bmadSrc, userName, commLang, selectedPacks });
|
|
298
|
+
} catch (err) {
|
|
299
|
+
clack.log.warn(`Memory/brain initialization failed (non-fatal, install continues): ${err.message}`);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// ── Python provisioning (opt-in) — for packs whose runtime needs Python ──
|
|
305
|
+
// Off by default so `install` never spawns Python unless asked. Closes the
|
|
306
|
+
// "SEO pack ships prompts that call scripts never installed" gap (PROD-02).
|
|
307
|
+
if (options.provisionPython) {
|
|
308
|
+
const pythonPacks = selectedPacks.filter((p) => PYTHON_PACKS[p]);
|
|
309
|
+
for (const packId of pythonPacks) {
|
|
310
|
+
const cfg = PYTHON_PACKS[packId];
|
|
311
|
+
const requirementsPath = path.join(projectRoot, ...cfg.requirements);
|
|
312
|
+
if (!fs.existsSync(requirementsPath)) {
|
|
313
|
+
clack.log.warn(`Python provisioning skipped for ${packId}: ${requirementsPath} not found.`);
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
const pySpinner = clack.spinner();
|
|
317
|
+
pySpinner.start(`Provisioning Python runtime for ${PACKS[packId].name}…`);
|
|
318
|
+
const res = provisionPack({
|
|
319
|
+
envDir: path.join(projectDir, '.bmad', 'venv', packId),
|
|
320
|
+
requirementsPath,
|
|
321
|
+
verifyModules: cfg.verifyModules,
|
|
322
|
+
});
|
|
323
|
+
pySpinner.stop(
|
|
324
|
+
res.ok
|
|
325
|
+
? `${PACKS[packId].name}: Python runtime ready (${res.tool}).`
|
|
326
|
+
: `${PACKS[packId].name}: Python not provisioned — ${res.messages[res.messages.length - 1] || 'see guidance'}`
|
|
327
|
+
);
|
|
328
|
+
if (!res.ok) {
|
|
329
|
+
clack.log.warn(`Run \`${PACKS[packId].name}\` Python tools after installing Python ≥3.11; the pack's prompts still work, only the local scripts need the runtime.`);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Copy module config
|
|
335
|
+
const moduleYaml = path.join(bmadSrc, 'module.yaml');
|
|
336
|
+
if (fs.existsSync(moduleYaml)) {
|
|
337
|
+
copyManagedFile({ source: moduleYaml, target: path.join(targetBmadDir, 'module.yaml'),
|
|
338
|
+
projectDir, inventory: fileInventory, previousInventory, onConflict: onFileConflict });
|
|
339
|
+
copiedFiles++;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const helpCsv = path.join(bmadSrc, 'module-help.csv');
|
|
343
|
+
if (fs.existsSync(helpCsv)) {
|
|
344
|
+
copyManagedFile({ source: helpCsv, target: path.join(targetBmadDir, 'module-help.csv'),
|
|
345
|
+
projectDir, inventory: fileInventory, previousInventory, onConflict: onFileConflict });
|
|
346
|
+
copiedFiles++;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
spinner.stop(i.installed_summary(copiedAgents, copiedSkills, copiedFiles));
|
|
350
|
+
|
|
351
|
+
// ── Step 5: Generate IDE Configs ──
|
|
352
|
+
let adapterHashes = previousManifest?.adapterHashes || {};
|
|
353
|
+
if (detectedIDEs.length > 0) {
|
|
354
|
+
const ideSpinner = clack.spinner();
|
|
355
|
+
ideSpinner.start(i.configuring_ides);
|
|
356
|
+
|
|
357
|
+
const outcome = writeIDEConfigs({
|
|
358
|
+
projectDir,
|
|
359
|
+
files: generateUserFiles(DERIVED, { packs: selectedPacks, userName, language: commLang, tools: detectedIDEs }),
|
|
360
|
+
adapterHashes,
|
|
361
|
+
yes: options.yes,
|
|
362
|
+
});
|
|
363
|
+
adapterHashes = { ...adapterHashes, ...outcome.adapterHashes };
|
|
364
|
+
|
|
365
|
+
ideSpinner.stop(i.ide_configured(detectedIDEs.length));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// ── Step 6: Create config.yaml ──
|
|
369
|
+
const configYaml = generateConfigYaml(userName, commLang, projectDir, execMode);
|
|
370
|
+
const configPath = path.join(targetBmadDir, 'config.yaml');
|
|
371
|
+
fs.writeFileSync(configPath, configYaml, 'utf8');
|
|
372
|
+
|
|
373
|
+
// ── Step 7: Create output directories ──
|
|
374
|
+
const outputDir = path.join(projectDir, '_bmad-output');
|
|
375
|
+
fsExtra.ensureDirSync(path.join(outputDir, 'discovery'));
|
|
376
|
+
fsExtra.ensureDirSync(path.join(outputDir, 'build'));
|
|
377
|
+
fsExtra.ensureDirSync(path.join(projectDir, 'docs'));
|
|
378
|
+
|
|
379
|
+
// ── Step 8: Write install manifest ──
|
|
380
|
+
const pkgVersion = require('../../../package.json').version;
|
|
381
|
+
const manifest = {
|
|
382
|
+
version: pkgVersion,
|
|
383
|
+
uiLanguage: lang,
|
|
384
|
+
installed: new Date().toISOString(),
|
|
385
|
+
packs: selectedPacks,
|
|
386
|
+
ides: detectedIDEs,
|
|
387
|
+
adapterHashes,
|
|
388
|
+
fileInventory: { schemaVersion: 1, complete: inventoryComplete, files: fileInventory },
|
|
389
|
+
executionMode: execMode,
|
|
390
|
+
user: userName,
|
|
391
|
+
language: commLang,
|
|
392
|
+
};
|
|
393
|
+
fs.writeFileSync(
|
|
394
|
+
path.join(targetBmadDir, '.bmad-plus-install.json'),
|
|
395
|
+
JSON.stringify(manifest, null, 2),
|
|
396
|
+
'utf8'
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
// ── Summary — Contextual Getting Started ──
|
|
400
|
+
const agentGuide = [
|
|
401
|
+
i.guide_who,
|
|
402
|
+
'',
|
|
403
|
+
` ${i.guide_idea.padEnd(28)} → "Atlas, [...]"`,
|
|
404
|
+
` ${i.guide_prd.padEnd(28)} → "Atlas, create PRD"`,
|
|
405
|
+
` ${i.guide_arch.padEnd(28)} → "Forge, propose architecture"`,
|
|
406
|
+
` ${i.guide_code.padEnd(28)} → "Forge, implement story [X]"`,
|
|
407
|
+
` ${i.guide_test.padEnd(28)} → "Sentinel, review module [X]"`,
|
|
408
|
+
` ${i.guide_sprint.padEnd(28)} → "Nexus, create epics"`,
|
|
409
|
+
` ${i.guide_auto.padEnd(28)} → "autopilot"`,
|
|
410
|
+
];
|
|
411
|
+
|
|
412
|
+
if (selectedPacks.includes('osint')) {
|
|
413
|
+
agentGuide.push(` ${i.guide_osint.padEnd(28)} → "Shadow, investigate [name]"`);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (selectedPacks.includes('maker')) {
|
|
417
|
+
agentGuide.push(` ${i.guide_maker.padEnd(28)} → "Maker, create agent [desc]"`);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
if (selectedPacks.includes('seo')) {
|
|
421
|
+
agentGuide.push(` ${i.guide_seo.padEnd(28)} → "/seo audit <url>"`);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (selectedPacks.includes('backup')) {
|
|
425
|
+
agentGuide.push(` ${i.guide_backup.padEnd(28)} → "/backup create"`);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (selectedPacks.includes('animated')) {
|
|
429
|
+
agentGuide.push(` ${i.guide_animated.padEnd(28)} → "/animated build <video>"`);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if (selectedPacks.includes('shield')) {
|
|
433
|
+
agentGuide.push(` ${(i.guide_shield || '🛡️ GRC Compliance').padEnd(28)} → "Shield, audit my SaaS for GDPR"`);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (selectedPacks.includes('memory')) {
|
|
437
|
+
agentGuide.push(` ${(i.guide_memory || '🧠 Memory Brain').padEnd(28)} → "Zecher, scan projects in [path]"`);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (selectedPacks.includes('dev-studio')) {
|
|
441
|
+
agentGuide.push(` ${(i.guide_dev_studio || '🏗️ Dev Studio').padEnd(28)} → "Miriam, brainstorm my app idea"`);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
agentGuide.push(
|
|
445
|
+
'',
|
|
446
|
+
i.guide_workflow,
|
|
447
|
+
' 1. Atlas (idea → brief → PRD)',
|
|
448
|
+
' 2. Forge (architecture → code)',
|
|
449
|
+
' 3. Sentinel (tests → review)',
|
|
450
|
+
'',
|
|
451
|
+
i.guide_or_auto,
|
|
452
|
+
'',
|
|
453
|
+
`${i.guide_output}: _bmad-output/discovery/ & _bmad-output/build/`,
|
|
454
|
+
'',
|
|
455
|
+
'─'.repeat(50),
|
|
456
|
+
'',
|
|
457
|
+
`📦 ${i.guide_cli_title || 'CLI Commands'}:`,
|
|
458
|
+
` npx bmad-plus install ${i.guide_cli_install || '— Install agents & skills'}`,
|
|
459
|
+
` npx bmad-plus update ${i.guide_cli_update || '— Update agents (keeps config)'}`,
|
|
460
|
+
` npx bmad-plus doctor ${i.guide_cli_doctor || '— Check installation health'}`,
|
|
461
|
+
` npx bmad-plus uninstall ${i.guide_cli_uninstall || '— Remove BMAD+ from project'}`,
|
|
462
|
+
);
|
|
463
|
+
|
|
464
|
+
// Add pack-specific examples
|
|
465
|
+
const examples = [];
|
|
466
|
+
if (selectedPacks.includes('seo')) {
|
|
467
|
+
examples.push(` ${i.guide_example_seo || '🔍 SEO: "/seo audit https://example.com"'}`);
|
|
468
|
+
}
|
|
469
|
+
if (selectedPacks.includes('backup')) {
|
|
470
|
+
examples.push(` ${i.guide_example_backup || '🗂️ Backup: "/backup create" → ZIP timestamped'}`);
|
|
471
|
+
}
|
|
472
|
+
if (selectedPacks.includes('animated')) {
|
|
473
|
+
examples.push(` ${i.guide_example_animated || '🎬 Animated: "/animated build hero.mp4"'}`);
|
|
474
|
+
}
|
|
475
|
+
if (selectedPacks.includes('osint')) {
|
|
476
|
+
examples.push(` ${i.guide_example_osint || '🔍 OSINT: "Shadow, investigate John Doe"'}`);
|
|
477
|
+
}
|
|
478
|
+
if (selectedPacks.includes('shield')) {
|
|
479
|
+
examples.push(
|
|
480
|
+
` ${i.guide_example_shield_1 || '🛡️ GRC: "Shield, audit my app for GDPR compliance"'}`,
|
|
481
|
+
` ${i.guide_example_shield_2 || '🛡️ GRC: "Shield, gap analysis ISO 27001 vs NIST CSF"'}`,
|
|
482
|
+
` ${i.guide_example_shield_3 || '🛡️ GRC: "Shield, generate SOC 2 evidence checklist"'}`,
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
if (selectedPacks.includes('dev-studio')) {
|
|
486
|
+
examples.push(
|
|
487
|
+
` ${i.guide_example_dev_studio_1 || '🏗️ Dev Studio: "Miriam, brainstorm a productivity app"'}`,
|
|
488
|
+
` ${i.guide_example_dev_studio_2 || '🏗️ Dev Studio: "Bezalel, design the architecture"'}`,
|
|
489
|
+
` ${i.guide_example_dev_studio_3 || '🏗️ Dev Studio: "Oholiab, implement story S1"'}`,
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
if (selectedPacks.includes('memory')) {
|
|
493
|
+
examples.push(
|
|
494
|
+
` ${i.guide_example_memory_1 || '🧠 Memory: "Zecher, scan projects in D:\\travail\\DEV"'}`,
|
|
495
|
+
` ${i.guide_example_memory_2 || '🧠 Memory: "Zecher, where were we?"'}`,
|
|
496
|
+
` ${i.guide_example_memory_3 || '🧠 Memory: "Zecher, consolidate memory"'}`,
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if (examples.length > 0) {
|
|
501
|
+
agentGuide.push(
|
|
502
|
+
'',
|
|
503
|
+
`💡 ${i.guide_examples_title || 'Quick Examples'}:`,
|
|
504
|
+
...examples
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
agentGuide.push(
|
|
509
|
+
'',
|
|
510
|
+
'---',
|
|
511
|
+
i.guide_credits
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
clack.note(agentGuide.join('\n'), i.guide_title);
|
|
515
|
+
|
|
516
|
+
clack.outro(pc.green(i.guide_ready));
|
|
517
|
+
} finally {
|
|
518
|
+
releaseLock();
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
// Exported for functional testing (not part of the public API)
|
|
522
|
+
_internal: { writeIDEConfigs, generateConfigYaml },
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
function generateConfigYaml(userName, language, projectDir, execMode = 'manual') {
|
|
526
|
+
if (!['manual', 'autopilot', 'hybrid'].includes(execMode)) throw new Error('Unknown execution mode: ' + execMode);
|
|
527
|
+
return '# BMAD+ Project Configuration\n# Generated by bmad-plus install\n\n' + yaml.dump({
|
|
528
|
+
user_name: userName,
|
|
529
|
+
communication_language: language,
|
|
530
|
+
document_output_language: language,
|
|
531
|
+
output_folder: '_bmad-output',
|
|
532
|
+
project_name: path.basename(projectDir),
|
|
533
|
+
execution_mode: execMode,
|
|
534
|
+
auto_role_activation: true,
|
|
535
|
+
parallel_execution: true,
|
|
536
|
+
checkpoints: {
|
|
537
|
+
discovery: 'require_approval',
|
|
538
|
+
architecture: 'require_approval',
|
|
539
|
+
story: execMode === 'autopilot' ? 'notify_only' : 'require_approval',
|
|
540
|
+
delivery: 'require_approval',
|
|
541
|
+
},
|
|
542
|
+
}, { lineWidth: -1, forceQuotes: true, quotingType: '"' });
|
|
543
|
+
}
|