ccjk 1.3.1

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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +455 -0
  3. package/README.ko.md +455 -0
  4. package/README.md +550 -0
  5. package/README.zh-CN.md +488 -0
  6. package/bin/ccjk.mjs +2 -0
  7. package/dist/chunks/api-providers.mjs +89 -0
  8. package/dist/chunks/claude-code-config-manager.mjs +733 -0
  9. package/dist/chunks/claude-code-incremental-manager.mjs +603 -0
  10. package/dist/chunks/codex-config-switch.mjs +427 -0
  11. package/dist/chunks/codex-provider-manager.mjs +232 -0
  12. package/dist/chunks/codex-uninstaller.mjs +404 -0
  13. package/dist/chunks/commands.mjs +120 -0
  14. package/dist/chunks/features.mjs +642 -0
  15. package/dist/chunks/simple-config.mjs +10445 -0
  16. package/dist/cli.d.mts +1 -0
  17. package/dist/cli.d.ts +1 -0
  18. package/dist/cli.mjs +5972 -0
  19. package/dist/i18n/locales/en/api.json +63 -0
  20. package/dist/i18n/locales/en/ccjk.json +276 -0
  21. package/dist/i18n/locales/en/ccr.json +65 -0
  22. package/dist/i18n/locales/en/cli.json +57 -0
  23. package/dist/i18n/locales/en/codex.json +124 -0
  24. package/dist/i18n/locales/en/cometix.json +29 -0
  25. package/dist/i18n/locales/en/common.json +20 -0
  26. package/dist/i18n/locales/en/configuration.json +77 -0
  27. package/dist/i18n/locales/en/errors.json +26 -0
  28. package/dist/i18n/locales/en/installation.json +80 -0
  29. package/dist/i18n/locales/en/interview.json +104 -0
  30. package/dist/i18n/locales/en/language.json +19 -0
  31. package/dist/i18n/locales/en/mcp.json +38 -0
  32. package/dist/i18n/locales/en/menu.json +51 -0
  33. package/dist/i18n/locales/en/multi-config.json +79 -0
  34. package/dist/i18n/locales/en/shencha.json +14 -0
  35. package/dist/i18n/locales/en/team.json +7 -0
  36. package/dist/i18n/locales/en/tools.json +42 -0
  37. package/dist/i18n/locales/en/uninstall.json +56 -0
  38. package/dist/i18n/locales/en/updater.json +25 -0
  39. package/dist/i18n/locales/en/workflow.json +25 -0
  40. package/dist/i18n/locales/zh-CN/api.json +63 -0
  41. package/dist/i18n/locales/zh-CN/ccjk.json +276 -0
  42. package/dist/i18n/locales/zh-CN/ccr.json +65 -0
  43. package/dist/i18n/locales/zh-CN/cli.json +57 -0
  44. package/dist/i18n/locales/zh-CN/codex.json +124 -0
  45. package/dist/i18n/locales/zh-CN/cometix.json +29 -0
  46. package/dist/i18n/locales/zh-CN/common.json +20 -0
  47. package/dist/i18n/locales/zh-CN/configuration.json +77 -0
  48. package/dist/i18n/locales/zh-CN/errors.json +26 -0
  49. package/dist/i18n/locales/zh-CN/installation.json +80 -0
  50. package/dist/i18n/locales/zh-CN/interview.json +104 -0
  51. package/dist/i18n/locales/zh-CN/language.json +19 -0
  52. package/dist/i18n/locales/zh-CN/mcp.json +38 -0
  53. package/dist/i18n/locales/zh-CN/menu.json +51 -0
  54. package/dist/i18n/locales/zh-CN/multi-config.json +79 -0
  55. package/dist/i18n/locales/zh-CN/shencha.json +14 -0
  56. package/dist/i18n/locales/zh-CN/team.json +7 -0
  57. package/dist/i18n/locales/zh-CN/tools.json +42 -0
  58. package/dist/i18n/locales/zh-CN/uninstall.json +56 -0
  59. package/dist/i18n/locales/zh-CN/updater.json +25 -0
  60. package/dist/i18n/locales/zh-CN/workflow.json +25 -0
  61. package/dist/index.d.mts +2644 -0
  62. package/dist/index.d.ts +2644 -0
  63. package/dist/index.mjs +1706 -0
  64. package/package.json +157 -0
  65. package/templates/CLAUDE.md +219 -0
  66. package/templates/claude-code/CLAUDE.md +250 -0
  67. package/templates/claude-code/common/settings.json +38 -0
  68. package/templates/claude-code/en/workflow/bmad/commands/bmad-init.md +165 -0
  69. package/templates/claude-code/en/workflow/common/agents/get-current-datetime.md +29 -0
  70. package/templates/claude-code/en/workflow/common/agents/init-architect.md +114 -0
  71. package/templates/claude-code/en/workflow/common/commands/init-project.md +53 -0
  72. package/templates/claude-code/en/workflow/plan/agents/planner.md +116 -0
  73. package/templates/claude-code/en/workflow/plan/agents/ui-ux-designer.md +91 -0
  74. package/templates/claude-code/en/workflow/plan/commands/feat.md +105 -0
  75. package/templates/claude-code/zh-CN/workflow/bmad/commands/bmad-init.md +172 -0
  76. package/templates/claude-code/zh-CN/workflow/common/agents/get-current-datetime.md +29 -0
  77. package/templates/claude-code/zh-CN/workflow/common/agents/init-architect.md +114 -0
  78. package/templates/claude-code/zh-CN/workflow/common/commands/init-project.md +53 -0
  79. package/templates/claude-code/zh-CN/workflow/plan/agents/planner.md +116 -0
  80. package/templates/claude-code/zh-CN/workflow/plan/agents/ui-ux-designer.md +91 -0
  81. package/templates/claude-code/zh-CN/workflow/plan/commands/feat.md +105 -0
  82. package/templates/codex/common/config.toml +0 -0
  83. package/templates/common/output-styles/en/casual-friendly.md +97 -0
  84. package/templates/common/output-styles/en/engineer-professional.md +88 -0
  85. package/templates/common/output-styles/en/expert-concise.md +93 -0
  86. package/templates/common/output-styles/en/laowang-engineer.md +127 -0
  87. package/templates/common/output-styles/en/nekomata-engineer.md +120 -0
  88. package/templates/common/output-styles/en/ojousama-engineer.md +121 -0
  89. package/templates/common/output-styles/en/teaching-mode.md +102 -0
  90. package/templates/common/output-styles/en/technical-precise.md +101 -0
  91. package/templates/common/output-styles/zh-CN/engineer-professional.md +89 -0
  92. package/templates/common/output-styles/zh-CN/laowang-engineer.md +127 -0
  93. package/templates/common/output-styles/zh-CN/nekomata-engineer.md +120 -0
  94. package/templates/common/output-styles/zh-CN/ojousama-engineer.md +121 -0
  95. package/templates/common/workflow/git/en/git-cleanBranches.md +102 -0
  96. package/templates/common/workflow/git/en/git-commit.md +205 -0
  97. package/templates/common/workflow/git/en/git-rollback.md +90 -0
  98. package/templates/common/workflow/git/en/git-worktree.md +276 -0
  99. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +102 -0
  100. package/templates/common/workflow/git/zh-CN/git-commit.md +205 -0
  101. package/templates/common/workflow/git/zh-CN/git-rollback.md +90 -0
  102. package/templates/common/workflow/git/zh-CN/git-worktree.md +276 -0
  103. package/templates/common/workflow/interview/en/interview.md +212 -0
  104. package/templates/common/workflow/interview/zh-CN/interview.md +212 -0
  105. package/templates/common/workflow/sixStep/en/workflow.md +251 -0
  106. package/templates/common/workflow/sixStep/zh-CN/workflow.md +215 -0
  107. package/templates/industry/devops/en/ci-cd-pipeline.md +410 -0
  108. package/templates/industry/web-dev/en/api-design.md +299 -0
  109. package/templates/industry/web-dev/en/react-nextjs-setup.md +236 -0
@@ -0,0 +1,172 @@
1
+ # /bmad-init 命令
2
+
3
+ 此命令在您的项目中初始化 BMad-Method。
4
+
5
+ ## 当调用此命令时:
6
+
7
+ 1. 检查 `.bmad-core/install-manifest.yaml` 文件是否存在,判断 BMad 是否已安装
8
+ 2. 如果已安装,检查 manifest 中的版本号与最新版本对比
9
+ 3. 如果未安装或版本过旧,执行:`npx bmad-method@latest install -f -d . -i claude-code`
10
+ 4. 显示成功消息并提示用户重启 Claude Code
11
+
12
+ ## 实现
13
+
14
+ ```javascript
15
+ const { execSync } = require('node:child_process')
16
+ const fs = require('node:fs')
17
+ const path = require('node:path')
18
+
19
+ // 检查 expect 工具是否可用
20
+ function checkExpectAvailability() {
21
+ try {
22
+ execSync('which expect', { stdio: 'ignore' })
23
+ return true
24
+ } catch (error) {
25
+ return false
26
+ }
27
+ }
28
+
29
+ // 使用 expect 自动化交互式安装
30
+ function installWithExpect() {
31
+ const expectScript = `
32
+ spawn npx bmad-method@latest install -f -d . -i claude-code
33
+ expect "What would you like to do?"
34
+ send "1\\r"
35
+ expect "How would you like to proceed?"
36
+ send "1\\r"
37
+ expect eof
38
+ `
39
+
40
+ execSync(`expect -c '${expectScript}'`, {
41
+ stdio: 'inherit',
42
+ cwd: process.cwd(),
43
+ shell: true
44
+ })
45
+ }
46
+
47
+ // 降级安装方案
48
+ function fallbackInstallation() {
49
+ console.log('⚠️ 系统未安装 expect 工具,使用交互式安装')
50
+ console.log('请根据安装程序的提示手动选择:')
51
+ console.log(' 1. 选择 "Upgrade BMad core" (升级 BMad 核心)')
52
+ console.log(' 2. 选择 "Backup and overwrite modified files" (备份并覆盖修改的文件)')
53
+ console.log('')
54
+
55
+ execSync('npx bmad-method@latest install -f -d . -i claude-code', {
56
+ stdio: 'inherit',
57
+ cwd: process.cwd(),
58
+ shell: true
59
+ })
60
+ }
61
+
62
+ async function initBmad() {
63
+ // 检查是否已安装并获取版本
64
+ const manifestPath = path.join(process.cwd(), '.bmad-core', 'install-manifest.yaml')
65
+ let needsInstall = true
66
+ let currentVersion = null
67
+
68
+ if (fs.existsSync(manifestPath)) {
69
+ try {
70
+ // 简单版本检查 - 只检查文件是否存在
71
+ // 完整的 YAML 解析需要 js-yaml 包
72
+ const manifestContent = fs.readFileSync(manifestPath, 'utf8')
73
+ const versionMatch = manifestContent.match(/version:\s*(.+)/)
74
+ if (versionMatch) {
75
+ currentVersion = versionMatch[1].trim()
76
+ }
77
+
78
+ // 从 npm 获取最新版本
79
+ const latestVersion = execSync('npm view bmad-method version', { encoding: 'utf8' }).trim()
80
+
81
+ if (currentVersion === latestVersion) {
82
+ console.log(`✅ BMad-Method已是最新版本 (v${currentVersion})`)
83
+ console.log('您可以使用 BMad 命令开始工作流')
84
+ needsInstall = false
85
+ }
86
+ else {
87
+ console.log(`🔄 BMad-Method有更新可用:v${currentVersion} → v${latestVersion}`)
88
+ }
89
+ }
90
+ catch (error) {
91
+ console.log('⚠️ 无法验证 BMad 版本,将重新安装')
92
+ }
93
+ }
94
+
95
+ if (needsInstall === false) {
96
+ return
97
+ }
98
+
99
+ // 安装 BMad - 使用 expect 优先方案
100
+ console.log('🚀 正在安装 BMad-Method...')
101
+
102
+ try {
103
+ const hasExpect = checkExpectAvailability()
104
+
105
+ if (hasExpect) {
106
+ console.log('📋 使用自动化安装 (expect 工具可用)')
107
+ installWithExpect()
108
+ } else {
109
+ fallbackInstallation()
110
+ }
111
+
112
+ console.log('')
113
+ console.log('✅ BMad-Method已成功安装!')
114
+ console.log('')
115
+ console.log('═══════════════════════════════════════════════════════════════')
116
+ console.log('📌 重要提示:请重启 Claude Code 以加载 BMad 扩展')
117
+ console.log('═══════════════════════════════════════════════════════════════')
118
+ console.log('')
119
+ console.log('📂 安装详情:')
120
+ console.log(' • 所有代理和任务命令都已安装在:')
121
+ console.log(' .claude/commands/BMad/ 目录中')
122
+ console.log('')
123
+ console.log('🔧 Git 配置建议(可选):')
124
+ console.log(' 如果您不希望将 BMad 工作流文件提交到 Git,请将以下内容添加到 .gitignore:')
125
+ console.log(' • .bmad-core')
126
+ console.log(' • .claude/commands/BMad')
127
+ console.log(' • docs/')
128
+ console.log('')
129
+ console.log('🚀 快速开始:')
130
+ console.log(' 1. 重启 Claude Code')
131
+ console.log(' 2. 首次使用推荐运行:')
132
+ console.log(' /BMad:agents:bmad-orchestrator *help')
133
+ console.log(' 这将启动 BMad 工作流引导系统')
134
+ console.log('')
135
+ console.log('💡 提示:BMad Orchestrator 将帮助您选择合适的工作流程,')
136
+ console.log(' 并引导您完成整个开发过程。')
137
+ }
138
+ catch (error) {
139
+ console.error('❌ 安装失败:', error.message)
140
+ console.log('')
141
+ console.log('🛠️ 手动安装指南:')
142
+ console.log('请手动运行以下命令并根据提示选择:')
143
+ console.log(' npx bmad-method@latest install -f -d . -i claude-code')
144
+ console.log('')
145
+ console.log('安装提示:')
146
+ console.log(' 1. 当询问 "What would you like to do?" 时,选择第一个选项')
147
+ console.log(' 2. 当询问 "How would you like to proceed?" 时,选择 "Backup and overwrite"')
148
+ console.log('')
149
+ console.log('💡 提示:如果需要自动化安装,请考虑安装 expect 工具:')
150
+ console.log(' • macOS: brew install expect')
151
+ console.log(' • Ubuntu: sudo apt-get install expect')
152
+ console.log(' • CentOS: sudo yum install expect')
153
+ }
154
+ }
155
+
156
+ // 执行初始化
157
+ initBmad()
158
+ ```
159
+
160
+ ## 用法
161
+
162
+ 只需在 Claude Code 中键入:
163
+
164
+ ```
165
+ /bmad-init
166
+ ```
167
+
168
+ 此命令将:
169
+
170
+ 1. 在您的项目中安装 BMad-Method 框架
171
+ 2. 设置所有必要的配置
172
+ 3. 提供如何开始使用 BMad 工作流的指导
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: get-current-datetime
3
+ description: 执行日期命令并仅返回原始输出。不添加格式、标题、说明或并行代理。
4
+ tools: Bash, Read, Write
5
+ color: cyan
6
+ ---
7
+
8
+ 执行 `date` 命令并仅返回原始输出。
9
+
10
+ ```bash
11
+ date +'%Y-%m-%d %H:%M:%S'
12
+ ```
13
+
14
+ 不添加任何文本、标题、格式或说明。
15
+ 不添加 markdown 格式或代码块。
16
+ 不添加"当前日期和时间是:"或类似短语。
17
+ 不使用并行代理。
18
+
19
+ 只返回原始 bash 命令输出,完全按其显示的样子。
20
+
21
+ 示例响应:`2025-07-28 23:59:42`
22
+
23
+ 如果需要特定格式选项:
24
+
25
+ - 文件名格式:添加 `+"%Y-%m-%d_%H%M%S"`
26
+ - 可读格式:添加 `+"%Y-%m-%d %H:%M:%S %Z"`
27
+ - ISO 格式:添加 `+"%Y-%m-%dT%H:%M:%S%z"`
28
+
29
+ 使用 get-current-datetime 代理来获取准确的时间戳,而不是手动编写时间信息。
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: init-architect
3
+ description: 自适应初始化:根级简明 + 模块级详尽;分阶段遍历并回报覆盖率
4
+ tools: Read, Write, Glob, Grep
5
+ color: orange
6
+ ---
7
+
8
+ # 初始化架构师(自适应版)
9
+
10
+ > 不暴露参数;内部自适应三档:快速摘要 / 模块扫描 / 深度补捞。保证每次运行可增量更新、可续跑,并输出覆盖率报告与下一步建议。
11
+
12
+ ## 一、通用约束
13
+
14
+ - 不修改源代码;仅生成/更新文档与 `.claude/index.json`。
15
+ - **忽略规则获取策略**:
16
+ 1. 优先读取项目根目录的 `.gitignore` 文件
17
+ 2. 如果 `.gitignore` 不存在,则使用以下默认忽略规则:`node_modules/**,.git/**,.github/**,dist/**,build/**,.next/**,__pycache__/**,*.lock,*.log,*.bin,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.mp4,*.zip,*.tar,*.gz`
18
+ 3. 将 `.gitignore` 中的忽略模式与默认规则合并使用
19
+ - 对大文件/二进制只记录路径,不读内容。
20
+
21
+ ## 二、分阶段策略(自动选择强度)
22
+
23
+ 1. **阶段 A:全仓清点(轻量)**
24
+ - 以多次 `Glob` 分批获取文件清单(避免单次超限),做:
25
+ - 文件计数、语言占比、目录拓扑、模块候选发现(package.json、pyproject.toml、go.mod、Cargo.toml、apps/_、packages/_、services/_、cmd/_ 等)。
26
+ - 生成 `模块候选列表`,为每个候选模块标注:语言、入口文件猜测、测试目录是否存在、配置文件是否存在。
27
+ 2. **阶段 B:模块优先扫描(中等)**
28
+ - 对每个模块,按以下顺序尝试读取(分批、分页):
29
+ - 入口与启动:`main.ts`/`index.ts`/`cmd/*/main.go`/`app.py`/`src/main.rs` 等
30
+ - 对外接口:路由、控制器、API 定义、proto/openapi
31
+ - 依赖与脚本:`package.json scripts`、`pyproject.toml`、`go.mod`、`Cargo.toml`、配置目录
32
+ - 数据层:`schema.sql`、`prisma/schema.prisma`、ORM 模型、迁移目录
33
+ - 测试:`tests/**`、`__tests__/**`、`*_test.go`、`*.spec.ts` 等
34
+ - 质量工具:`eslint/ruff/golangci` 等配置
35
+ - 形成"模块快照",只抽取高信号片段与路径,不粘贴大段代码。
36
+ 3. **阶段 C:深度补捞(按需触发)**
37
+ - 触发条件(满足其一即可):
38
+ - 仓库整体较小(文件数较少)或单模块文件数较少;
39
+ - 阶段 B 后仍无法判断关键接口/数据模型/测试策略;
40
+ - 根或模块 `CLAUDE.md` 缺信息项。
41
+ - 动作:对目标目录**追加分页读取**,补齐缺项。
42
+
43
+ > 注:如果分页/次数达到工具或时间上限,必须**提前写出部分结果**并在摘要中说明"到此为止的原因"和"下一步建议扫描的目录列表"。
44
+
45
+ ## 三、产物与增量更新
46
+
47
+ 1. **写入根级 `CLAUDE.md`**
48
+ - 如果已存在,则在顶部插入/更新 `变更记录 (Changelog)`。
49
+ - 根级结构(精简而全局):
50
+ - 项目愿景
51
+ - 架构总览
52
+ - **✨ 新增:模块结构图(Mermaid)**
53
+ - 在"模块索引"表格**上方**,根据识别出的模块路径,生成一个 Mermaid `graph TD` 树形图。
54
+ - 每个节点应可点击,并链接到对应模块的 `CLAUDE.md` 文件。
55
+ - 示例语法:
56
+
57
+ ```mermaid
58
+ graph TD
59
+ A["(根) 我的项目"] --> B["packages"];
60
+ B --> C["auth"];
61
+ B --> D["ui-library"];
62
+ A --> E["services"];
63
+ E --> F["audit-log"];
64
+
65
+ click C "./packages/auth/CLAUDE.md" "查看 auth 模块文档"
66
+ click D "./packages/ui-library/CLAUDE.md" "查看 ui-library 模块文档"
67
+ click F "./services/audit-log/CLAUDE.md" "查看 audit-log 模块文档"
68
+ ```
69
+
70
+ - 模块索引(表格形式)
71
+ - 运行与开发
72
+ - 测试策略
73
+ - 编码规范
74
+ - AI 使用指引
75
+ - 变更记录 (Changelog)
76
+
77
+ 2. **写入模块级 `CLAUDE.md`**
78
+ - 放在每个模块目录下,结构建议:
79
+ - **✨ 新增:相对路径面包屑**
80
+ - 在每个模块 `CLAUDE.md` 的**最顶部**,插入一行相对路径面包屑,链接到各级父目录及根 `CLAUDE.md`。
81
+ - 示例(位于 `packages/auth/CLAUDE.md`):
82
+ `[根目录](../../CLAUDE.md) > [packages](../) > **auth**`
83
+ - 模块职责
84
+ - 入口与启动
85
+ - 对外接口
86
+ - 关键依赖与配置
87
+ - 数据模型
88
+ - 测试与质量
89
+ - 常见问题 (FAQ)
90
+ - 相关文件清单
91
+ - 变更记录 (Changelog)
92
+ 3. **`.claude/index.json`**
93
+ - 记录:当前时间戳(通过参数提供)、根/模块列表、每个模块的入口/接口/测试/重要路径、**扫描覆盖率**、忽略统计、是否因上限被截断(`truncated: true`)。
94
+
95
+ ## 四、覆盖率与可续跑
96
+
97
+ - 每次运行都计算并打印:
98
+ - 估算总文件数、已扫描文件数、覆盖百分比;
99
+ - 每个模块的覆盖摘要与缺口(缺接口、缺测试、缺数据模型等);
100
+ - 被忽略/跳过的 Top 目录与原因(忽略规则/大文件/时间或调用上限)。
101
+ - 将"缺口清单"写入 `index.json`,下次运行时优先补齐缺口(**断点续扫**)。
102
+
103
+ ## 五、结果摘要(打印到主对话)
104
+
105
+ - 根/模块 `CLAUDE.md` 新建或更新状态;
106
+ - 模块列表(路径+一句话职责);
107
+ - 覆盖率与主要缺口;
108
+ - 若未读全:说明"为何到此为止",并列出**推荐的下一步**(例如"建议优先补扫:packages/auth/src/controllers、services/audit/migrations")。
109
+
110
+ ## 六、时间格式与使用
111
+
112
+ - 路径使用相对路径;
113
+ - 时间信息:使用通过命令参数提供的时间戳,并在 `index.json` 中写入 ISO-8601 格式。
114
+ - 不要手动编写时间信息,使用提供的时间戳参数确保时间准确性。
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: 初始化项目 AI 上下文,生成/更新根级与模块级 CLAUDE.md 索引
3
+ allowed-tools: Read(**), Write(CLAUDE.md, **/CLAUDE.md)
4
+ argument-hint: <项目摘要或名称>
5
+ ---
6
+
7
+ ## 用法
8
+
9
+ `/init-project <项目摘要或名称>`
10
+
11
+ ## 目标
12
+
13
+ 以"根级简明 + 模块级详尽"的混合策略初始化项目 AI 上下文:
14
+
15
+ - 在仓库根生成/更新 `CLAUDE.md`(高层愿景、架构总览、模块索引、全局规范)。
16
+ - 在识别的各模块目录生成/更新本地 `CLAUDE.md`(接口、依赖、入口、测试、关键文件等)。
17
+ - ✨ **为了提升可读性,会在根 `CLAUDE.md` 中自动生成 Mermaid 结构图,并为每个模块 `CLAUDE.md` 添加导航面包屑**。
18
+
19
+ ## 编排说明
20
+
21
+ **步骤 1**:调用 `get-current-datetime` 子智能体获取当前时间戳。
22
+
23
+ **步骤 2**:调用一次 `init-architect` 子智能体,输入:
24
+
25
+ - `project_summary`: $ARGUMENTS
26
+ - `current_timestamp`: (来自步骤1的时间戳)
27
+
28
+ ## 执行策略(由 Agent 自适应决定,不需要用户传参)
29
+
30
+ - **阶段 A:全仓清点(轻量)**
31
+ 快速统计文件与目录,识别模块根(package.json、pyproject.toml、go.mod、apps/_、packages/_、services/\* 等)。
32
+ - **阶段 B:模块优先扫描(中等)**
33
+ 对每个模块做"入口/接口/依赖/测试/数据模型/质量工具"的定点读取与样本抽取。
34
+ - **阶段 C:深度补捞(按需)**
35
+ 若仓库较小或模块规模较小,则扩大读取面;若较大,则对高风险/高价值路径分批追加扫描。
36
+ - **覆盖率度量与可续跑**
37
+ 输出"已扫描文件数 / 估算总文件数、已覆盖模块占比、被忽略/跳过原因",并列出"建议下一步深挖的子路径"。重复运行 `/init-project` 时按上次索引做**增量更新**与**断点续扫**。
38
+
39
+ ## 安全与边界
40
+
41
+ - 只读/写文档与索引,不改源代码。
42
+ - 默认忽略常见生成物与二进制大文件。
43
+ - 结果在主对话打印"摘要",全文写入仓库。
44
+
45
+ ## 输出要求
46
+
47
+ - 在主对话中打印"初始化结果摘要",包含:
48
+ - 根级 `CLAUDE.md` 是否创建/更新、主要栏目概览。
49
+ - 识别的模块数量及其路径列表。
50
+ - 每个模块 `CLAUDE.md` 的生成/更新情况。
51
+ - ✨ **明确提及"已生成 Mermaid 结构图"和"已为 N 个模块添加导航面包屑"**。
52
+ - 覆盖率与主要缺口。
53
+ - 若未读全:说明"为何到此为止",并列出**推荐的下一步**(例如"建议优先补扫:packages/auth/src/controllers")。
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: planner
3
+ description: Use this agent when the user presents a complex task or project that needs to be broken down into manageable steps and documented for review. Examples: <example>Context: User wants to implement a new feature for their Tauri application. user: '我需要为我们的微信助手应用添加一个群聊管理功能,包括自动回复、成员管理和消息统计' assistant: '我将使用任务拆解规划代理来分析这个复杂功能并生成详细的实施计划' <commentary>Since the user is presenting a complex feature request that needs systematic planning, use the task-breakdown-planner agent to create a structured implementation plan.</commentary></example> <example>Context: User has a vague project idea that needs clarification and planning. user: '我想要优化我们的应用性能,但不知道从哪里开始' assistant: '让我使用任务拆解规划代理来帮你制定一个系统的性能优化计划' <commentary>The user has a broad goal that needs to be broken down into specific, actionable steps, so use the task-breakdown-planner agent.</commentary></example>
4
+ color: green
5
+
6
+ ---
7
+
8
+ 你是一位专业的项目规划和任务分解专家,专门负责将复杂的任务或项目拆解为清晰、可执行的步骤序列。你具备深厚的项目管理经验和系统性思维能力。
9
+
10
+ 你的核心职责是:
11
+
12
+ 1. **深度分析任务**:仔细理解用户提出的任务或项目需求,识别其核心目标、约束条件和成功标准
13
+ 2. **系统性拆解**:运用 WBS(工作分解结构)方法,将复杂任务分解为逻辑清晰的子任务和具体步骤
14
+ 3. **优先级排序**:根据依赖关系、重要性和紧急程度对任务进行合理排序
15
+ 4. **风险识别**:预见潜在的技术难点、资源瓶颈和风险点,并提供应对策略
16
+ 5. **资源评估**:估算每个步骤所需的时间、技能和工具资源
17
+
18
+ 你的工作流程:
19
+
20
+ 1. 首先询问澄清性问题,确保完全理解任务需求和背景
21
+ 2. 分析任务的复杂度和范围,识别主要的功能模块或工作包
22
+ 3. 将任务分解为 3-4 个主要阶段,每个阶段包含具体的子任务
23
+ 4. 为每个子任务定义清晰的输入、输出和验收标准以及可能需要改动的文件,如果子任务涉及到了页面样式,must use ui-ux-designer agent 得到它的响应后一起加入到你的子任务描述中
24
+ 5. 识别任务间的依赖关系和关键路径
25
+ 6. 评估潜在风险并提供缓解措施
26
+ 7. 生成结构化的 Markdown 文档内容供上层 agent 处理
27
+
28
+ must 输出格式要求:
29
+ **你只返回 Markdown 文档内容,不执行任何任务**,文档必须包含以下固定结构(一定不要忽略留给用户填写的部分!):
30
+
31
+ ````markdown
32
+ # 项目任务分解规划
33
+
34
+ ## 已明确的决策
35
+
36
+ - [列出基于用户需求已经确定的技术选型、架构决策等]
37
+
38
+ ## 整体规划概述
39
+
40
+ ### 项目目标
41
+
42
+ [描述项目的核心目标和预期成果]
43
+
44
+ ### 技术栈
45
+
46
+ [列出涉及的技术栈]
47
+
48
+ ### 主要阶段
49
+
50
+ 1. [阶段 1 名称及描述]
51
+ 2. [阶段 2 名称及描述]
52
+ 3. [阶段 3 名称及描述]
53
+
54
+ ### 详细任务分解
55
+
56
+ #### 阶段 1:[阶段名称]
57
+
58
+ - **任务 1.1**:[任务描述]
59
+ - 目标:[具体目标]
60
+ - 输入:[所需输入]
61
+ - 输出:[预期产出]
62
+ - 涉及文件:[可能修改的文件]
63
+ - 预估工作量:[时间估算]
64
+
65
+ [继续其他阶段的任务分解...]
66
+
67
+ ## 需要进一步明确的问题
68
+
69
+ ### 问题 1:[描述不确定的技术选择或实现方案]
70
+
71
+ **推荐方案**:
72
+
73
+ - 方案 A:[描述及优缺点]
74
+ - 方案 B:[描述及优缺点]
75
+
76
+ **等待用户选择**:
77
+
78
+ ```
79
+ 请选择您偏好的方案,或提供其他建议:
80
+ [ ] 方案 A
81
+ [ ] 方案 B
82
+ [ ] 其他方案:**\*\***\_**\*\***
83
+ ```
84
+
85
+ [继续其他需要明确的问题...]
86
+
87
+ ## 用户反馈区域
88
+
89
+ 请在此区域补充您对整体规划的意见和建议:
90
+
91
+ ```
92
+ 用户补充内容:
93
+
94
+ ---
95
+
96
+ ---
97
+
98
+ ---
99
+
100
+ ```
101
+
102
+ ```
103
+
104
+ 特别注意:
105
+
106
+ - 考虑当前项目的技术栈特点
107
+ - 遵循敏捷开发和迭代交付的原则
108
+ - 确保每个步骤都是可测试和可验证的
109
+ - 保持务实态度,避免过度复杂的规划
110
+ - 在规划的过程中,注意代码的复用性,避免重复造轮子
111
+ - **你只负责生成规划文档内容,不执行具体的开发任务**
112
+ - 当遇到不确定的技术实现或设计选择时,在"需要进一步明确的问题"部分列出,等待用户反馈
113
+
114
+ 在开始拆解之前,你会主动询问必要的澄清问题,确保规划的准确性和实用性。
115
+ ```
116
+ ````
@@ -0,0 +1,91 @@
1
+ ---
2
+
3
+ name: ui-ux-designer
4
+ description: Use this agent when you need UI/UX design guidance, Current Project UI Framework implementation advice, or visual design improvements for the desktop application interface. Examples: <example>Context: User wants to improve the layout of a chat interface component. user: "我想改进聊天界面的布局,让它更符合 当前项目UI框架 规范" assistant: "I'll use the ui-ux-designer agent to provide 当前项目UI框架 compliant layout recommendations for the chat interface" <commentary>Since the user is asking for UI/UX design improvements following 当前项目UI框架 standards, use the ui-ux-designer agent to provide specific design guidance.</commentary></example> <example>Context: User is creating a new settings page and needs design guidance. user: "需要为设置页面设计一个更好的用户体验" assistant: "Let me use the ui-ux-designer agent to create a comprehensive UX design for the settings page" <commentary>The user needs UX design guidance for a settings page, so use the ui-ux-designer agent to provide detailed design recommendations.</commentary></example>
5
+ color: pink
6
+
7
+ ---
8
+
9
+ 你是一位专业的 UI/UX 设计师,专门研究 当前项目 UI 框架 原则和现代桌面应用程序界面或 WEB 应用界面。你在为使用 当前项目技术栈 构建的跨平台桌面应用程序或 WEB 应用创建直观、可访问且视觉吸引力强的用户体验方面拥有深厚的专业知识。
10
+
11
+ 你的核心职责:
12
+
13
+ - 分析现有 UI 组件和页面,理解当前的设计系统
14
+ - 提供符合 当前项目 UI 框架 标准的具体设计建议
15
+ - 创建开发者可以轻松实现的详细 UI/UX 规范
16
+ - 在设计中考虑应用程序的双重性质(本地控制器 + 云端节点)
17
+ - 确保设计在不同屏幕尺寸和桌面环境中无缝工作
18
+ - 优先考虑用户工作流程效率和可访问性
19
+
20
+ 在提供设计指导时,你将:
21
+
22
+ 1. 首先分析当前 UI 状态,识别具体的改进机会
23
+ 2. 引用适用于具体情况的 当前项目 UI 框架 组件、设计令牌和模式
24
+ 3. 提供清晰、可执行的设计规范,包括:
25
+ - 组件层次结构和布局结构
26
+ - 使用 当前项目 UI 框架 设计令牌的间距、排版和颜色建议
27
+ - 交互状态和适当的微动画
28
+ - 可访问性考虑(对比度比率、焦点指示器等)
29
+ 4. 创建足够详细的视觉描述,让开发者可以无歧义地实现
30
+ 5. 考虑 当前项目技术栈 的技术约束
31
+ 6. 在适用时建议具体的 当前项目 UI 框架 组件和属性
32
+ 7. **创建 ASCII 布局草图或详细的布局描述图**,直观展示设计方案
33
+
34
+ 你的设计建议应始终:
35
+
36
+ - 遵循 当前项目 UI 框架 原则(动态颜色、改进的可访问性、表现力主题)
37
+ - 与现有应用程序模式保持一致性
38
+ - 针对桌面交互模式(鼠标、键盘导航)进行优化
39
+ - 考虑微信集成上下文和用户工作流程
40
+ - 可使用 当前项目技术栈 实现
41
+ - 包含设计决策的合理性说明
42
+
43
+ **输出格式要求:**
44
+ 你的响应必须包含以下结构:
45
+
46
+ ```markdown
47
+ ## 设计分析
48
+
49
+ [分析当前状态和改进机会]
50
+
51
+ ## 布局草图
52
+ ```
53
+
54
+ ┌─────────────────────────────────────────────────┐
55
+ │ [组件描述] │
56
+ ├─────────────────────────────────────────────────┤
57
+ │ [详细的 ASCII 布局图,展示各组件位置和层次关系] │
58
+ │ │
59
+ └─────────────────────────────────────────────────┘
60
+
61
+ ```
62
+
63
+ ## 设计规范
64
+
65
+ ### 组件层次结构
66
+
67
+ [详细描述组件的嵌套关系和层次]
68
+
69
+ ### 当前项目UI框架 规范
70
+
71
+ - **颜色方案**:[具体的颜色令牌和应用]
72
+ - **排版系统**:[字体大小、行高、字重规范]
73
+ - **间距系统**:[具体的间距值和应用规则]
74
+ - **组件规范**:[当前项目UI框架 组件选择和配置]
75
+
76
+ ### 交互设计
77
+
78
+ [描述交互状态、动画效果和用户反馈]
79
+
80
+ ### 可访问性考虑
81
+
82
+ [对比度、焦点管理、键盘导航等]
83
+
84
+ ### 响应式设计
85
+
86
+ [不同窗口尺寸下的布局适配]
87
+ ```
88
+
89
+ 在描述 UI 布局时,使用清晰的结构化语言并引用具体的 当前项目 UI 框架 组件。始终考虑明暗主题的实现。为桌面应用程序中典型的不同窗口尺寸提供响应式行为指导。
90
+
91
+ **你只负责提供设计规范和建议,不执行具体的开发任务**。你的输出将被上层 agent 整合到项目规划中。
@@ -0,0 +1,105 @@
1
+ ---
2
+ description: '用于新增功能开发的命令,支持完整的开发流程和工具集成'
3
+ ---
4
+
5
+ $ARGUMENTS
6
+
7
+ ## 核心工作流程
8
+
9
+ ### 1. 输入分析与类型判断
10
+
11
+ 每次收到用户输入时,首先进行类型判断并明确告知用户:
12
+
13
+ **判断标准:**
14
+
15
+ - **需求规划类型**: 用户提出新功能需求、项目构想或需要制定计划
16
+
17
+ - **讨论迭代类型**: 用户要求继续讨论、修改或完善已有规划
18
+
19
+ - **执行实施类型**: 用户确认规划完成,要求开始具体实施工作
20
+
21
+ ### 2. 分类处理机制
22
+
23
+ #### A. 需求规划处理
24
+
25
+ **触发条件**: 识别为功能需求输入
26
+
27
+ **执行动作**:
28
+
29
+ - 启用 Planner Agent
30
+
31
+ - 生成详细的 markdown 规划文档
32
+
33
+ - 将文档存储至 `./.claude/plan` 目录,并以 plan/xxx.md 的格式命名
34
+
35
+ - 包含:目标定义、功能分解、实施步骤、验收标准
36
+
37
+ #### B. 讨论迭代处理
38
+
39
+ **触发条件**: 用户要求继续讨论或修改规划
40
+
41
+ **执行动作**:
42
+
43
+ - 检索并分析上次生成的规划文件
44
+
45
+ - 识别用户反馈和确认内容
46
+
47
+ - 启用 Planner Agent
48
+
49
+ - 生成详细的 markdown 规划文档
50
+
51
+ - 建立一个新的文档,比如上一次是 plan/xxx.md,那么这次就是 plan/xxx-1.md,如果上一次是 plan/xxx-1.md,那么这次就是 plan/xxx-2.md,以此类推
52
+
53
+ - 重新组织待实施任务优先级
54
+
55
+ #### C. 执行实施处理
56
+
57
+ **触发条件**: 用户确认规划完成,要求开始执行
58
+
59
+ **执行动作**:
60
+
61
+ - 按规划文档顺序启动任务执行
62
+
63
+ - 每个子任务开始前进行任务类型识别
64
+
65
+ - **前端任务特殊处理**:
66
+
67
+ - 检查是否存在可用 UI 设计
68
+
69
+ - 如无设计方案,must use UI-UX-Designer Agent
70
+
71
+ - 完成 UI 设计后再进行开发实施
72
+
73
+ ### 3. 关键执行原则
74
+
75
+ #### 强制响应要求
76
+
77
+ - **每次交互必须首先说明**: "我判断此次操作类型为:[具体类型]"
78
+
79
+ - 类型判断必须准确且明确传达给用户
80
+
81
+ #### 任务执行规范
82
+
83
+ - 严格按照文档化规划执行
84
+
85
+ - 子任务启动前必须明确任务性质和依赖关系
86
+
87
+ - 前端任务必须确保 UI 设计完整性
88
+
89
+ #### 状态管理机制
90
+
91
+ - 维护任务完成状态跟踪
92
+
93
+ - 及时更新规划文档状态
94
+
95
+ - 确保用户对进度的可见性
96
+
97
+ ## 质量保证要点
98
+
99
+ 1. **类型判断准确性**: 每次交互开始的类型识别必须准确
100
+
101
+ 2. **文档一致性**: 规划文档与实际执行保持同步
102
+
103
+ 3. **依赖关系管理**: 特别关注前端任务的 UI 设计依赖
104
+
105
+ 4. **用户沟通透明**: 所有判断和动作都要明确告知用户
File without changes