refactor: update file paths to remove leading dot from bmad-core references

This commit is contained in:
manjaroblack
2025-08-18 09:46:16 -05:00
parent aa9777a06e
commit ed7291f2ce
41 changed files with 901 additions and 909 deletions

View File

@@ -254,9 +254,9 @@ async function promptInstallation() {
currentVersion === newVersion
? `(v${currentVersion} - reinstall)`
: `(v${currentVersion} → v${newVersion})`;
bmadOptionText = `Update ${coreShortTitle} ${versionInfo} .bmad-core`;
bmadOptionText = `Update ${coreShortTitle} ${versionInfo} bmad-core`;
} else {
bmadOptionText = `${coreShortTitle} (v${version}) .bmad-core`;
bmadOptionText = `${coreShortTitle} (v${version}) bmad-core`;
}
choices.push({

View File

@@ -1,7 +1,7 @@
installation-options:
full:
name: Complete BMad Core
description: Copy the entire .bmad-core folder with all agents, templates, and tools
description: Copy the entire bmad-core folder with all agents, templates, and tools
action: copy-folder
source: bmad-core
single-agent:

View File

@@ -148,7 +148,7 @@ class ConfigLoader {
// Add all resolved resources
for (const resource of agentDeps.resources) {
const filePath = `.bmad-core/${resource.type}/${resource.id}.md`;
const filePath = `bmad-core/${resource.type}/${resource.id}.md`;
if (!depPaths.includes(filePath)) {
depPaths.push(filePath);
}
@@ -229,11 +229,11 @@ class ConfigLoader {
const depPaths = [];
// Add team config file
depPaths.push(`.bmad-core/agent-teams/${teamId}.yaml`);
depPaths.push(`bmad-core/agent-teams/${teamId}.yaml`);
// Add all agents
for (const agent of teamDeps.agents) {
const filePath = `.bmad-core/agents/${agent.id}.md`;
const filePath = `bmad-core/agents/${agent.id}.md`;
if (!depPaths.includes(filePath)) {
depPaths.push(filePath);
}
@@ -241,7 +241,7 @@ class ConfigLoader {
// Add all resolved resources
for (const resource of teamDeps.resources) {
const filePath = `.bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yaml' : 'md'}`;
const filePath = `bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yaml' : 'md'}`;
if (!depPaths.includes(filePath)) {
depPaths.push(filePath);
}

View File

@@ -272,7 +272,7 @@ class FileManager {
}
async modifyCoreConfig(installDir, config) {
const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml');
const coreConfigPath = path.join(installDir, 'bmad-core', 'core-config.yaml');
try {
// Read the existing core-config.yaml
@@ -382,7 +382,7 @@ class FileManager {
return false;
}
}
manifestDir = '.bmad-core';
manifestDir = 'bmad-core';
manifestFile = 'install-manifest.yaml';
}

View File

@@ -50,7 +50,7 @@ class BaseIdeSetup {
async getCoreAgentIds(installDir) {
const coreAgents = [];
const corePaths = [
path.join(installDir, '.bmad-core', 'agents'),
path.join(installDir, 'bmad-core', 'agents'),
path.join(installDir, 'bmad-core', 'agents'),
];
@@ -80,7 +80,7 @@ class BaseIdeSetup {
if (!agentPath) {
// Check installation-specific paths
const possiblePaths = [
path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'common', 'agents', `${agentId}.md`),
];
@@ -134,7 +134,7 @@ class BaseIdeSetup {
const dotExpansions = await resourceLocator.findFiles('.bmad-*', { cwd: installDir });
for (const dotExpansion of dotExpansions) {
if (dotExpansion !== '.bmad-core') {
if (dotExpansion !== 'bmad-core') {
const packPath = path.join(installDir, dotExpansion);
const packName = dotExpansion.slice(1); // remove the dot
expansionPacks.push({
@@ -147,7 +147,7 @@ class BaseIdeSetup {
// Check other dot folders that have config.yaml
const allDotFolders = await resourceLocator.findFiles('.*', { cwd: installDir });
for (const folder of allDotFolders) {
if (!folder.startsWith('.bmad-') && folder !== '.bmad-core') {
if (!folder.startsWith('.bmad-') && folder !== 'bmad-core') {
const packPath = path.join(installDir, folder);
const configPath = path.join(packPath, 'config.yaml');
if (await fileManager.pathExists(configPath)) {

View File

@@ -113,7 +113,7 @@ class IdeSetup extends BaseIdeSetup {
coreSlashPrefix,
coreAgents,
coreTasks,
'.bmad-core',
'bmad-core',
);
// Setup expansion pack commands
@@ -151,7 +151,7 @@ class IdeSetup extends BaseIdeSetup {
coreSlashPrefix,
coreAgents,
coreTasks,
'.bmad-core',
'bmad-core',
);
// Setup expansion pack commands
@@ -445,7 +445,7 @@ class IdeSetup extends BaseIdeSetup {
async findAgentPath(agentId, installDir) {
// Try to find the agent file in various locations
const possiblePaths = [
path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'agents', `${agentId}.md`),
];
@@ -469,8 +469,8 @@ class IdeSetup extends BaseIdeSetup {
const glob = require('glob');
const allAgentIds = [];
// Check core agents in .bmad-core or root
let agentsDir = path.join(installDir, '.bmad-core', 'agents');
// Check core agents in bmad-core or root
let agentsDir = path.join(installDir, 'bmad-core', 'agents');
if (!(await fileManager.pathExists(agentsDir))) {
agentsDir = path.join(installDir, 'agents');
}
@@ -495,8 +495,8 @@ class IdeSetup extends BaseIdeSetup {
async getCoreAgentIds(installDir) {
const allAgentIds = [];
// Check core agents in .bmad-core or root only
let agentsDir = path.join(installDir, '.bmad-core', 'agents');
// Check core agents in bmad-core or root only
let agentsDir = path.join(installDir, 'bmad-core', 'agents');
if (!(await fileManager.pathExists(agentsDir))) {
agentsDir = path.join(installDir, 'bmad-core', 'agents');
}
@@ -513,8 +513,8 @@ class IdeSetup extends BaseIdeSetup {
async getCoreTaskIds(installDir) {
const allTaskIds = [];
// Check core tasks in .bmad-core or root only
let tasksDir = path.join(installDir, '.bmad-core', 'tasks');
// Check core tasks in bmad-core or root only
let tasksDir = path.join(installDir, 'bmad-core', 'tasks');
if (!(await fileManager.pathExists(tasksDir))) {
tasksDir = path.join(installDir, 'bmad-core', 'tasks');
}
@@ -538,7 +538,7 @@ class IdeSetup extends BaseIdeSetup {
async getAgentTitle(agentId, installDir) {
// Try to find the agent file in various locations
const possiblePaths = [
path.join(installDir, '.bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'bmad-core', 'agents', `${agentId}.md`),
path.join(installDir, 'agents', `${agentId}.md`),
];
@@ -579,8 +579,8 @@ class IdeSetup extends BaseIdeSetup {
const glob = require('glob');
const allTaskIds = [];
// Check core tasks in .bmad-core or root
let tasksDir = path.join(installDir, '.bmad-core', 'tasks');
// Check core tasks in bmad-core or root
let tasksDir = path.join(installDir, 'bmad-core', 'tasks');
if (!(await fileManager.pathExists(tasksDir))) {
tasksDir = path.join(installDir, 'bmad-core', 'tasks');
}
@@ -623,7 +623,7 @@ class IdeSetup extends BaseIdeSetup {
async findTaskPath(taskId, installDir) {
// Try to find the task file in various locations
const possiblePaths = [
path.join(installDir, '.bmad-core', 'tasks', `${taskId}.md`),
path.join(installDir, 'bmad-core', 'tasks', `${taskId}.md`),
path.join(installDir, 'bmad-core', 'tasks', `${taskId}.md`),
path.join(installDir, 'common', 'tasks', `${taskId}.md`),
];
@@ -657,7 +657,7 @@ class IdeSetup extends BaseIdeSetup {
async getCoreSlashPrefix(installDir) {
try {
const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml');
const coreConfigPath = path.join(installDir, 'bmad-core', 'core-config.yaml');
if (!(await fileManager.pathExists(coreConfigPath))) {
// Try bmad-core directory
const altConfigPath = path.join(installDir, 'bmad-core', 'core-config.yaml');
@@ -686,7 +686,7 @@ class IdeSetup extends BaseIdeSetup {
const dotExpansions = glob.sync('.bmad-*', { cwd: installDir });
for (const dotExpansion of dotExpansions) {
if (dotExpansion !== '.bmad-core') {
if (dotExpansion !== 'bmad-core') {
const packPath = path.join(installDir, dotExpansion);
const packName = dotExpansion.slice(1); // remove the dot
expansionPacks.push({
@@ -1012,7 +1012,7 @@ class IdeSetup extends BaseIdeSetup {
}
mdContent += '\n```\n\n';
mdContent += '## Project Standards\n\n';
mdContent += `- Always maintain consistency with project documentation in .bmad-core/\n`;
mdContent += `- Always maintain consistency with project documentation in bmad-core/\n`;
mdContent += `- Follow the agent's specific guidelines and constraints\n`;
mdContent += `- Update relevant project files when making changes\n`;
const relativePath = path.relative(installDir, agentPath).replaceAll('\\', '/');

View File

@@ -34,8 +34,8 @@ class Installer {
? config.directory
: path.resolve(originalCwd, config.directory);
if (path.basename(installDir) === '.bmad-core') {
// If user points directly to .bmad-core, treat its parent as the project root
if (path.basename(installDir) === 'bmad-core') {
// If user points directly to bmad-core, treat its parent as the project root
installDir = path.dirname(installDir);
}
@@ -173,8 +173,8 @@ class Installer {
return state; // clean install
}
// Check for V4 installation (has .bmad-core with manifest)
const bmadCorePath = path.join(installDir, '.bmad-core');
// Check for V4 installation (has bmad-core with manifest)
const bmadCorePath = path.join(installDir, 'bmad-core');
const manifestPath = path.join(bmadCorePath, 'install-manifest.yaml');
if (await fileManager.pathExists(manifestPath)) {
@@ -193,7 +193,7 @@ class Installer {
return state;
}
// Check for .bmad-core without manifest (broken V4 or manual copy)
// Check for bmad-core without manifest (broken V4 or manual copy)
if (await fileManager.pathExists(bmadCorePath)) {
state.type = 'unknown_existing';
state.hasBmadCore = true;
@@ -227,23 +227,19 @@ class Installer {
switch (config.installType) {
case 'full': {
// Full installation - copy entire .bmad-core folder as a subdirectory
spinner.text = 'Copying complete .bmad-core folder...';
// Full installation - copy entire bmad-core folder as a subdirectory
spinner.text = 'Copying complete bmad-core folder...';
const sourceDir = resourceLocator.getBmadCorePath();
const bmadCoreDestDir = path.join(installDir, '.bmad-core');
await fileManager.copyDirectoryWithRootReplacement(
sourceDir,
bmadCoreDestDir,
'.bmad-core',
);
const bmadCoreDestDir = path.join(installDir, 'bmad-core');
await fileManager.copyDirectoryWithRootReplacement(sourceDir, bmadCoreDestDir, 'bmad-core');
// Copy common/ items to .bmad-core
// Copy common/ items to bmad-core
spinner.text = 'Copying common utilities...';
await this.copyCommonItems(installDir, '.bmad-core', spinner);
await this.copyCommonItems(installDir, 'bmad-core', spinner);
// Copy documentation files from docs/ to .bmad-core
// Copy documentation files from docs/ to bmad-core
spinner.text = 'Copying documentation files...';
await this.copyDocsItems(installDir, '.bmad-core', spinner);
await this.copyDocsItems(installDir, 'bmad-core', spinner);
// Get list of all files for manifest
const foundFiles = await resourceLocator.findFiles('**/*', {
@@ -251,7 +247,7 @@ class Installer {
nodir: true,
ignore: ['**/.git/**', '**/node_modules/**'],
});
files = foundFiles.map((file) => path.join('.bmad-core', file));
files = foundFiles.map((file) => path.join('bmad-core', file));
break;
}
@@ -263,16 +259,12 @@ class Installer {
const agentPath = configLoader.getAgentPath(config.agent);
const destinationAgentPath = path.join(
installDir,
'.bmad-core',
'bmad-core',
'agents',
`${config.agent}.md`,
);
await fileManager.copyFileWithRootReplacement(
agentPath,
destinationAgentPath,
'.bmad-core',
);
files.push(`.bmad-core/agents/${config.agent}.md`);
await fileManager.copyFileWithRootReplacement(agentPath, destinationAgentPath, 'bmad-core');
files.push(`bmad-core/agents/${config.agent}.md`);
// Copy dependencies
const { all: dependencies } = await resourceLocator.getAgentDependencies(config.agent);
@@ -284,15 +276,15 @@ class Installer {
if (dep.includes('*')) {
// Handle glob patterns with {root} replacement
const copiedFiles = await fileManager.copyGlobPattern(
dep.replace('.bmad-core/', ''),
dep.replace('bmad-core/', ''),
sourceBase,
path.join(installDir, '.bmad-core'),
'.bmad-core',
path.join(installDir, 'bmad-core'),
'bmad-core',
);
files.push(...copiedFiles.map((f) => `.bmad-core/${f}`));
files.push(...copiedFiles.map((f) => `bmad-core/${f}`));
} else {
// Handle single files with {root} replacement if needed
const sourcePath = path.join(sourceBase, dep.replace('.bmad-core/', ''));
const sourcePath = path.join(sourceBase, dep.replace('bmad-core/', ''));
const destinationPath = path.join(installDir, dep);
const needsRootReplacement =
@@ -300,7 +292,7 @@ class Installer {
let success = false;
success = await (needsRootReplacement
? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, '.bmad-core')
? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, 'bmad-core')
: fileManager.copyFile(sourcePath, destinationPath));
if (success) {
@@ -309,14 +301,14 @@ class Installer {
}
}
// Copy common/ items to .bmad-core
// Copy common/ items to bmad-core
spinner.text = 'Copying common utilities...';
const commonFiles = await this.copyCommonItems(installDir, '.bmad-core', spinner);
const commonFiles = await this.copyCommonItems(installDir, 'bmad-core', spinner);
files.push(...commonFiles);
// Copy documentation files from docs/ to .bmad-core
// Copy documentation files from docs/ to bmad-core
spinner.text = 'Copying documentation files...';
const documentFiles = await this.copyDocsItems(installDir, '.bmad-core', spinner);
const documentFiles = await this.copyDocsItems(installDir, 'bmad-core', spinner);
files.push(...documentFiles);
break;
@@ -336,15 +328,15 @@ class Installer {
if (dep.includes('*')) {
// Handle glob patterns with {root} replacement
const copiedFiles = await fileManager.copyGlobPattern(
dep.replace('.bmad-core/', ''),
dep.replace('bmad-core/', ''),
sourceBase,
path.join(installDir, '.bmad-core'),
'.bmad-core',
path.join(installDir, 'bmad-core'),
'bmad-core',
);
files.push(...copiedFiles.map((f) => `.bmad-core/${f}`));
files.push(...copiedFiles.map((f) => `bmad-core/${f}`));
} else {
// Handle single files with {root} replacement if needed
const sourcePath = path.join(sourceBase, dep.replace('.bmad-core/', ''));
const sourcePath = path.join(sourceBase, dep.replace('bmad-core/', ''));
const destinationPath = path.join(installDir, dep);
const needsRootReplacement =
@@ -352,7 +344,7 @@ class Installer {
let success = false;
success = await (needsRootReplacement
? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, '.bmad-core')
? fileManager.copyFileWithRootReplacement(sourcePath, destinationPath, 'bmad-core')
: fileManager.copyFile(sourcePath, destinationPath));
if (success) {
@@ -361,20 +353,20 @@ class Installer {
}
}
// Copy common/ items to .bmad-core
// Copy common/ items to bmad-core
spinner.text = 'Copying common utilities...';
const commonFiles = await this.copyCommonItems(installDir, '.bmad-core', spinner);
const commonFiles = await this.copyCommonItems(installDir, 'bmad-core', spinner);
files.push(...commonFiles);
// Copy documentation files from docs/ to .bmad-core
// Copy documentation files from docs/ to bmad-core
spinner.text = 'Copying documentation files...';
const documentFiles = await this.copyDocsItems(installDir, '.bmad-core', spinner);
const documentFiles = await this.copyDocsItems(installDir, 'bmad-core', spinner);
files.push(...documentFiles);
break;
}
case 'expansion-only': {
// Expansion-only installation - DO NOT create .bmad-core
// Expansion-only installation - DO NOT create bmad-core
// Only install expansion packs
spinner.text = 'Installing expansion packs only...';
@@ -633,7 +625,7 @@ class Installer {
console.log(` Directory: ${installDir}`);
if (state.hasBmadCore) {
console.log(' Found: .bmad-core directory (but no manifest)');
console.log(' Found: bmad-core directory (but no manifest)');
}
if (state.hasOtherFiles) {
console.log(' Found: Other files in directory');
@@ -771,7 +763,7 @@ class Installer {
// Skip the manifest file itself
if (file.endsWith('install-manifest.yaml')) continue;
const relativePath = file.replace('.bmad-core/', '');
const relativePath = file.replace('bmad-core/', '');
const destinationPath = path.join(installDir, file);
// Check if this is a common/ file that needs special processing
@@ -782,7 +774,7 @@ class Installer {
// This is a common/ file - needs template processing
const fs = require('node:fs').promises;
const content = await fs.readFile(commonSourcePath, 'utf8');
const updatedContent = content.replaceAll('{root}', '.bmad-core');
const updatedContent = content.replaceAll('{root}', 'bmad-core');
await fileManager.ensureDirectory(path.dirname(destinationPath));
await fs.writeFile(destinationPath, updatedContent, 'utf8');
spinner.text = `Restored: ${file}`;
@@ -845,8 +837,8 @@ class Installer {
async performReinstall(config, installDir, spinner) {
spinner.start('Preparing to reinstall BMad Method...');
// Remove existing .bmad-core
const bmadCorePath = path.join(installDir, '.bmad-core');
// Remove existing bmad-core
const bmadCorePath = path.join(installDir, 'bmad-core');
if (await fileManager.pathExists(bmadCorePath)) {
spinner.text = 'Removing existing installation...';
await fileManager.removeDirectory(bmadCorePath);
@@ -882,7 +874,7 @@ class Installer {
// Information about installation components
console.log(chalk.bold('\n🎯 Installation Summary:'));
if (config.installType !== 'expansion-only') {
console.log(chalk.green('✓ .bmad-core framework installed with all agents and workflows'));
console.log(chalk.green('✓ bmad-core framework installed with all agents and workflows'));
}
if (config.expansionPacks && config.expansionPacks.length > 0) {
@@ -941,7 +933,7 @@ class Installer {
// Important notice to read the user guide
console.log(
chalk.red.bold(
'\n📖 IMPORTANT: Please read the user guide at docs/user-guide.md (also installed at .bmad-core/user-guide.md)',
'\n📖 IMPORTANT: Please read the user guide at docs/user-guide.md (also installed at bmad-core/user-guide.md)',
),
);
console.log(
@@ -1787,7 +1779,7 @@ class Installer {
// Find all dot folders that might be expansion packs
const dotFolders = glob.sync('.*', {
cwd: installDir,
ignore: ['.git', '.git/**', '.bmad-core', '.bmad-core/**'],
ignore: ['.git', '.git/**', 'bmad-core', 'bmad-core/**'],
});
for (const folder of dotFolders) {
@@ -1944,22 +1936,22 @@ class Installer {
}
async findInstallation() {
// Look for .bmad-core in current directory or parent directories
// Look for bmad-core in current directory or parent directories
let currentDir = process.cwd();
while (currentDir !== path.dirname(currentDir)) {
const bmadDir = path.join(currentDir, '.bmad-core');
const bmadDir = path.join(currentDir, 'bmad-core');
const manifestPath = path.join(bmadDir, 'install-manifest.yaml');
if (await fileManager.pathExists(manifestPath)) {
return currentDir; // Return parent directory, not .bmad-core itself
return currentDir; // Return parent directory, not bmad-core itself
}
currentDir = path.dirname(currentDir);
}
// Also check if we're inside a .bmad-core directory
if (path.basename(process.cwd()) === '.bmad-core') {
// Also check if we're inside a bmad-core directory
if (path.basename(process.cwd()) === 'bmad-core') {
const manifestPath = path.join(process.cwd(), 'install-manifest.yaml');
if (await fileManager.pathExists(manifestPath)) {
return path.dirname(process.cwd()); // Return parent directory

View File

@@ -251,7 +251,7 @@ class ResourceLocator {
if (Array.isArray(deps)) {
byType[type] = deps;
for (const dep of deps) {
allDeps.push(`.bmad-core/${type}/${dep}`);
allDeps.push(`bmad-core/${type}/${dep}`);
}
}
}