revert: restore workflow metadata handling
This commit is contained in:
parent
d52e7026ed
commit
9aeecdd470
|
|
@ -1,4 +1,6 @@
|
||||||
---
|
---
|
||||||
|
name: bmad-brainstorming
|
||||||
|
description: 'Facilitate interactive brainstorming sessions using diverse creative techniques and ideation methods. Use when the user says help me brainstorm or help me ideate.'
|
||||||
context_file: '' # Optional context file path for project-specific guidance
|
context_file: '' # Optional context file path for project-specific guidance
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const yaml = require('yaml');
|
|
||||||
const { XmlHandler } = require('../../../lib/xml-handler');
|
const { XmlHandler } = require('../../../lib/xml-handler');
|
||||||
const prompts = require('../../../lib/prompts');
|
const prompts = require('../../../lib/prompts');
|
||||||
const { getSourcePath } = require('../../../lib/project-root');
|
const { getSourcePath } = require('../../../lib/project-root');
|
||||||
|
|
@ -340,10 +339,6 @@ class BaseIdeSetup {
|
||||||
|
|
||||||
const entries = await fs.readdir(dir, { withFileTypes: true });
|
const entries = await fs.readdir(dir, { withFileTypes: true });
|
||||||
|
|
||||||
if (await this.isSkillDirectory(dir)) {
|
|
||||||
return workflows;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const fullPath = path.join(dir, entry.name);
|
const fullPath = path.join(dir, entry.name);
|
||||||
|
|
||||||
|
|
@ -381,37 +376,6 @@ class BaseIdeSetup {
|
||||||
return workflows;
|
return workflows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether a directory is claimed by a native skill.
|
|
||||||
* Skill directories should be surfaced via SKILL.md, not workflow.md metadata.
|
|
||||||
* @param {string} dir - Directory path
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
async isSkillDirectory(dir) {
|
|
||||||
const manifestPath = path.join(dir, 'bmad-skill-manifest.yaml');
|
|
||||||
const skillPath = path.join(dir, 'SKILL.md');
|
|
||||||
|
|
||||||
if (!(await fs.pathExists(manifestPath)) || !(await fs.pathExists(skillPath))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const manifest = yaml.parse(await fs.readFile(manifestPath, 'utf8'));
|
|
||||||
|
|
||||||
if (!manifest || typeof manifest !== 'object') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (manifest.__single) {
|
|
||||||
return manifest.__single.type === 'skill';
|
|
||||||
}
|
|
||||||
|
|
||||||
return Object.values(manifest).some((entry) => entry && typeof entry === 'object' && entry.type === 'skill');
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scan a directory for files with specific extension(s)
|
* Scan a directory for files with specific extension(s)
|
||||||
* @param {string} dir - Directory to scan
|
* @param {string} dir - Directory to scan
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue