bmad-plus 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/LICENSE +21 -21
  3. package/README.md +107 -85
  4. package/osint-agent-package/README.md +88 -88
  5. package/osint-agent-package/SETUP_KEYS.md +108 -108
  6. package/osint-agent-package/agents/osint-investigator.md +80 -80
  7. package/osint-agent-package/install.ps1 +87 -87
  8. package/osint-agent-package/install.sh +76 -76
  9. package/osint-agent-package/skills/bmad-osint-investigate/SKILL.md +147 -147
  10. package/osint-agent-package/skills/bmad-osint-investigate/osint/references/enrichment-databases-fr.md +148 -148
  11. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/_http.py +101 -101
  12. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/apify.py +266 -266
  13. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/brightdata.py +101 -101
  14. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/diagnose.py +141 -141
  15. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/exa.py +79 -79
  16. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/jina.py +71 -71
  17. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/parallel.py +85 -85
  18. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/perplexity.py +102 -102
  19. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/tavily.py +72 -72
  20. package/osint-agent-package/skills/bmad-osint-investigate/osint/scripts/volley.py +208 -208
  21. package/osint-agent-package/skills/bmad-osint-investigator/SKILL.md +15 -15
  22. package/package.json +30 -3
  23. package/readme-international/README.de.md +18 -5
  24. package/readme-international/README.es.md +40 -12
  25. package/readme-international/README.fr.md +36 -8
  26. package/src/bmad-plus/agents/agent-architect-dev/SKILL.md +96 -96
  27. package/src/bmad-plus/agents/agent-architect-dev/bmad-skill-manifest.yaml +13 -13
  28. package/src/bmad-plus/agents/agent-maker/SKILL.md +201 -201
  29. package/src/bmad-plus/agents/agent-maker/bmad-skill-manifest.yaml +13 -13
  30. package/src/bmad-plus/agents/agent-orchestrator/SKILL.md +137 -137
  31. package/src/bmad-plus/agents/agent-orchestrator/bmad-skill-manifest.yaml +13 -13
  32. package/src/bmad-plus/agents/agent-quality/SKILL.md +83 -83
  33. package/src/bmad-plus/agents/agent-quality/bmad-skill-manifest.yaml +13 -13
  34. package/src/bmad-plus/agents/agent-shadow/SKILL.md +71 -71
  35. package/src/bmad-plus/agents/agent-shadow/bmad-skill-manifest.yaml +13 -13
  36. package/src/bmad-plus/agents/agent-strategist/SKILL.md +80 -80
  37. package/src/bmad-plus/agents/agent-strategist/bmad-skill-manifest.yaml +13 -13
  38. package/src/bmad-plus/data/role-triggers.yaml +209 -209
  39. package/src/bmad-plus/module-help.csv +10 -10
  40. package/src/bmad-plus/packs/pack-memory/README.md +106 -106
  41. package/src/bmad-plus/packs/pack-memory/memory-orchestrator.md +79 -79
  42. package/src/bmad-plus/packs/pack-memory/shared/karpathy-guardrails.md +86 -86
  43. package/src/bmad-plus/packs/pack-memory/shared/memory-protocol.md +143 -143
  44. package/src/bmad-plus/packs/pack-memory/templates/context.md +39 -39
  45. package/src/bmad-plus/packs/pack-memory/templates/decisions.md +25 -25
  46. package/src/bmad-plus/packs/pack-memory/templates/identity.yaml +39 -39
  47. package/src/bmad-plus/packs/pack-memory/templates/lessons.md +31 -31
  48. package/src/bmad-plus/packs/pack-memory/templates/patterns.md +24 -24
  49. package/src/bmad-plus/packs/pack-memory/templates/session-handoff.md +25 -25
  50. package/src/bmad-plus/packs/pack-memory/zecher-agent.md +157 -157
  51. package/src/bmad-plus/packs/pack-seo/bmad-skill-manifest.yaml +13 -0
  52. package/src/bmad-plus/packs/pack-shield/README.md +110 -110
  53. package/src/bmad-plus/packs/pack-shield/SKILL.md +82 -0
  54. package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/csrd-agent.md +251 -251
  55. package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/section508-agent.md +168 -168
  56. package/src/bmad-plus/packs/pack-shield/categories/accessibility-esg/wcag-agent.md +190 -190
  57. package/src/bmad-plus/packs/pack-shield/categories/ai-governance/eu-ai-act-agent.md +86 -86
  58. package/src/bmad-plus/packs/pack-shield/categories/ai-governance/iso42001-agent.md +240 -240
  59. package/src/bmad-plus/packs/pack-shield/categories/ai-governance/nist-ai-rmf-agent.md +122 -122
  60. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/cis-controls-agent.md +210 -210
  61. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/ism-agent.md +139 -139
  62. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/iso27001-agent.md +156 -156
  63. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nis2-agent.md +72 -72
  64. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nist-800-53-agent.md +239 -239
  65. package/src/bmad-plus/packs/pack-shield/categories/cybersecurity/nist-csf-agent.md +207 -207
  66. package/src/bmad-plus/packs/pack-shield/categories/data-privacy/ccpa-agent.md +94 -94
  67. package/src/bmad-plus/packs/pack-shield/categories/data-privacy/dpdpa-agent.md +136 -136
  68. package/src/bmad-plus/packs/pack-shield/categories/data-privacy/gdpr-agent.md +296 -296
  69. package/src/bmad-plus/packs/pack-shield/categories/data-privacy/iso27701-agent.md +134 -134
  70. package/src/bmad-plus/packs/pack-shield/categories/data-privacy/lgpd-agent.md +129 -129
  71. package/src/bmad-plus/packs/pack-shield/categories/defense-export/cmmc-agent.md +116 -116
  72. package/src/bmad-plus/packs/pack-shield/categories/defense-export/ear-agent.md +261 -261
  73. package/src/bmad-plus/packs/pack-shield/categories/defense-export/itar-agent.md +191 -191
  74. package/src/bmad-plus/packs/pack-shield/categories/defense-export/tsa-agent.md +356 -356
  75. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/dora-agent.md +499 -499
  76. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/fedramp-agent.md +236 -236
  77. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/hipaa-agent.md +162 -162
  78. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/pci-dss-agent.md +228 -228
  79. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/soc2-agent.md +255 -255
  80. package/src/bmad-plus/packs/pack-shield/categories/industry-compliance/swift-csp-agent.md +153 -153
  81. package/src/bmad-plus/packs/pack-shield/categories/workflows/ai-act-classifier.md +131 -131
  82. package/src/bmad-plus/packs/pack-shield/categories/workflows/ai-act-fria.md +155 -155
  83. package/src/bmad-plus/packs/pack-shield/categories/workflows/ai-act-incidents.md +187 -187
  84. package/src/bmad-plus/packs/pack-shield/categories/workflows/ai-act-roles.md +113 -113
  85. package/src/bmad-plus/packs/pack-shield/categories/workflows/breach-sentinel.md +197 -197
  86. package/src/bmad-plus/packs/pack-shield/categories/workflows/cookie-policy-gen.md +180 -180
  87. package/src/bmad-plus/packs/pack-shield/categories/workflows/dpia-sentinel.md +235 -235
  88. package/src/bmad-plus/packs/pack-shield/categories/workflows/legitimate-interest.md +159 -159
  89. package/src/bmad-plus/packs/pack-shield/categories/workflows/privacy-advisor.md +133 -133
  90. package/src/bmad-plus/packs/pack-shield/categories/workflows/privacy-notice-gen.md +160 -160
  91. package/src/bmad-plus/packs/pack-shield/categories/workflows/privacy-policy-gen.md +135 -135
  92. package/src/bmad-plus/packs/pack-shield/references/ccpa/ccpa-gdpr-comparison.md +117 -117
  93. package/src/bmad-plus/packs/pack-shield/references/ccpa/consumer-rights-workflows.md +177 -177
  94. package/src/bmad-plus/packs/pack-shield/references/cis-controls/framework-mappings.md +162 -162
  95. package/src/bmad-plus/packs/pack-shield/references/cis-controls/implementation-guidance.md +235 -235
  96. package/src/bmad-plus/packs/pack-shield/references/cis-controls/safeguards-detail.md +252 -252
  97. package/src/bmad-plus/packs/pack-shield/references/cmmc/cmmc-assessment.md +170 -170
  98. package/src/bmad-plus/packs/pack-shield/references/cmmc/cmmc-levels.md +113 -113
  99. package/src/bmad-plus/packs/pack-shield/references/cmmc/cmmc-practices.md +211 -211
  100. package/src/bmad-plus/packs/pack-shield/references/csrd/compliance-program.md +281 -281
  101. package/src/bmad-plus/packs/pack-shield/references/csrd/double-materiality.md +253 -253
  102. package/src/bmad-plus/packs/pack-shield/references/csrd/esrs-standards.md +401 -401
  103. package/src/bmad-plus/packs/pack-shield/references/dora/article-reference.md +441 -441
  104. package/src/bmad-plus/packs/pack-shield/references/dora/incident-classification.md +297 -297
  105. package/src/bmad-plus/packs/pack-shield/references/dora/rts-its-guide.md +306 -306
  106. package/src/bmad-plus/packs/pack-shield/references/dora/third-party-risk.md +349 -349
  107. package/src/bmad-plus/packs/pack-shield/references/dpdpa/gdpr-comparison.md +173 -173
  108. package/src/bmad-plus/packs/pack-shield/references/dpdpa/rights-and-obligations.md +426 -426
  109. package/src/bmad-plus/packs/pack-shield/references/dpdpa/rules-2025.md +599 -599
  110. package/src/bmad-plus/packs/pack-shield/references/dpdpa/sections-reference.md +319 -319
  111. package/src/bmad-plus/packs/pack-shield/references/ear/ccl-eccn-guide.md +250 -250
  112. package/src/bmad-plus/packs/pack-shield/references/ear/compliance-program.md +280 -280
  113. package/src/bmad-plus/packs/pack-shield/references/ear/license-exceptions.md +207 -207
  114. package/src/bmad-plus/packs/pack-shield/references/eu-ai-act/gpai-governance.md +267 -267
  115. package/src/bmad-plus/packs/pack-shield/references/eu-ai-act/obligations-high-risk.md +287 -287
  116. package/src/bmad-plus/packs/pack-shield/references/eu-ai-act/risk-classification.md +182 -182
  117. package/src/bmad-plus/packs/pack-shield/references/fedramp/appendices-guide.md +209 -209
  118. package/src/bmad-plus/packs/pack-shield/references/fedramp/control-families.md +281 -281
  119. package/src/bmad-plus/packs/pack-shield/references/fedramp/poam-guide.md +93 -93
  120. package/src/bmad-plus/packs/pack-shield/references/fedramp/readiness-checklist.md +134 -134
  121. package/src/bmad-plus/packs/pack-shield/references/fedramp/sap-sar-guide.md +86 -86
  122. package/src/bmad-plus/packs/pack-shield/references/fedramp/ssp-guide.md +129 -129
  123. package/src/bmad-plus/packs/pack-shield/references/gdpr-compliance/documents.md +192 -192
  124. package/src/bmad-plus/packs/pack-shield/references/gdpr-compliance/dpa-template.md +121 -121
  125. package/src/bmad-plus/packs/pack-shield/references/gdpr-compliance/privacy-notice.md +87 -87
  126. package/src/bmad-plus/packs/pack-shield/references/hipaa-compliance/breach-notification.md +293 -293
  127. package/src/bmad-plus/packs/pack-shield/references/hipaa-compliance/privacy-rule.md +276 -276
  128. package/src/bmad-plus/packs/pack-shield/references/hipaa-compliance/security-rule.md +299 -299
  129. package/src/bmad-plus/packs/pack-shield/references/hipaa-compliance/templates.md +568 -568
  130. package/src/bmad-plus/packs/pack-shield/references/ism/control-applicability.md +181 -181
  131. package/src/bmad-plus/packs/pack-shield/references/ism/guidelines-overview.md +183 -183
  132. package/src/bmad-plus/packs/pack-shield/references/iso27001/annex-a-2013.md +203 -203
  133. package/src/bmad-plus/packs/pack-shield/references/iso27001/annex-a-2022.md +132 -132
  134. package/src/bmad-plus/packs/pack-shield/references/iso27001/control-mapping.md +153 -153
  135. package/src/bmad-plus/packs/pack-shield/references/iso27701/annex-a-controls.md +195 -195
  136. package/src/bmad-plus/packs/pack-shield/references/iso27701/regulatory-mapping.md +229 -229
  137. package/src/bmad-plus/packs/pack-shield/references/iso27701/transition-guide.md +219 -219
  138. package/src/bmad-plus/packs/pack-shield/references/iso42001/iso42001-ai-risk-assessment.md +258 -258
  139. package/src/bmad-plus/packs/pack-shield/references/iso42001/iso42001-clauses-requirements.md +279 -279
  140. package/src/bmad-plus/packs/pack-shield/references/iso42001/iso42001-controls-annex-a.md +155 -155
  141. package/src/bmad-plus/packs/pack-shield/references/itar/compliance-program.md +174 -174
  142. package/src/bmad-plus/packs/pack-shield/references/itar/licensing-guide.md +146 -146
  143. package/src/bmad-plus/packs/pack-shield/references/itar/usml-categories.md +93 -93
  144. package/src/bmad-plus/packs/pack-shield/references/lgpd/anpd-enforcement.md +147 -147
  145. package/src/bmad-plus/packs/pack-shield/references/lgpd/compliance-program.md +272 -272
  146. package/src/bmad-plus/packs/pack-shield/references/lgpd/lgpd-articles.md +271 -271
  147. package/src/bmad-plus/packs/pack-shield/references/nis2/article-21-measures.md +153 -153
  148. package/src/bmad-plus/packs/pack-shield/references/nis2/iso27001-nis2-mapping.md +68 -68
  149. package/src/bmad-plus/packs/pack-shield/references/nist-800-53/assessment-rmf.md +349 -349
  150. package/src/bmad-plus/packs/pack-shield/references/nist-800-53/baselines-tailoring.md +277 -277
  151. package/src/bmad-plus/packs/pack-shield/references/nist-800-53/control-families.md +450 -450
  152. package/src/bmad-plus/packs/pack-shield/references/nist-ai-rmf/rmf-core.md +361 -361
  153. package/src/bmad-plus/packs/pack-shield/references/nist-ai-rmf/rmf-profiles.md +192 -192
  154. package/src/bmad-plus/packs/pack-shield/references/nist-csf/csf-10-to-20-mapping.md +143 -143
  155. package/src/bmad-plus/packs/pack-shield/references/nist-csf/csf-20-functions-categories.md +278 -278
  156. package/src/bmad-plus/packs/pack-shield/references/nist-csf/csf-implementation-tiers.md +135 -135
  157. package/src/bmad-plus/packs/pack-shield/references/pci-compliance/pci-dss-requirements.md +366 -366
  158. package/src/bmad-plus/packs/pack-shield/references/pci-compliance/pci-dss-saq-guide.md +217 -217
  159. package/src/bmad-plus/packs/pack-shield/references/pci-compliance/pci-dss-v4-changes.md +190 -190
  160. package/src/bmad-plus/packs/pack-shield/references/section-508/wcag-mapping.md +160 -160
  161. package/src/bmad-plus/packs/pack-shield/references/soc2/controls.md +241 -241
  162. package/src/bmad-plus/packs/pack-shield/references/soc2/evidence.md +236 -236
  163. package/src/bmad-plus/packs/pack-shield/references/soc2/policies.md +254 -254
  164. package/src/bmad-plus/packs/pack-shield/references/soc2/vendor.md +276 -276
  165. package/src/bmad-plus/packs/pack-shield/references/swift-csp/swift-assessment.md +202 -202
  166. package/src/bmad-plus/packs/pack-shield/references/swift-csp/swift-controls.md +545 -545
  167. package/src/bmad-plus/packs/pack-shield/references/tsa-compliance/tsa-crmp-requirements.md +359 -359
  168. package/src/bmad-plus/packs/pack-shield/references/tsa-compliance/tsa-directives-overview.md +187 -187
  169. package/src/bmad-plus/packs/pack-shield/references/tsa-compliance/tsa-incident-reporting.md +187 -187
  170. package/src/bmad-plus/packs/pack-shield/references/wcag/criteria-detail.md +510 -510
  171. package/src/bmad-plus/packs/pack-shield/shared/audit-report-template.md +103 -103
  172. package/src/bmad-plus/packs/pack-shield/shared/cross-framework-mapper.md +103 -103
  173. package/src/bmad-plus/packs/pack-shield/shared/gap-analysis-template.md +83 -83
  174. package/src/bmad-plus/packs/pack-shield/shield-orchestrator.md +229 -229
  175. package/src/bmad-plus/packs/pack-shield/upstream-sync.yaml +68 -68
  176. package/src/bmad-plus/skills/bmad-plus-autopilot/SKILL.md +99 -99
  177. package/src/bmad-plus/skills/bmad-plus-parallel/SKILL.md +93 -93
  178. package/src/bmad-plus/skills/bmad-plus-sync/SKILL.md +69 -69
  179. package/tools/bmad-plus-npx.js +3 -5
  180. package/tools/cli/bmad-plus-cli.js +5 -3
  181. package/tools/cli/commands/autoconfig.js +18 -61
  182. package/tools/cli/commands/doctor.js +30 -31
  183. package/tools/cli/commands/install.js +33 -343
  184. package/tools/cli/commands/memory.js +1 -0
  185. package/tools/cli/commands/scan.js +61 -74
  186. package/tools/cli/commands/uninstall.js +7 -4
  187. package/tools/cli/commands/update.js +15 -72
  188. package/tools/cli/i18n.js +92 -10
  189. package/tools/cli/lib/ide-config.js +259 -0
  190. package/tools/cli/lib/memory-init.js +113 -0
  191. package/tools/cli/lib/pack-copy.js +84 -0
  192. package/tools/cli/lib/packs.js +114 -0
  193. package/tools/cli/lib/stack-detect.js +102 -0
  194. package/tools/cli/lib/validate.js +45 -0
  195. package/src/bmad-plus/agents/pack-animated/animated-website-agent.md +0 -325
  196. package/src/bmad-plus/agents/pack-animated/templates/animated-website-workflow.md +0 -55
  197. package/src/bmad-plus/agents/pack-backup/backup-agent.md +0 -71
  198. package/src/bmad-plus/agents/pack-backup/templates/backup-workflow.md +0 -51
  199. package/src/bmad-plus/agents/pack-seo/SKILL.md +0 -171
  200. package/src/bmad-plus/agents/pack-seo/checklist.md +0 -140
  201. package/src/bmad-plus/agents/pack-seo/pagespeed-playbook.md +0 -320
  202. package/src/bmad-plus/agents/pack-seo/ref/audit-schema.json +0 -187
  203. package/src/bmad-plus/agents/pack-seo/ref/cwv-thresholds.md +0 -87
  204. package/src/bmad-plus/agents/pack-seo/ref/eeat-criteria.md +0 -123
  205. package/src/bmad-plus/agents/pack-seo/ref/geo-signals.md +0 -167
  206. package/src/bmad-plus/agents/pack-seo/ref/hreflang-rules.md +0 -153
  207. package/src/bmad-plus/agents/pack-seo/ref/quality-gates.md +0 -133
  208. package/src/bmad-plus/agents/pack-seo/ref/schema-catalog.md +0 -91
  209. package/src/bmad-plus/agents/pack-seo/ref/schema-templates.json +0 -356
  210. package/src/bmad-plus/agents/pack-seo/seo-chief.md +0 -294
  211. package/src/bmad-plus/agents/pack-seo/seo-judge.md +0 -241
  212. package/src/bmad-plus/agents/pack-seo/seo-scout.md +0 -171
  213. package/src/bmad-plus/agents/pack-seo/templates/seo-audit-workflow.md +0 -241
@@ -8,123 +8,17 @@
8
8
 
9
9
  const path = require('node:path');
10
10
  const fs = require('node:fs');
11
- const os = require('node:os');
12
11
  const fsExtra = require('fs-extra');
13
12
  const clack = require('@clack/prompts');
14
13
  const pc = require('picocolors');
15
14
  const { t, getLanguageOptions, getCommLanguageOptions } = require('../i18n');
15
+ const { PACKS } = require('../lib/packs');
16
+ const { copyPackFiles } = require('../lib/pack-copy');
17
+ const { initMemory } = require('../lib/memory-init');
18
+ const { generateIDEConfig, IDE_CONFIGS } = require('../lib/ide-config');
19
+ const { validateUserName } = require('../lib/validate');
16
20
 
17
- // Pack definitions
18
- const PACKS = {
19
- core: {
20
- name: 'Core Development',
21
- icon: '⚙️',
22
- description: '4 multi-role agents (Atlas, Forge, Sentinel, Nexus)',
23
- required: true,
24
- agents: ['agent-strategist', 'agent-architect-dev', 'agent-quality', 'agent-orchestrator'],
25
- skills: ['bmad-plus-autopilot', 'bmad-plus-parallel', 'bmad-plus-sync'],
26
- data: ['role-triggers.yaml'],
27
- },
28
- osint: {
29
- name: 'OSINT Intelligence',
30
- icon: '🔍',
31
- description: 'Agent Shadow — investigation, scraping, psychoprofil',
32
- required: false,
33
- agents: ['agent-shadow'],
34
- skills: [],
35
- externalPackage: 'osint-agent-package',
36
- },
37
- maker: {
38
- name: 'Agent Creator',
39
- icon: '🧬',
40
- description: 'Maker — design, build, and package new BMAD+ agents',
41
- required: false,
42
- agents: ['agent-maker'],
43
- skills: [],
44
- data: [],
45
- },
46
- shield: {
47
- name: 'Pack Shield (GRC)',
48
- icon: '🛡️',
49
- description: '38 compliance agents — GDPR, ISO 27001, SOC 2, PCI DSS, EU AI Act...',
50
- required: false,
51
- agents: [],
52
- skills: [],
53
- packDir: 'pack-shield',
54
- packSrcDir: 'packs',
55
- },
56
- 'dev-studio': {
57
- name: 'Dev Studio — Full SDLC',
58
- icon: '🏗️',
59
- description: 'Full SDLC pipeline: brainstorm → PRD → architecture → TDD → code review → deploy',
60
- required: false,
61
- agents: [],
62
- skills: [],
63
- packDir: 'pack-dev-studio',
64
- packSrcDir: 'packs',
65
- },
66
- seo: {
67
- name: 'SEO Audit 360',
68
- icon: '🔍',
69
- description: '3 agents (Scout, Chief, Judge) + 6-phase audit + PageSpeed loop',
70
- required: false,
71
- agents: [],
72
- skills: [],
73
- packDir: 'pack-seo',
74
- },
75
- backup: {
76
- name: 'Universal Backup',
77
- icon: '🗂️',
78
- description: 'Timestamped ZIP backup with smart exclusions',
79
- required: false,
80
- agents: [],
81
- skills: [],
82
- packDir: 'pack-backup',
83
- },
84
- animated: {
85
- name: 'Animated Website',
86
- icon: '🎬',
87
- description: 'Luxury scroll-driven website from video',
88
- required: false,
89
- agents: [],
90
- skills: [],
91
- packDir: 'pack-animated',
92
- },
93
- memory: {
94
- name: 'Memory — Persistent Brain',
95
- icon: '🧠',
96
- description: 'Cross-session memory + project scanner + Karpathy guardrails. Agents learn.',
97
- required: false,
98
- agents: [],
99
- skills: [],
100
- packDir: 'pack-memory',
101
- packSrcDir: 'packs',
102
- },
103
- };
104
-
105
- // IDE configurations
106
- const IDE_CONFIGS = {
107
- 'claude-code': {
108
- name: 'Claude Code',
109
- detect: ['.claude'],
110
- configFile: 'CLAUDE.md',
111
- },
112
- 'gemini-cli': {
113
- name: 'Gemini CLI',
114
- detect: ['.gemini'],
115
- configFile: 'GEMINI.md',
116
- },
117
- 'codex-cli': {
118
- name: 'Codex CLI / OpenCode',
119
- detect: ['.codex', '.opencode'],
120
- configFile: 'AGENTS.md',
121
- },
122
- 'antigravity': {
123
- name: 'Antigravity',
124
- detect: ['.gemini/antigravity'],
125
- configFile: 'GEMINI.md',
126
- },
127
- };
21
+ // Pack definitions are imported from the shared module: require('../lib/packs').PACKS
128
22
 
129
23
  module.exports = {
130
24
  command: 'install',
@@ -133,6 +27,7 @@ module.exports = {
133
27
  ['-d, --directory <path>', 'Installation directory (default: current directory)'],
134
28
  ['-p, --packs <packs>', 'Comma-separated pack IDs: core,osint,all (default: interactive)'],
135
29
  ['-y, --yes', 'Accept all defaults, skip prompts'],
30
+ ['-l, --lang <code>', 'Language code: en, fr, es, de, pt-br, ru, zh, he, ja, it (overrides auto-detection)'],
136
31
  ['--tools <tools>', 'Comma-separated IDE IDs (default: auto-detect)'],
137
32
  ],
138
33
  action: async (options) => {
@@ -144,8 +39,8 @@ module.exports = {
144
39
  clack.intro(pc.bgCyan(pc.black(` BMAD+ Installer v${pkgJson.version} `)));
145
40
  clack.log.info(pc.dim('✨ Created by Laurent Rochetta — github.com/lrochetta/BMAD-PLUS'));
146
41
 
147
- let lang = 'en';
148
- if (!options.yes) {
42
+ let lang = options.lang || 'en';
43
+ if (!options.yes && !options.lang) {
149
44
  const langChoice = await clack.select({
150
45
  message: '🌐 Select your language / Choisissez votre langue / 选择语言',
151
46
  options: getLanguageOptions(),
@@ -153,7 +48,7 @@ module.exports = {
153
48
 
154
49
  if (clack.isCancel(langChoice)) {
155
50
  clack.cancel('Installation cancelled.');
156
- process.exit(0);
51
+ throw new Error('Installation cancelled.');
157
52
  }
158
53
  lang = langChoice;
159
54
  }
@@ -164,7 +59,7 @@ module.exports = {
164
59
  if (!fs.existsSync(bmadSrc)) {
165
60
  clack.log.error(`${i.source_not_found}: ${bmadSrc}`);
166
61
  clack.outro(pc.red(i.failed));
167
- process.exit(1);
62
+ throw new Error(`Source not found: ${bmadSrc}`);
168
63
  }
169
64
 
170
65
  clack.log.info(`${i.installing_to}: ${pc.cyan(projectDir)}`);
@@ -187,7 +82,7 @@ module.exports = {
187
82
  .map(([key, pack]) => ({
188
83
  value: key,
189
84
  label: `${pack.icon} ${pack.name}`,
190
- hint: pack.disabled ? i.soon : pack.description,
85
+ hint: pack.disabled ? i.soon : (pack.desc || pack.description || ''),
191
86
  disabled: pack.disabled,
192
87
  })),
193
88
  required: false,
@@ -195,7 +90,7 @@ module.exports = {
195
90
 
196
91
  if (clack.isCancel(packChoice)) {
197
92
  clack.cancel(i.cancelled);
198
- process.exit(0);
93
+ throw new Error(i.cancelled);
199
94
  }
200
95
 
201
96
  selectedPacks = [...new Set(['core', ...packChoice])];
@@ -278,10 +173,15 @@ module.exports = {
278
173
 
279
174
  if (clack.isCancel(userConfig)) {
280
175
  clack.cancel(i.cancelled);
281
- process.exit(0);
176
+ throw new Error(i.cancelled);
282
177
  }
283
178
 
284
- userName = userConfig.userName;
179
+ // Validate user-provided name
180
+ const rawName = userConfig.userName;
181
+ const fb = process.env.USER || process.env.USERNAME || 'Developer';
182
+ const { name: validatedName, warnings } = validateUserName(rawName, fb);
183
+ for (const w of warnings) clack.log.warn(w);
184
+ userName = validatedName;
285
185
  commLang = userConfig.commLang;
286
186
  }
287
187
 
@@ -302,148 +202,26 @@ module.exports = {
302
202
  let copiedSkills = 0;
303
203
  let copiedFiles = 0;
304
204
 
205
+ const projectRoot = path.join(bmadSrc, '..', '..');
206
+
305
207
  for (const packId of selectedPacks) {
306
208
  const pack = PACKS[packId];
307
209
  if (!pack || pack.disabled) continue;
308
210
 
309
- // Copy agents
310
- for (const agent of pack.agents) {
311
- const src = path.join(bmadSrc, 'agents', agent);
312
- const dest = path.join(targetAgentsDir, agent);
313
- if (fs.existsSync(src)) {
314
- fsExtra.copySync(src, dest, { overwrite: true });
315
- copiedAgents++;
316
- }
317
- }
318
-
319
- // Copy skills
320
- for (const skill of pack.skills) {
321
- const src = path.join(bmadSrc, 'skills', skill);
322
- const dest = path.join(targetAgentsDir, skill);
323
- if (fs.existsSync(src)) {
324
- fsExtra.copySync(src, dest, { overwrite: true });
325
- copiedSkills++;
326
- }
327
- }
328
-
329
- // Copy data files
330
- for (const dataFile of (pack.data || [])) {
331
- const src = path.join(bmadSrc, 'data', dataFile);
332
- const dest = path.join(targetDataDir, dataFile);
333
- if (fs.existsSync(src)) {
334
- fsExtra.copySync(src, dest, { overwrite: true });
335
- copiedFiles++;
336
- }
337
- }
338
-
339
- // Copy external package (OSINT)
340
- if (pack.externalPackage) {
341
- const extSrc = path.join(__dirname, '..', '..', '..', pack.externalPackage, 'skills');
342
- const extDest = path.join(targetAgentsDir);
343
- if (fs.existsSync(extSrc)) {
344
- fsExtra.copySync(extSrc, extDest, { overwrite: true });
345
- copiedSkills++;
346
- }
347
- }
348
-
349
- // Copy pack directory (SEO, Backup, Animated Website, Shield)
350
- if (pack.packDir) {
351
- const srcParent = pack.packSrcDir || 'agents';
352
- const packSrc = path.join(bmadSrc, srcParent, pack.packDir);
353
- const packDest = path.join(targetAgentsDir, pack.packDir);
354
- if (fs.existsSync(packSrc)) {
355
- fsExtra.copySync(packSrc, packDest, { overwrite: true });
356
- copiedAgents++;
357
- copiedFiles++;
358
- }
359
- }
211
+ const result = copyPackFiles({
212
+ bmadSrc,
213
+ targetAgentsDir,
214
+ targetDataDir,
215
+ projectRoot,
216
+ pack,
217
+ });
218
+ copiedAgents += result.copiedAgents;
219
+ copiedSkills += result.copiedSkills;
220
+ copiedFiles += result.copiedFiles;
360
221
 
361
222
  // Memory pack: initialize brain with existing brain detection
362
223
  if (packId === 'memory' && pack.packDir) {
363
- const memoryDir = path.join(projectDir, '.agents', 'memory');
364
- const sessionsDir = path.join(memoryDir, 'sessions');
365
- const globalBrainDir = path.join(os.homedir(), '.bmad-plus', 'brain', 'projects');
366
- const templateDir = path.join(bmadSrc, 'packs', 'pack-memory', 'templates');
367
-
368
- // Create project memory (never overwrite existing)
369
- fsExtra.ensureDirSync(sessionsDir);
370
- const memoryFiles = ['decisions.md', 'lessons.md', 'patterns.md', 'context.md'];
371
- for (const mf of memoryFiles) {
372
- const dest = path.join(memoryDir, mf);
373
- if (!fs.existsSync(dest)) {
374
- const src = path.join(templateDir, mf);
375
- if (fs.existsSync(src)) {
376
- let content = fs.readFileSync(src, 'utf8');
377
- content = content.replace(/\{\{date\}\}/g, new Date().toISOString().slice(0, 10));
378
- content = content.replace(/\{\{project_name\}\}/g, path.basename(projectDir));
379
- content = content.replace(/\{\{project_path\}\}/g, projectDir);
380
- fs.writeFileSync(dest, content, 'utf8');
381
- }
382
- }
383
- }
384
-
385
- // Detect existing brain directories
386
- const brainCandidates = [
387
- path.join(os.homedir(), '.bmad-plus', 'brain'),
388
- path.join(projectDir, '_brain'),
389
- path.join(os.homedir(), '.claude', 'memory'),
390
- ];
391
- const existingBrain = brainCandidates.find(p => fs.existsSync(p));
392
-
393
- if (existingBrain) {
394
- clack.log.info(`🧠 ${i.brain_detected || 'Existing brain detected'}: ${existingBrain}`);
395
- // Write brain link pointer
396
- fs.writeFileSync(
397
- path.join(memoryDir, '.brain-link'),
398
- JSON.stringify({ linked_brain: existingBrain, linked_at: new Date().toISOString() }, null, 2),
399
- 'utf8'
400
- );
401
- } else {
402
- // Create fresh global brain
403
- fsExtra.ensureDirSync(globalBrainDir);
404
- const identitySrc = path.join(templateDir, 'identity.yaml');
405
- const identityDest = path.join(os.homedir(), '.bmad-plus', 'brain', 'identity.yaml');
406
- if (fs.existsSync(identitySrc) && !fs.existsSync(identityDest)) {
407
- let content = fs.readFileSync(identitySrc, 'utf8');
408
- content = content.replace(/\{\{user_name\}\}/g, userName);
409
- content = content.replace(/\{\{language\}\}/g, commLang);
410
- content = content.replace(/\{\{date\}\}/g, new Date().toISOString().slice(0, 10));
411
- fs.writeFileSync(identityDest, content, 'utf8');
412
- }
413
- // Copy global memory templates
414
- for (const gf of ['decisions.md', 'lessons.md', 'patterns.md']) {
415
- const dest = path.join(os.homedir(), '.bmad-plus', 'brain', gf);
416
- if (!fs.existsSync(dest)) {
417
- const src = path.join(templateDir, gf);
418
- if (fs.existsSync(src)) {
419
- let content = fs.readFileSync(src, 'utf8');
420
- content = content.replace(/\{\{date\}\}/g, new Date().toISOString().slice(0, 10));
421
- content = content.replace(/\{\{project_name\}\}/g, 'Global Brain');
422
- fs.writeFileSync(dest, content, 'utf8');
423
- }
424
- }
425
- }
426
- clack.log.info(`🧠 ${i.brain_created || 'Global brain created'}: ${path.join(os.homedir(), '.bmad-plus', 'brain')}`);
427
- }
428
-
429
- // Index this project in global brain
430
- const crypto = require('node:crypto');
431
- const projHash = crypto.createHash('sha256').update(projectDir).digest('hex').slice(0, 8);
432
- const projMeta = {
433
- path: projectDir,
434
- name: path.basename(projectDir),
435
- hash: projHash,
436
- status: 'active',
437
- bmad_installed: true,
438
- packs_installed: selectedPacks,
439
- last_scanned: new Date().toISOString().slice(0, 10),
440
- };
441
- fsExtra.ensureDirSync(globalBrainDir);
442
- fs.writeFileSync(
443
- path.join(globalBrainDir, `${projHash}.yaml`),
444
- Object.entries(projMeta).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join('\n'),
445
- 'utf8'
446
- );
224
+ initMemory({ projectDir, bmadSrc, userName, commLang, selectedPacks });
447
225
  }
448
226
  }
449
227
 
@@ -632,94 +410,6 @@ module.exports = {
632
410
 
633
411
  // ── Helpers ──
634
412
 
635
- function generateIDEConfig(userName, language, packs) {
636
- const agents = [
637
- '- **Atlas** (Strategist) — Business analysis + Product management',
638
- '- **Forge** (Architect-Dev) — Architecture + Development + Documentation',
639
- '- **Sentinel** (Quality) — QA + UX review',
640
- '- **Nexus** (Orchestrator) — Sprint management + Autopilot + Parallel execution',
641
- ];
642
-
643
- if (packs.includes('osint')) {
644
- agents.push('- **Shadow** (OSINT) — Investigation + Scraping + Psychoprofiling');
645
- }
646
-
647
- if (packs.includes('shield')) {
648
- agents.push('- **Shield** (GRC) — 38 compliance agents (GDPR, ISO 27001, SOC 2, HIPAA, EU AI Act, DORA, NIS2...)');
649
- }
650
-
651
- if (packs.includes('dev-studio')) {
652
- agents.push('- **Miriam** (מרים) — Business Analyst — Strategic analysis, research, product briefs');
653
- agents.push('- **Huldah** (חולדה) — Technical Writer — Documentation, diagrams, editorial review');
654
- agents.push('- **Yosef** (יוסף) — Product Manager — PRD, requirements, feature prioritization');
655
- agents.push('- **Rachel** (רחל) — UX Designer — User experience, wireframes, empathy mapping');
656
- agents.push('- **Bezalel** (בצלאל) — System Architect — Architecture, ADRs, epics & stories');
657
- agents.push('- **Oholiab** (אהליאב) — Senior Engineer — TDD, sprint, code review, implementation');
658
- }
659
-
660
- if (packs.includes('memory')) {
661
- agents.push('- **Zecher** (זכר) — Memory Archivist — Consolidation, project scanning, context recall');
662
- }
663
-
664
- // Build memory section if memory pack is installed
665
- let memorySection = '';
666
- if (packs.includes('memory')) {
667
- memorySection = [
668
- '',
669
- '## Memory Protocol (Karpathy Guardrails)',
670
- '',
671
- 'Agents MUST follow these behavioral principles:',
672
- '',
673
- '### G1 — Think Before Coding',
674
- '- State assumptions explicitly. If uncertain, ask.',
675
- '- Check `.agents/memory/decisions.md` for prior decisions before re-deciding.',
676
- '',
677
- '### G2 — Simplicity First',
678
- '- Minimum code that solves the problem. Nothing speculative.',
679
- '- Check `.agents/memory/patterns.md` for existing solutions.',
680
- '',
681
- '### G3 — Surgical Changes',
682
- '- Touch only what you must. Match existing style.',
683
- '- Log surprises in `.agents/memory/lessons.md`.',
684
- '',
685
- '### G4 — Goal-Driven Execution',
686
- '- Define success criteria before implementing.',
687
- '- Log non-obvious decisions in `.agents/memory/decisions.md`.',
688
- '',
689
- '### Memory Files',
690
- '- `.agents/memory/decisions.md` — Read at session start, write when making decisions',
691
- '- `.agents/memory/lessons.md` — Write when something unexpected happens',
692
- '- `.agents/memory/patterns.md` — Write when a reusable pattern is validated',
693
- '- `.agents/memory/context.md` — Update at session end with project state',
694
- ].join('\n');
695
- }
696
-
697
- return `# BMAD+ — AI Agent Configuration
698
-
699
- ## Project Context
700
- This project uses BMAD+, an augmented AI-driven development framework.
701
- Based on BMAD-METHOD v6.6.0 with multi-role agents, autopilot mode, and parallel execution.
702
-
703
- ## Agents
704
- To activate an agent, say its name or persona:
705
- ${agents.join('\n')}
706
-
707
- ## Skills
708
- - Load skills from \`.agents/skills/\`
709
- - Each agent has a SKILL.md with capabilities, activation protocol, and role-switching rules
710
- - Auto-activation triggers: \`.agents/data/role-triggers.yaml\`
711
-
712
- ## Key Commands
713
- - \`bmad-help\` — Show all available agents and skills
714
- - \`autopilot\` — Launch Nexus in full pipeline mode
715
- - \`parallel\` — Enable parallel multi-agent execution
716
-
717
- ## Communication
718
- - User name: ${userName}
719
- - Default language: ${language} for user-facing content, English for code and technical docs.
720
- ${memorySection}`;
721
- }
722
-
723
413
  function generateConfigYaml(userName, language, projectDir) {
724
414
  const projectName = path.basename(projectDir);
725
415
  return `# BMAD+ Project Configuration
@@ -40,6 +40,7 @@ module.exports = {
40
40
  description: 'Manage BMAD+ persistent brain (status, export)',
41
41
  options: [
42
42
  ['-d, --directory <path>', 'Project directory (default: current directory)'],
43
+ ['-l, --lang <code>', 'Language code: en, fr, es, de, pt-br, ru, zh, he, ja, it'],
43
44
  ],
44
45
  subcommands: {
45
46
  status: 'Show memory health report',
@@ -12,34 +12,7 @@ const os = require('node:os');
12
12
  const crypto = require('node:crypto');
13
13
  const clack = require('@clack/prompts');
14
14
  const pc = require('picocolors');
15
-
16
- // Project detection markers (priority order)
17
- const PROJECT_MARKERS = [
18
- { file: 'package.json', stack: 'Node.js', detect: (dir) => {
19
- try {
20
- const pkg = JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'));
21
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
22
- if (deps['next']) return 'Next.js';
23
- if (deps['nuxt']) return 'Nuxt';
24
- if (deps['react']) return 'React';
25
- if (deps['vue']) return 'Vue.js';
26
- if (deps['svelte']) return 'Svelte';
27
- if (deps['express']) return 'Express';
28
- if (deps['fastify']) return 'Fastify';
29
- if (deps['electron']) return 'Electron';
30
- if (deps['tauri']) return 'Tauri';
31
- return 'Node.js';
32
- } catch { return 'Node.js'; }
33
- }},
34
- { file: 'Cargo.toml', stack: 'Rust' },
35
- { file: 'pyproject.toml', stack: 'Python' },
36
- { file: 'requirements.txt', stack: 'Python' },
37
- { file: 'go.mod', stack: 'Go' },
38
- { file: 'composer.json', stack: 'PHP' },
39
- { file: 'Gemfile', stack: 'Ruby' },
40
- { file: 'pom.xml', stack: 'Java' },
41
- { file: 'build.gradle', stack: 'Java/Kotlin' },
42
- ];
15
+ const { PROJECT_MARKERS } = require('../lib/stack-detect');
43
16
 
44
17
  // Directories to skip during scanning
45
18
  const SKIP_DIRS = new Set([
@@ -77,7 +50,9 @@ function getProjectName(dir) {
77
50
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
78
51
  if (pkg.name) return pkg.name;
79
52
  }
80
- } catch {}
53
+ } catch {
54
+ // Malformed/unreadable package.json; fall back to directory name.
55
+ }
81
56
  return path.basename(dir);
82
57
  }
83
58
 
@@ -143,6 +118,46 @@ function scanDirectory(rootDir, maxDepth = 4, currentDepth = 0, activeDays = 30,
143
118
  return projects;
144
119
  }
145
120
 
121
+ /**
122
+ * Index a single project in the global brain by writing its metadata YAML file.
123
+ * @param {object} project - Project metadata object
124
+ * @param {string} globalBrainDir - Path to the brain projects directory
125
+ * @returns {void}
126
+ */
127
+ function indexProject(project, globalBrainDir) {
128
+ const hash = crypto.createHash('sha256').update(project.path).digest('hex').slice(0, 8);
129
+ const meta = {
130
+ path: project.path,
131
+ name: project.name,
132
+ hash,
133
+ stack: project.stack,
134
+ status: project.status,
135
+ bmad_installed: project.bmad,
136
+ has_git: project.hasGit,
137
+ last_scanned: new Date().toISOString().slice(0, 10),
138
+ };
139
+ fs.writeFileSync(
140
+ path.join(globalBrainDir, `${hash}.yaml`),
141
+ Object.entries(meta).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join('\n'),
142
+ 'utf8'
143
+ );
144
+ }
145
+
146
+ /**
147
+ * Index multiple projects in the global brain.
148
+ * @param {object[]} projectList - Array of project metadata objects
149
+ * @param {string} brainDir - Path to the brain projects directory
150
+ * @returns {number} Number of projects indexed
151
+ */
152
+ function indexProjects(projectList, brainDir) {
153
+ let count = 0;
154
+ for (const proj of projectList) {
155
+ indexProject(proj, brainDir);
156
+ count++;
157
+ }
158
+ return count;
159
+ }
160
+
146
161
  module.exports = {
147
162
  command: 'scan',
148
163
  description: 'Scan directories to discover and index projects in the global brain',
@@ -152,12 +167,19 @@ module.exports = {
152
167
  ['--active-days <n>', 'Days since last modified to consider a project "active" (default: 30)', '30'],
153
168
  ['--paused-days <n>', 'Days since last modified to consider a project "paused" (default: 180)', '180'],
154
169
  ['-y, --yes', 'Index all projects without prompting'],
170
+ ['-l, --lang <code>', 'Language code: en, fr, es, de, pt-br, ru, zh, he, ja, it'],
155
171
  ],
156
172
  action: async (options) => {
157
173
  const scanDir = path.resolve(options.directory || process.cwd());
158
- const maxDepth = parseInt(options.depth) || 4;
159
- const activeDays = parseInt(options.activeDays) || 30;
160
- const pausedDays = parseInt(options.pausedDays) || 180;
174
+
175
+ const rawDepth = parseInt(options.depth, 10);
176
+ const maxDepth = (!isNaN(rawDepth) && rawDepth > 0) ? rawDepth : (() => { clack.log.warn(`Invalid --depth "${options.depth}", defaulting to 4`); return 4; })();
177
+
178
+ const rawActive = parseInt(options.activeDays, 10);
179
+ const activeDays = (!isNaN(rawActive) && rawActive > 0) ? rawActive : (() => { clack.log.warn(`Invalid --active-days "${options.activeDays}", defaulting to 30`); return 30; })();
180
+
181
+ const rawPaused = parseInt(options.pausedDays, 10);
182
+ const pausedDays = (!isNaN(rawPaused) && rawPaused > 0) ? rawPaused : (() => { clack.log.warn(`Invalid --paused-days "${options.pausedDays}", defaulting to 180`); return 180; })();
161
183
 
162
184
  clack.intro(pc.bgMagenta(pc.white(' 🧠 BMAD+ Project Scanner ')));
163
185
 
@@ -218,26 +240,7 @@ module.exports = {
218
240
  const fsExtra = require('fs-extra');
219
241
  fsExtra.ensureDirSync(globalBrainDir);
220
242
 
221
- let indexed = 0;
222
- for (const proj of projects) {
223
- const hash = crypto.createHash('sha256').update(proj.path).digest('hex').slice(0, 8);
224
- const meta = {
225
- path: proj.path,
226
- name: proj.name,
227
- hash,
228
- stack: proj.stack,
229
- status: proj.status,
230
- bmad_installed: proj.bmad,
231
- has_git: proj.hasGit,
232
- last_scanned: new Date().toISOString().slice(0, 10),
233
- };
234
- fs.writeFileSync(
235
- path.join(globalBrainDir, `${hash}.yaml`),
236
- Object.entries(meta).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join('\n'),
237
- 'utf8'
238
- );
239
- indexed++;
240
- }
243
+ const indexed = indexProjects(projects, globalBrainDir);
241
244
  clack.log.success(`✅ ${indexed} project(s) indexed in ${globalBrainDir}`);
242
245
  } else {
243
246
  // Interactive mode
@@ -279,27 +282,7 @@ module.exports = {
279
282
  toIndex = selected.map(i => projects[i]);
280
283
  }
281
284
 
282
- let indexed = 0;
283
- for (const proj of toIndex) {
284
- const hash = crypto.createHash('sha256').update(proj.path).digest('hex').slice(0, 8);
285
- const meta = {
286
- path: proj.path,
287
- name: proj.name,
288
- hash,
289
- stack: proj.stack,
290
- status: proj.status,
291
- bmad_installed: proj.bmad,
292
- has_git: proj.hasGit,
293
- last_scanned: new Date().toISOString().slice(0, 10),
294
- };
295
- fs.writeFileSync(
296
- path.join(globalBrainDir, `${hash}.yaml`),
297
- Object.entries(meta).map(([k, v]) => `${k}: ${JSON.stringify(v)}`).join('\n'),
298
- 'utf8'
299
- );
300
- indexed++;
301
- }
302
-
285
+ const indexed = indexProjects(toIndex, globalBrainDir);
303
286
  clack.log.success(`✅ ${indexed} project(s) indexed in global brain`);
304
287
  }
305
288
 
@@ -319,7 +302,9 @@ module.exports = {
319
302
  }
320
303
  }
321
304
  existingProjects.push(meta);
322
- } catch {}
305
+ } catch {
306
+ // Skip a project entry whose index file is unreadable/corrupt.
307
+ }
323
308
  }
324
309
  }
325
310
 
@@ -356,5 +341,7 @@ module.exports = {
356
341
  getProjectName,
357
342
  hasBmadInstalled,
358
343
  scanDirectory,
344
+ indexProject,
345
+ indexProjects,
359
346
  },
360
347
  };
@@ -11,12 +11,15 @@ const fs = require('node:fs');
11
11
  const fsExtra = require('fs-extra');
12
12
  const clack = require('@clack/prompts');
13
13
  const pc = require('picocolors');
14
- const { t, getLanguageOptions } = require('../i18n');
14
+ const { t } = require('../i18n');
15
15
 
16
16
  module.exports = {
17
17
  command: 'uninstall',
18
18
  description: 'Remove BMAD+ from your project',
19
- action: async () => {
19
+ options: [
20
+ ['-l, --lang <code>', 'Language code: en, fr, es, de, pt-br, ru, zh, he, ja, it'],
21
+ ],
22
+ action: async (options) => {
20
23
  const projectDir = process.cwd();
21
24
 
22
25
  clack.intro(pc.bgRed(pc.white(' BMAD+ Uninstaller ')));
@@ -31,8 +34,8 @@ module.exports = {
31
34
 
32
35
  const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
33
36
 
34
- // Use the language from install manifest, or ask
35
- let lang = manifest.uiLanguage || 'en';
37
+ // Use --lang flag, or fall back to manifest language
38
+ let lang = options.lang || manifest.uiLanguage || 'en';
36
39
  const i = t(lang);
37
40
 
38
41
  clack.log.info(`BMAD+ v${manifest.version} (${i.installed_on || 'installed'} ${manifest.installed.split('T')[0]})`);