chore(install): stop copying skill prompts to _bmad by default

Flip install_to_bmad default from true to false so skill directories
are cleaned from _bmad/ after IDE install. Skills are self-contained
in their IDE directories (.claude/skills/, etc.) and no longer need
duplicate copies in _bmad/.

Two skills (bmad-create-prd, bmad-validate-prd) opt back in via
explicit manifests because bmad-edit-prd cross-references their data
files. Also fixes broken bmm-skills/ path references and corrects
the file-ref validator module-to-source mapping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Verkhovsky 2026-04-01 10:57:56 -07:00
parent c46502f640
commit 3e590bb186
10 changed files with 42 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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('');

View File

@ -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 };

View File

@ -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);
}