bmad-method 6.2.3-next.2 → 6.2.3-next.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method",
4
- "version": "6.2.3-next.2",
4
+ "version": "6.2.3-next.3",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -4,7 +4,7 @@
4
4
  modules:
5
5
  bmad-builder:
6
6
  url: https://github.com/bmad-code-org/bmad-builder
7
- module-definition: src/module.yaml
7
+ module-definition: skills/module.yaml
8
8
  code: bmb
9
9
  name: "BMad Builder"
10
10
  description: "Agent and Builder"
@@ -313,10 +313,41 @@ class ExternalModuleManager {
313
313
 
314
314
  // The module-definition specifies the path to module.yaml relative to repo root
315
315
  // We need to return the directory containing module.yaml
316
- const moduleDefinitionPath = moduleInfo.moduleDefinition; // e.g., 'src/module.yaml'
317
- const moduleDir = path.dirname(path.join(cloneDir, moduleDefinitionPath));
316
+ const moduleDefinitionPath = moduleInfo.moduleDefinition; // e.g., 'skills/module.yaml'
317
+ const configuredPath = path.join(cloneDir, moduleDefinitionPath);
318
318
 
319
- return moduleDir;
319
+ if (await fs.pathExists(configuredPath)) {
320
+ return path.dirname(configuredPath);
321
+ }
322
+
323
+ // Fallback: search skills/ and src/ (root level and one level deep for subfolders)
324
+ for (const dir of ['skills', 'src']) {
325
+ const rootCandidate = path.join(cloneDir, dir, 'module.yaml');
326
+ if (await fs.pathExists(rootCandidate)) {
327
+ return path.dirname(rootCandidate);
328
+ }
329
+ const dirPath = path.join(cloneDir, dir);
330
+ if (await fs.pathExists(dirPath)) {
331
+ const entries = await fs.readdir(dirPath, { withFileTypes: true });
332
+ for (const entry of entries) {
333
+ if (entry.isDirectory()) {
334
+ const subCandidate = path.join(dirPath, entry.name, 'module.yaml');
335
+ if (await fs.pathExists(subCandidate)) {
336
+ return path.dirname(subCandidate);
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+
343
+ // Check repo root as last fallback
344
+ const rootCandidate = path.join(cloneDir, 'module.yaml');
345
+ if (await fs.pathExists(rootCandidate)) {
346
+ return path.dirname(rootCandidate);
347
+ }
348
+
349
+ // Nothing found: return configured path (preserves old behavior for error messaging)
350
+ return path.dirname(configuredPath);
320
351
  }
321
352
  }
322
353