Merge branch 'main' into feat/transform-qa-agent-to-test-architect

This commit is contained in:
Murat K Ozcan
2025-08-15 16:40:42 -05:00
committed by GitHub
6 changed files with 62 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ See [Expansion Packs Guide](../docs/expansion-packs.md) for detailed examples an
### Template Rules ### Template Rules
Templates follow the [BMad Document Template](common/utils/bmad-doc-template.md) specification using YAML format: Templates follow the [BMad Document Template](../common/utils/bmad-doc-template.md) specification using YAML format:
1. **Structure**: Templates are defined in YAML with clear metadata, workflow configuration, and section hierarchy 1. **Structure**: Templates are defined in YAML with clear metadata, workflow configuration, and section hierarchy
2. **Separation of Concerns**: Instructions for LLMs are in `instruction` fields, separate from content 2. **Separation of Concerns**: Instructions for LLMs are in `instruction` fields, separate from content

View File

@@ -6,13 +6,17 @@ const fs = require('fs').promises;
const yaml = require('js-yaml'); const yaml = require('js-yaml');
const chalk = require('chalk'); const chalk = require('chalk');
const inquirer = require('inquirer'); const inquirer = require('inquirer');
const semver = require('semver');
const https = require('https');
// Handle both execution contexts (from root via npx or from installer directory) // Handle both execution contexts (from root via npx or from installer directory)
let version; let version;
let installer; let installer;
let packageName;
try { try {
// Try installer context first (when run from tools/installer/) // Try installer context first (when run from tools/installer/)
version = require('../package.json').version; version = require('../package.json').version;
packageName = require('../package.json').name;
installer = require('../lib/installer'); installer = require('../lib/installer');
} catch (e) { } catch (e) {
// Fall back to root context (when run via npx from GitHub) // Fall back to root context (when run via npx from GitHub)
@@ -86,6 +90,60 @@ program
} }
}); });
// Command to check if updates are available
program
.command('update-check')
.description('Check for BMad Update')
.action(async () => {
console.log('Checking for updates...');
// Make HTTP request to npm registry for latest version info
const req = https.get(`https://registry.npmjs.org/${packageName}/latest`, res => {
// Check for HTTP errors (non-200 status codes)
if (res.statusCode !== 200) {
console.error(chalk.red(`Update check failed: Received status code ${res.statusCode}`));
return;
}
// Accumulate response data chunks
let data = '';
res.on('data', chunk => data += chunk);
// Process complete response
res.on('end', () => {
try {
// Parse npm registry response and extract version
const latest = JSON.parse(data).version;
// Compare versions using semver
if (semver.gt(latest, version)) {
console.log(chalk.bold.blue(`⚠️ ${packageName} update available: ${version}${latest}`));
console.log(chalk.bold.blue('\nInstall latest by running:'));
console.log(chalk.bold.magenta(` npm install ${packageName}@latest`));
console.log(chalk.dim(' or'));
console.log(chalk.bold.magenta(` npx ${packageName}@latest`));
} else {
console.log(chalk.bold.blue(`${packageName} is up to date`));
}
} catch (error) {
// Handle JSON parsing errors
console.error(chalk.red('Failed to parse npm registry data:'), error.message);
}
});
});
// Handle network/connection errors
req.on('error', error => {
console.error(chalk.red('Update check failed:'), error.message);
});
// Set 30 second timeout to prevent hanging
req.setTimeout(30000, () => {
req.destroy();
console.error(chalk.red('Update check timed out'));
});
});
program program
.command('list:expansions') .command('list:expansions')
.description('List available expansion packs') .description('List available expansion packs')

View File

@@ -11,7 +11,7 @@ installation-options:
ide-configurations: ide-configurations:
cursor: cursor:
name: Cursor name: Cursor
rule-dir: .cursor/rules/ rule-dir: .cursor/rules/bmad/
format: multi-file format: multi-file
command-suffix: .mdc command-suffix: .mdc
instructions: | instructions: |

View File

@@ -68,7 +68,7 @@ class IdeSetup extends BaseIdeSetup {
} }
async setupCursor(installDir, selectedAgent) { async setupCursor(installDir, selectedAgent) {
const cursorRulesDir = path.join(installDir, ".cursor", "rules"); const cursorRulesDir = path.join(installDir, ".cursor", "rules", "bmad");
const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir); const agents = selectedAgent ? [selectedAgent] : await this.getAllAgentIds(installDir);
await fileManager.ensureDirectory(cursorRulesDir); await fileManager.ensureDirectory(cursorRulesDir);

View File

@@ -557,7 +557,7 @@ class V3ToV4Upgrader {
try { try {
const ideMessages = { const ideMessages = {
cursor: "Rules created in .cursor/rules/", cursor: "Rules created in .cursor/rules/bmad/",
"claude-code": "Commands created in .claude/commands/BMad/", "claude-code": "Commands created in .claude/commands/BMad/",
windsurf: "Rules created in .windsurf/rules/", windsurf: "Rules created in .windsurf/rules/",
trae: "Rules created in.trae/rules/", trae: "Rules created in.trae/rules/",