ccjk 16.0.7 → 16.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +72 -316
  2. package/dist/chunks/claude-code-config-manager.mjs +28 -7
  3. package/dist/chunks/claude-code-incremental-manager.mjs +2 -2
  4. package/dist/chunks/codex-config-switch.mjs +3 -3
  5. package/dist/chunks/codex-presets.mjs +98 -0
  6. package/dist/chunks/codex-provider-manager.mjs +4 -4
  7. package/dist/chunks/codex-runtime.mjs +246 -0
  8. package/dist/chunks/codex-uninstaller.mjs +2 -2
  9. package/dist/chunks/commands.mjs +1 -1
  10. package/dist/chunks/features.mjs +12 -12
  11. package/dist/chunks/simple-config.mjs +485 -130
  12. package/dist/cli.mjs +1730 -760
  13. package/dist/i18n/locales/en/clean.json +24 -0
  14. package/dist/i18n/locales/en/codex.json +24 -1
  15. package/dist/i18n/locales/en/configuration.json +20 -12
  16. package/dist/i18n/locales/en/hub.json +30 -0
  17. package/dist/i18n/locales/en/menu.json +30 -0
  18. package/dist/i18n/locales/en/workflow.json +13 -1
  19. package/dist/i18n/locales/zh-CN/clean.json +24 -0
  20. package/dist/i18n/locales/zh-CN/codex.json +24 -1
  21. package/dist/i18n/locales/zh-CN/configuration.json +20 -12
  22. package/dist/i18n/locales/zh-CN/hub.json +30 -0
  23. package/dist/i18n/locales/zh-CN/menu.json +30 -0
  24. package/dist/i18n/locales/zh-CN/workflow.json +13 -1
  25. package/dist/index.d.mts +3 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.mjs +1 -1
  28. package/dist/shared/{ccjk.BSLlI-JL.mjs → ccjk.TC1_-qhV.mjs} +1 -1
  29. package/package.json +1 -1
  30. package/templates/common/output-styles/en/agents-md-baseline.md +28 -0
  31. package/templates/common/output-styles/en/plan-first.md +30 -0
  32. package/templates/common/output-styles/en/surgical-diff.md +27 -0
  33. package/templates/common/output-styles/en/verify-and-ship.md +31 -0
  34. package/templates/common/output-styles/zh-CN/agents-md-baseline.md +28 -0
  35. package/templates/common/output-styles/zh-CN/plan-first.md +30 -0
  36. package/templates/common/output-styles/zh-CN/surgical-diff.md +27 -0
  37. package/templates/common/output-styles/zh-CN/verify-and-ship.md +31 -0
  38. package/templates/common/workflow/bmad/en/bmad-init.md +275 -0
  39. package/templates/common/workflow/bmad/zh-CN/bmad-init.md +275 -0
  40. package/templates/common/workflow/codeReview/en/code-review.md +34 -0
  41. package/templates/common/workflow/codeReview/zh-CN/code-review.md +34 -0
  42. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +628 -0
  43. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +628 -0
  44. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +187 -0
  45. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +191 -0
  46. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +249 -0
  47. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +277 -0
  48. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +29 -0
  49. package/templates/common/workflow/essential/en/agents/init-architect.md +115 -0
  50. package/templates/common/workflow/essential/en/agents/planner.md +116 -0
  51. package/templates/common/workflow/essential/en/agents/teamagent.md +102 -0
  52. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +91 -0
  53. package/templates/common/workflow/essential/en/feat.md +92 -0
  54. package/templates/common/workflow/essential/en/init-project.md +53 -0
  55. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +29 -0
  56. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +115 -0
  57. package/templates/common/workflow/essential/zh-CN/agents/planner.md +116 -0
  58. package/templates/common/workflow/essential/zh-CN/agents/teamagent.md +102 -0
  59. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +91 -0
  60. package/templates/common/workflow/essential/zh-CN/feat.md +315 -0
  61. package/templates/common/workflow/essential/zh-CN/init-project.md +53 -0
  62. package/templates/common/workflow/interview/en/interview.md +67 -0
  63. package/templates/common/workflow/interview/zh-CN/interview.md +67 -0
  64. package/templates/common/workflow/linearMethod/en/linear-method.md +651 -0
  65. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +750 -0
  66. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +516 -0
  67. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +810 -0
  68. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +364 -0
  69. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +364 -0
@@ -0,0 +1,275 @@
1
+ # /bmad-init 命令
2
+
3
+ 此命令在您的项目中初始化或更新 BMad-Method (V6)。
4
+
5
+ ## 当调用此命令时:
6
+
7
+ 1. 检查 `_bmad/` 目录是否存在,判断 BMad V6 是否已安装
8
+ 2. 检查是否存在旧版 V4 安装(`.bmad-core` 或 `.bmad-method` 目录)
9
+ 3. 新安装执行:`npx bmad-method install --directory . --modules bmm --tools claude-code --communication-language Chinese --document-output-language Chinese --yes`
10
+ 4. 已安装则执行:`npx bmad-method install --directory . --action quick-update --yes`
11
+ 5. 修复安装器 bug:将 `{output_folder}` 重命名为 `_bmad-output`(Beta 已知问题)
12
+ 6. 自动更新 `.gitignore`(移除 V4 条目,添加 V6 条目)
13
+ 7. 显示安装结果并提示用户后续操作
14
+
15
+ ## 实现
16
+
17
+ ```javascript
18
+ const { execSync } = require('node:child_process')
19
+ const fs = require('node:fs')
20
+ const path = require('node:path')
21
+
22
+ // 需要从 .gitignore 清理的旧条目
23
+ const LEGACY_GITIGNORE_ENTRIES = [
24
+ '.bmad-core',
25
+ '.bmad-method',
26
+ '.claude/commands/BMad',
27
+ '{output_folder}', // v6.0.0-Beta.8 bug 产物
28
+ ]
29
+
30
+ // V6 新版 .gitignore 条目
31
+ const V6_GITIGNORE_ENTRIES = [
32
+ '_bmad/',
33
+ '_bmad-output/',
34
+ ]
35
+
36
+ // 修复安装器 bug: {output_folder} 未解析为 _bmad-output (v6.0.0-Beta.8)
37
+ function fixOutputFolderBug(cwd) {
38
+ const buggyPath = path.join(cwd, '{output_folder}')
39
+ const correctPath = path.join(cwd, '_bmad-output')
40
+
41
+ if (!fs.existsSync(buggyPath)) return false
42
+
43
+ if (!fs.existsSync(correctPath)) {
44
+ // _bmad-output 不存在,直接重命名
45
+ fs.renameSync(buggyPath, correctPath)
46
+ console.log(' ✅ {output_folder} → _bmad-output/ (重命名)')
47
+ } else {
48
+ // _bmad-output 已存在,合并子目录后删除
49
+ const entries = fs.readdirSync(buggyPath, { withFileTypes: true })
50
+ for (const entry of entries) {
51
+ const src = path.join(buggyPath, entry.name)
52
+ const dest = path.join(correctPath, entry.name)
53
+ if (!fs.existsSync(dest)) {
54
+ fs.renameSync(src, dest)
55
+ console.log(` ✅ 移动 ${entry.name} → _bmad-output/`)
56
+ }
57
+ }
58
+ fs.rmSync(buggyPath, { recursive: true, force: true })
59
+ console.log(' ✅ 已删除多余的 {output_folder}/')
60
+ }
61
+ return true
62
+ }
63
+
64
+ function updateGitignore(cwd) {
65
+ const gitignorePath = path.join(cwd, '.gitignore')
66
+ let content = ''
67
+ let exists = false
68
+
69
+ if (fs.existsSync(gitignorePath)) {
70
+ content = fs.readFileSync(gitignorePath, 'utf8')
71
+ exists = true
72
+ }
73
+
74
+ const lines = content.split('\n')
75
+ let changed = false
76
+
77
+ // 移除 V4 旧条目
78
+ const filtered = lines.filter(line => {
79
+ const trimmed = line.trim()
80
+ const isLegacy = LEGACY_GITIGNORE_ENTRIES.some(entry =>
81
+ trimmed === entry || trimmed === entry + '/' || trimmed === '/' + entry
82
+ )
83
+ if (isLegacy) {
84
+ console.log(` 🗑️ 移除旧条目: ${trimmed}`)
85
+ changed = true
86
+ }
87
+ return !isLegacy
88
+ })
89
+
90
+ // 添加 V6 新条目
91
+ const newEntries = []
92
+ for (const entry of V6_GITIGNORE_ENTRIES) {
93
+ const entryBase = entry.replace(/\/$/, '')
94
+ const alreadyExists = filtered.some(line => {
95
+ const trimmed = line.trim()
96
+ return trimmed === entry || trimmed === entryBase || trimmed === '/' + entryBase
97
+ })
98
+ if (!alreadyExists) {
99
+ newEntries.push(entry)
100
+ console.log(` ✅ 添加新条目: ${entry}`)
101
+ changed = true
102
+ }
103
+ }
104
+
105
+ if (!changed) {
106
+ console.log(' ℹ️ .gitignore 已是最新,无需更新')
107
+ return
108
+ }
109
+
110
+ // 构建新内容
111
+ let result = filtered.join('\n')
112
+
113
+ if (newEntries.length > 0) {
114
+ // 确保末尾有换行,然后添加 BMad 区块
115
+ if (result.length > 0 && !result.endsWith('\n')) {
116
+ result += '\n'
117
+ }
118
+ result += '\n# BMad Method V6\n'
119
+ result += newEntries.join('\n') + '\n'
120
+ }
121
+
122
+ fs.writeFileSync(gitignorePath, result, 'utf8')
123
+ console.log(` 📝 .gitignore 已${exists ? '更新' : '创建'}`)
124
+ }
125
+
126
+ async function initBmad() {
127
+ const cwd = process.cwd()
128
+ const bmadV6Path = path.join(cwd, '_bmad')
129
+ const legacyCorePath = path.join(cwd, '.bmad-core')
130
+ const legacyMethodPath = path.join(cwd, '.bmad-method')
131
+
132
+ // 检查旧版 V4 安装
133
+ const hasLegacyCore = fs.existsSync(legacyCorePath)
134
+ const hasLegacyMethod = fs.existsSync(legacyMethodPath)
135
+
136
+ if (hasLegacyCore || hasLegacyMethod) {
137
+ console.log('⚠️ 检测到旧版 BMad V4 安装:')
138
+ if (hasLegacyCore) console.log(' • .bmad-core/ (V4 核心目录)')
139
+ if (hasLegacyMethod) console.log(' • .bmad-method/ (V4 方法目录)')
140
+ console.log('')
141
+ console.log('📌 V6 安装器会自动处理旧版迁移,请在安装过程中按提示操作。')
142
+ console.log(' 详情参考:https://bmad-code-org.github.io/BMAD-METHOD/docs/how-to/upgrade-to-v6')
143
+ console.log('')
144
+ }
145
+
146
+ // 检查 V6 是否已安装
147
+ const hasV6 = fs.existsSync(bmadV6Path)
148
+
149
+ // 构建非交互式安装命令
150
+ let installCmd
151
+ if (hasV6) {
152
+ console.log('🔄 检测到已有 BMad V6 安装,将执行快速更新...')
153
+ console.log('')
154
+ installCmd = [
155
+ 'npx bmad-method install',
156
+ '--directory .',
157
+ '--action quick-update',
158
+ '--yes',
159
+ ].join(' ')
160
+ } else {
161
+ console.log('🚀 正在初始化 BMad-Method V6...')
162
+ console.log('')
163
+ installCmd = [
164
+ 'npx bmad-method install',
165
+ '--directory .',
166
+ '--modules bmm',
167
+ '--tools claude-code',
168
+ '--communication-language Chinese',
169
+ '--document-output-language Chinese',
170
+ '--yes',
171
+ ].join(' ')
172
+ }
173
+
174
+ // 执行安装
175
+ try {
176
+ console.log(`📋 执行: ${installCmd}`)
177
+ console.log('')
178
+ execSync(installCmd, {
179
+ stdio: 'inherit',
180
+ cwd: cwd,
181
+ shell: true
182
+ })
183
+
184
+ console.log('')
185
+ console.log('✅ BMad-Method V6 安装/更新完成!')
186
+ console.log('')
187
+ console.log('═══════════════════════════════════════════════════════════════')
188
+ console.log('📌 重要提示:请重启 AI IDE 以加载 BMad 扩展')
189
+ console.log('═══════════════════════════════════════════════════════════════')
190
+ console.log('')
191
+ // 修复 {output_folder} bug (v6.0.0-Beta.8)
192
+ console.log('🔧 检查安装器已知问题...')
193
+ try {
194
+ const fixed = fixOutputFolderBug(cwd)
195
+ if (!fixed) console.log(' ℹ️ 无需修复')
196
+ } catch (err) {
197
+ console.log(` ⚠️ 修复 {output_folder} 失败: ${err.message}`)
198
+ console.log(' 请手动将 {output_folder}/ 重命名为 _bmad-output/')
199
+ }
200
+ console.log('')
201
+
202
+ console.log('📂 V6 目录结构:')
203
+ console.log(' • _bmad/ — agents、workflows、tasks 和配置')
204
+ console.log(' • _bmad-output/ — 生成的工件输出目录')
205
+ console.log('')
206
+
207
+ // 自动更新 .gitignore
208
+ console.log('🔧 更新 .gitignore...')
209
+ try {
210
+ updateGitignore(cwd)
211
+ } catch (err) {
212
+ console.log(' ⚠️ 自动更新 .gitignore 失败,请手动添加 _bmad/ 和 _bmad-output/')
213
+ }
214
+ console.log('')
215
+ console.log('🚀 快速开始:')
216
+ console.log(' 1. 重启 AI IDE')
217
+ console.log(' 2. 运行 /bmad-help 获取引导和下一步建议')
218
+ console.log(' 3. 输入 /bmad 并使用自动补全浏览可用命令')
219
+ console.log('')
220
+ console.log('💡 常用工作流:')
221
+ console.log(' • /bmad-help — 交互式帮助')
222
+ console.log(' • /bmad-bmm-create-prd — 创建产品需求文档')
223
+ console.log(' • /bmad-bmm-create-architecture — 创建架构文档')
224
+ console.log(' • /bmad-bmm-create-epics-and-stories — 创建史诗和用户故事')
225
+ console.log(' • /bmad-bmm-sprint-planning — 初始化 Sprint 计划')
226
+ console.log(' • /bmad-bmm-dev-story — 实现用户故事')
227
+
228
+ // 清理旧版 V4 IDE 命令提醒
229
+ const legacyClaudeAgents = path.join(cwd, '.claude', 'commands', 'BMad', 'agents')
230
+ const legacyClaudeTasks = path.join(cwd, '.claude', 'commands', 'BMad', 'tasks')
231
+ if (fs.existsSync(legacyClaudeAgents) || fs.existsSync(legacyClaudeTasks)) {
232
+ console.log('')
233
+ console.log('⚠️ 检测到旧版 V4 IDE 命令,建议手动删除:')
234
+ if (fs.existsSync(legacyClaudeAgents)) console.log(' • .claude/commands/BMad/agents/')
235
+ if (fs.existsSync(legacyClaudeTasks)) console.log(' • .claude/commands/BMad/tasks/')
236
+ console.log(' 新的 V6 命令已安装在 .claude/commands/bmad/ 下')
237
+ }
238
+ }
239
+ catch (error) {
240
+ console.error('❌ 安装失败:', error.message)
241
+ console.log('')
242
+ console.log('🛠️ 手动安装指南:')
243
+ console.log(' 1. 确保已安装 Node.js 20+')
244
+ console.log(' 2. 非交互式安装:')
245
+ console.log(' npx bmad-method install --directory . --modules bmm --tools claude-code --communication-language Chinese --document-output-language Chinese --yes')
246
+ console.log(' 3. 快速更新已有安装:')
247
+ console.log(' npx bmad-method install --directory . --action quick-update --yes')
248
+ console.log(' 4. 或交互式安装:')
249
+ console.log(' npx bmad-method install')
250
+ console.log('')
251
+ console.log('📖 详细文档:')
252
+ console.log(' https://bmad-code-org.github.io/BMAD-METHOD/docs/how-to/install-bmad')
253
+ }
254
+ }
255
+
256
+ // 执行初始化
257
+ initBmad()
258
+ ```
259
+
260
+ ## 用法
261
+
262
+ 只需在 Claude Code 中键入:
263
+
264
+ ```
265
+ /bmad-init
266
+ ```
267
+
268
+ 此命令将:
269
+
270
+ 1. 检测现有安装状态(V6 / V4 旧版 / 未安装)
271
+ 2. 新安装:`npx bmad-method install --directory . --modules bmm --tools claude-code --communication-language Chinese --document-output-language Chinese --yes`
272
+ 3. 已安装:`npx bmad-method install --directory . --action quick-update --yes`
273
+ 4. 修复 `{output_folder}` → `_bmad-output` 安装器 bug
274
+ 5. 自动更新 `.gitignore`(清理旧条目,添加 V6 条目)
275
+ 6. 提供后续步骤建议
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: PR-grade code review - regressions, edge cases, maintainability (OpenAI /review practice)
3
+ argument-hint: [--uncommitted] [--base <branch>] [--commit <sha>]
4
+ ---
5
+
6
+ # Code Review Workflow
7
+
8
+ > Based on [Codex Best Practices](https://developers.openai.com/codex/learn/best-practices) and `/review`: review uncommitted changes, a commit, or diff vs a base branch.
9
+
10
+ ## Scope
11
+
12
+ Pick by flags:
13
+
14
+ - Default: uncommitted changes
15
+ - `--base main`: PR-style vs main
16
+ - `--commit <sha>`: single commit
17
+
18
+ ## Checklist
19
+
20
+ 1. **Correctness** — Meets requirements? Edge and error paths?
21
+ 2. **Regression** — Breaks behavior or tests? Callers updated?
22
+ 3. **Tests** — New logic covered? Only happy path?
23
+ 4. **Security** — Injection, auth, secrets, dangerous commands, data leaks.
24
+ 5. **Maintainability** — Naming, single responsibility, duplication, over-abstraction.
25
+ 6. **Diff size** — Could be smaller? Unrelated churn?
26
+
27
+ ## Output
28
+
29
+ - **Summary** — One-line verdict (merge / fix required / discuss)
30
+ - **Blocking** — Must-fix items with file:line
31
+ - **Suggestions** — Non-blocking improvements
32
+ - **Verified** — Tests/commands run (if any)
33
+
34
+ Do not edit code unless the user asks to review and fix.
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: PR 级代码审查工作流 - 对照 diff 查回归、边界与可维护性(OpenAI /review 实践)
3
+ argument-hint: [--uncommitted] [--base <branch>] [--commit <sha>]
4
+ ---
5
+
6
+ # Code Review 工作流
7
+
8
+ > 参考 [Codex Best Practices](https://developers.openai.com/codex/learn/best-practices) 与 `/review`:审查未提交改动、指定 commit 或相对 base 分支的 diff。
9
+
10
+ ## 审查范围
11
+
12
+ 根据参数选择:
13
+
14
+ - 默认:当前未提交改动
15
+ - `--base main`:相对主分支的 PR 式审查
16
+ - `--commit <sha>`:单 commit 审查
17
+
18
+ ## 审查清单
19
+
20
+ 1. **正确性**:逻辑是否满足需求?边界与错误路径是否处理?
21
+ 2. **回归**:是否破坏现有行为或测试?调用方是否需同步修改?
22
+ 3. **测试**:新逻辑是否有测试?是否只测了 happy path?
23
+ 4. **安全**:注入、权限、密钥、危险命令、数据泄露风险。
24
+ 5. **可维护性**:命名、职责单一、重复代码、过度抽象。
25
+ 6. **Diff 规模**:是否可做更小步?有无无关改动?
26
+
27
+ ## 输出格式
28
+
29
+ - **Summary**:一句话结论(可合并 / 需修改 / 需讨论)
30
+ - **Blocking**:必须修的问题(附文件与行号)
31
+ - **Suggestions**:非阻塞改进
32
+ - **Verified**:已检查的测试/命令(若运行过)
33
+
34
+ 不自动改代码,除非用户明确要求「审查并修复」。