diff --git a/src/bmm-skills/2-plan-workflows/bmad-create-prd/bmad-skill-manifest.yaml b/src/bmm-skills/2-plan-workflows/bmad-create-prd/bmad-skill-manifest.yaml new file mode 100644 index 000000000..cdf2e1ac2 --- /dev/null +++ b/src/bmm-skills/2-plan-workflows/bmad-create-prd/bmad-skill-manifest.yaml @@ -0,0 +1,3 @@ +# Cross-referenced by bmad-edit-prd for prd-purpose.md and data files. +# Must remain in _bmad/ until those references are refactored. +install_to_bmad: true diff --git a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md index ed9381338..f8d84ecb3 100644 --- a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md +++ b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01-discovery.md @@ -1,6 +1,6 @@ --- # File references (ONLY variables used in this step) -prdPurpose: '{project-root}/_bmad/bmm-skills/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' +prdPurpose: '{project-root}/_bmad/bmm/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' --- # Step E-1: Discovery & Understanding diff --git a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md index 55948f378..8ce979f10 100644 --- a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md +++ b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-01b-legacy-conversion.md @@ -1,7 +1,7 @@ --- # File references (ONLY variables used in this step) prdFile: '{prd_file_path}' -prdPurpose: '{project-root}/_bmad/bmm-skills/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' +prdPurpose: '{project-root}/_bmad/bmm/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' --- # Step E-1B: Legacy PRD Conversion Assessment diff --git a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md index 22706b4c7..6eaac3c25 100644 --- a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md +++ b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-02-review.md @@ -2,7 +2,7 @@ # File references (ONLY variables used in this step) prdFile: '{prd_file_path}' validationReport: '{validation_report_path}' # If provided -prdPurpose: '{project-root}/_bmad/bmm-skills/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' +prdPurpose: '{project-root}/_bmad/bmm/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' --- # Step E-2: Deep Review & Analysis diff --git a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md index 1f7e595a0..99d942495 100644 --- a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md +++ b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-03-edit.md @@ -1,7 +1,7 @@ --- # File references (ONLY variables used in this step) prdFile: '{prd_file_path}' -prdPurpose: '{project-root}/_bmad/bmm-skills/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' +prdPurpose: '{project-root}/_bmad/bmm/2-plan-workflows/bmad-create-prd/data/prd-purpose.md' --- # Step E-3: Edit & Update diff --git a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md index 4ab9d05ea..bba9385de 100644 --- a/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md +++ b/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md @@ -1,7 +1,7 @@ --- # File references (ONLY variables used in this step) prdFile: '{prd_file_path}' -validationWorkflow: '{project-root}/_bmad/bmm-skills/2-plan-workflows/bmad-validate-prd/steps-v/step-v-01-discovery.md' +validationWorkflow: '{project-root}/_bmad/bmm/2-plan-workflows/bmad-validate-prd/steps-v/step-v-01-discovery.md' --- # Step E-4: Complete & Validate diff --git a/src/bmm-skills/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml b/src/bmm-skills/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml new file mode 100644 index 000000000..86714441d --- /dev/null +++ b/src/bmm-skills/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml @@ -0,0 +1,3 @@ +# Cross-referenced by bmad-edit-prd for validation workflow steps. +# Must remain in _bmad/ until those references are refactored. +install_to_bmad: true diff --git a/test/test-install-to-bmad.js b/test/test-install-to-bmad.js index d33218eb8..f5df68d6c 100644 --- a/test/test-install-to-bmad.js +++ b/test/test-install-to-bmad.js @@ -4,8 +4,9 @@ * Unit tests against the functions that implement the install_to_bmad flag. * These nail down the 4 core design decisions: * - * 1. true/omitted → skill stays in _bmad/ (default behavior) - * 2. false → skill removed from _bmad/ after IDE install + * 1. omitted → skill removed from _bmad/ (default behavior) + * 2. true → skill stays in _bmad/ (explicit opt-in) + * 2b. false → skill removed from _bmad/ after IDE install * 3. No platform → no cleanup runs (cleanup lives in installVerbatimSkills) * 4. Mixed flags → each skill evaluated independently * @@ -49,20 +50,22 @@ async function runTests() { console.log(`========================================${colors.reset}\n`); // ============================================================ - // 1. true/omitted → getInstallToBmad returns true (keep in _bmad/) + // 1. omitted → getInstallToBmad returns false (remove from _bmad/) + // Skills are self-contained in IDE directories, so the default + // is to clean up from _bmad/ after IDE install. // ============================================================ - console.log(`${colors.yellow}Design decision 1: true or omitted → skill stays in _bmad/${colors.reset}\n`); + console.log(`${colors.yellow}Design decision 1: omitted → skill removed from _bmad/ (default)${colors.reset}\n`); - // Null manifest (no bmad-skill-manifest.yaml) → true - assert(getInstallToBmad(null, 'workflow.md') === true, 'null manifest defaults to true'); + // Null manifest (no bmad-skill-manifest.yaml) → false + assert(getInstallToBmad(null, 'workflow.md') === false, 'null manifest defaults to false'); - // Single-entry, flag omitted → true + // Single-entry, flag omitted → false assert( - getInstallToBmad({ __single: { type: 'skill' } }, 'workflow.md') === true, - 'single-entry manifest with flag omitted defaults to true', + getInstallToBmad({ __single: { type: 'skill' } }, 'workflow.md') === false, + 'single-entry manifest with flag omitted defaults to false', ); - // Single-entry, explicit true → true + // Single-entry, explicit true → true (opt-in to keep in _bmad/) assert( getInstallToBmad({ __single: { type: 'skill', install_to_bmad: true } }, 'workflow.md') === true, 'single-entry manifest with explicit true returns true', @@ -124,7 +127,7 @@ async function runTests() { }; assert(getInstallToBmad(manifest, 'workflow.md') === false, 'multi-entry: workflow.md with false returns false'); assert(getInstallToBmad(manifest, 'other.md') === true, 'multi-entry: other.md with true returns true'); - assert(getInstallToBmad(manifest, 'unknown.md') === true, 'multi-entry: unknown file defaults to true'); + assert(getInstallToBmad(manifest, 'unknown.md') === false, 'multi-entry: unknown file defaults to false'); } console.log(''); diff --git a/tools/installer/ide/shared/skill-manifest.js b/tools/installer/ide/shared/skill-manifest.js index c5ae4aed8..c5caa0cc8 100644 --- a/tools/installer/ide/shared/skill-manifest.js +++ b/tools/installer/ide/shared/skill-manifest.js @@ -56,17 +56,20 @@ function getArtifactType(manifest, filename) { /** * Get the install_to_bmad flag for a specific file from a loaded skill manifest. + * Skills are self-contained in their IDE skill directories (.claude/skills/, etc.), + * so the default is false — skill content is removed from _bmad/ after IDE install. + * Set install_to_bmad: true in bmad-skill-manifest.yaml to opt a skill back in. * @param {Object|null} manifest - Loaded manifest (from loadSkillManifest) * @param {string} filename - Source filename to look up - * @returns {boolean} install_to_bmad value (defaults to true) + * @returns {boolean} install_to_bmad value (defaults to false) */ function getInstallToBmad(manifest, filename) { - if (!manifest) return true; + if (!manifest) return false; // Single-entry manifest applies to all files in the directory - if (manifest.__single) return manifest.__single.install_to_bmad !== false; + if (manifest.__single) return manifest.__single.install_to_bmad === true; // Multi-entry: look up by filename directly - if (manifest[filename]) return manifest[filename].install_to_bmad !== false; - return true; + if (manifest[filename]) return manifest[filename].install_to_bmad === true; + return false; } module.exports = { loadSkillManifest, getCanonicalId, getArtifactType, getInstallToBmad }; diff --git a/tools/validate-file-refs.js b/tools/validate-file-refs.js index 5f412eb88..75a802967 100644 --- a/tools/validate-file-refs.js +++ b/tools/validate-file-refs.js @@ -156,8 +156,15 @@ function mapInstalledToSource(refPath) { // Skip install-only paths (generated at install time, not in source) if (isInstallOnly(cleaned)) return null; - // core/, bmm/, and utility/ are directly under src/ - if (cleaned.startsWith('core/') || cleaned.startsWith('bmm/') || cleaned.startsWith('utility/')) { + // Map installed module names to their source directory names + // _bmad/core/ → src/core-skills/, _bmad/bmm/ → src/bmm-skills/ + if (cleaned.startsWith('core/')) { + return path.join(SRC_DIR, 'core-skills', cleaned.slice('core/'.length)); + } + if (cleaned.startsWith('bmm/')) { + return path.join(SRC_DIR, 'bmm-skills', cleaned.slice('bmm/'.length)); + } + if (cleaned.startsWith('utility/')) { return path.join(SRC_DIR, cleaned); }