-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat(installer): add BMad Automator module #2345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ class ConfigDrivenIdeSetup { | |
| this.platformConfig = platformConfig; | ||
| this.installerConfig = platformConfig.installer || null; | ||
| this.bmadFolderName = BMAD_FOLDER_NAME; | ||
| this.externalModuleManager = null; | ||
| this.moduleTargetCache = new Map(); | ||
|
|
||
| // Set configDir from target_dir so detect() works | ||
| this.configDir = this.installerConfig?.target_dir || null; | ||
|
|
@@ -123,13 +125,16 @@ class ConfigDrivenIdeSetup { | |
| await fs.ensureDir(targetPath); | ||
|
|
||
| this.skillWriteTracker = new Set(); | ||
| this.skippedUnsupported = 0; | ||
| const results = { skills: 0 }; | ||
|
|
||
| results.skills = await this.installVerbatimSkills(projectDir, bmadDir, targetPath, config); | ||
| results.skippedUnsupported = this.skippedUnsupported || 0; | ||
| results.skillDirectories = this.skillWriteTracker.size; | ||
|
|
||
| await this.printSummary(results, target_dir, options); | ||
| this.skillWriteTracker = null; | ||
| this.skippedUnsupported = 0; | ||
| return { success: true, results }; | ||
| } | ||
|
|
||
|
|
@@ -162,6 +167,11 @@ class ConfigDrivenIdeSetup { | |
| const canonicalId = record.canonicalId; | ||
| if (!canonicalId) continue; | ||
|
|
||
| if (!(await this.shouldInstallSkillRecord(record))) { | ||
| this.skippedUnsupported = (this.skippedUnsupported || 0) + 1; | ||
| continue; | ||
| } | ||
|
|
||
| // Derive source directory from path column | ||
| // path is like "_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/SKILL.md" | ||
| // Strip bmadFolderName prefix and join with bmadDir, then get dirname | ||
|
|
@@ -196,6 +206,24 @@ class ConfigDrivenIdeSetup { | |
| return count; | ||
| } | ||
|
|
||
| async shouldInstallSkillRecord(record) { | ||
| const moduleName = record.module; | ||
| if (!moduleName) return true; | ||
|
|
||
| if (this.moduleTargetCache.has(moduleName)) { | ||
| const targets = this.moduleTargetCache.get(moduleName); | ||
| return !targets || targets.includes(this.name); | ||
| } | ||
|
|
||
| const { ExternalModuleManager } = require('../modules/external-manager'); | ||
| this.externalModuleManager = this.externalModuleManager || new ExternalModuleManager(); | ||
| const moduleInfo = await this.externalModuleManager.getModuleByCode(moduleName); | ||
| const targets = moduleInfo?.installTargets?.length ? moduleInfo.installTargets : null; | ||
| this.moduleTargetCache.set(moduleName, targets); | ||
|
|
||
| return !targets || targets.includes(this.name); | ||
|
Comment on lines
+218
to
+224
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard module metadata lookup failures to avoid hard install aborts.
Suggested hardening const { ExternalModuleManager } = require('../modules/external-manager');
this.externalModuleManager = this.externalModuleManager || new ExternalModuleManager();
- const moduleInfo = await this.externalModuleManager.getModuleByCode(moduleName);
+ let moduleInfo = null;
+ try {
+ moduleInfo = await this.externalModuleManager.getModuleByCode(moduleName);
+ } catch {
+ // Metadata lookup is advisory for filtering; avoid aborting entire install.
+ this.moduleTargetCache.set(moduleName, null);
+ return true;
+ }
const targets = moduleInfo?.installTargets?.length ? moduleInfo.installTargets : null;
this.moduleTargetCache.set(moduleName, targets);As per coding guidelines 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| /** | ||
| * Print installation summary | ||
| * @param {Object} results - Installation results | ||
|
|
@@ -207,6 +235,9 @@ class ConfigDrivenIdeSetup { | |
| if (count > 0) { | ||
| await prompts.log.success(`${this.name} configured: ${count} skills → ${targetDir}`); | ||
| } | ||
| if (results.skippedUnsupported > 0) { | ||
| await prompts.log.warn(`${this.name}: skipped ${results.skippedUnsupported} skill(s) that do not support this IDE`); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.