bmad-init

Featured

在项目中初始化或更新 BMad-Method (V6)

AI & Automation 6,083 stars 421 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# /bmad-init 命令 此命令在您的项目中初始化或更新 BMad-Method (V6)。 ## 当调用此命令时: 1. 检查 `_bmad/` 目录是否存在,判断 BMad V6 是否已安装 2. 检查是否存在旧版 V4 安装(`.bmad-core` 或 `.bmad-method` 目录) 3. 新安装执行:`npx bmad-method install --directory . --modules bmm --tools claude-code --communication-language Chinese --document-output-language Chinese --yes` 4. 已安装则执行:`npx bmad-method install --directory . --action quick-update --yes` 5. 修复安装器 bug:将 `{output_folder}` 重命名为 `_bmad-output`(Beta 已知问题) 6. 自动更新 `.gitignore`(移除 V4 条目,添加 V6 条目) 7. 显示安装结果并提示用户后续操作 ## 实现 ```javascript const { execSync } = require('node:child_process') const fs = require('node:fs') const path = require('node:path') // 需要从 .gitignore 清理的旧条目 const LEGACY_GITIGNORE_ENTRIES = [ '.bmad-core', '.bmad-method', '.claude/commands/BMad', '{output_folder}', // v6.0.0-Beta.8 bug 产物 ] // V6 新版 .gitignore 条目 const V6_GITIGNORE_ENTRIES = [ '_bmad/', '_bmad-output/', ] // 修复安装器 bug: {output_folder} 未解析为 _bmad-output (v6.0.0-Beta.8) function fixOutputFolderBug(cwd) { const buggyPath = path.join(cwd, '{output_folder}') const correctPath = path.join(cwd, '_bmad-output') if (!fs.existsSync(buggyPath)) return false if (!fs.existsSync(correctPath)) { // _bmad-output 不存在,直接重命名 fs.renameSync(buggyPath, correctPath) console.log(' ✅ {output_folder} → _bmad-output/ (重命名)') } else { // _bmad-output 已存在,合并子目录后删除 const entries = fs.readdirSync(buggyPath, { withFileTypes: true }) for (const entry of entries) { const src...

Details

Author
UfoMiao
Repository
UfoMiao/zcf
Created
1 years ago
Last Updated
1 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category