diff --git a/tools/installer/modules/external-manager.js b/tools/installer/modules/external-manager.js index 7d2add4fb..d8ecf8a5d 100644 --- a/tools/installer/modules/external-manager.js +++ b/tools/installer/modules/external-manager.js @@ -524,8 +524,20 @@ class ExternalModuleManager { return path.dirname(rootCandidate); } - // Nothing found: return configured path (preserves old behavior for error messaging) - return path.dirname(configuredPath); + // Nothing found: the cloned ref does not contain a recognizable module structure. + // This happens when a stable tag predates a module restructure (e.g. the repo + // moved files from payload/ to skills/ after the tag was cut). Returning a + // non-existent path silently causes a confusing ENOENT deep inside copyModuleWithFiltering; + // throw a descriptive error here instead so the user knows what happened and how to recover. + const resolution = ExternalModuleManager._resolutions.get(moduleCode); + const versionHint = resolution?.version ? `version ${resolution.version}` : 'the cloned version'; + const channelHint = + resolution?.channel === 'stable' ? ` Try reinstalling with \`--next=${moduleCode}\` to use the latest main branch instead.` : ''; + throw new Error( + `Module '${moduleCode}' was downloaded but its module definition was not found. ` + + `Expected '${moduleDefinitionPath}' to exist in ${versionHint}, but it is missing. ` + + `The repository may have been restructured after this release was tagged.${channelHint}`, + ); } cachedModules = null; } diff --git a/tools/installer/modules/registry-fallback.yaml b/tools/installer/modules/registry-fallback.yaml index 52bc4b4fc..e2416af9d 100644 --- a/tools/installer/modules/registry-fallback.yaml +++ b/tools/installer/modules/registry-fallback.yaml @@ -18,6 +18,17 @@ modules: npmPackage: bmad-builder default_channel: stable + bmad-automator: + url: https://github.com/bmad-code-org/bmad-automator + module-definition: skills/module.yaml + code: baut + name: "BMad Automator" + description: "Story automation skills" + defaultSelected: false + type: experimental + npmPackage: bmad-story-automator + default_channel: next + bmad-creative-intelligence-suite: url: https://github.com/bmad-code-org/bmad-module-creative-intelligence-suite module-definition: src/module.yaml