ccg-workflow 1.4.2 → 1.4.3
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.
- package/README.md +185 -427
- package/dist/cli.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://github.com/openai/openai-python)
|
|
11
11
|
[](https://ai.google.dev/)
|
|
12
12
|
|
|
13
|
-
> **最新版本 v1.4.2** - Windows MCP
|
|
13
|
+
> **最新版本 v1.4.2** - 🎉 **Windows MCP 自动修复** - 彻底解决 Windows 用户 MCP 安装问题!
|
|
14
14
|
|
|
15
15
|
[快速开始](#-快速开始) • [命令参考](#-命令参考) • [常见问题](#-常见问题) • [更新日志](CHANGELOG.md)
|
|
16
16
|
|
|
@@ -18,19 +18,56 @@
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
## 🎯 v1.4.2 重大改进
|
|
22
|
+
|
|
23
|
+
### ✨ Windows 用户福音
|
|
24
|
+
|
|
25
|
+
**问题**:Windows 用户安装 MCP 后无法正常工作,需要手动设置环境变量
|
|
26
|
+
|
|
27
|
+
**解决**:从 [ZCF 项目](https://github.com/UfoMiao/zcf) 移植跨平台 MCP 配置逻辑
|
|
28
|
+
|
|
29
|
+
- ✅ **自动命令包装** - Windows 环境下 `npx` 自动包装为 `cmd /c npx`
|
|
30
|
+
- ✅ **零手动操作** - 用户无需设置环境变量或修改配置
|
|
31
|
+
- ✅ **自动备份** - 修改配置前自动备份到 `~/.claude/backup/`
|
|
32
|
+
- ✅ **诊断工具** - `npx ccg diagnose-mcp` 验证配置
|
|
33
|
+
- ✅ **一键修复** - `npx ccg fix-mcp` 修复现有配置
|
|
34
|
+
|
|
35
|
+
### 技术细节
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
// 修复前(Windows 不工作)
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"ace-tool": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["-y", "ace-tool@latest"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 修复后(自动应用)
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"ace-tool": {
|
|
52
|
+
"command": "cmd",
|
|
53
|
+
"args": ["/c", "npx", "-y", "ace-tool@latest"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
21
61
|
## 📖 目录
|
|
22
62
|
|
|
23
63
|
- [核心理念](#-核心理念)
|
|
24
64
|
- [架构说明](#-架构说明)
|
|
25
65
|
- [核心特性](#-核心特性)
|
|
26
66
|
- [快速开始](#-快速开始)
|
|
27
|
-
- [安装指南](#-安装指南)
|
|
28
67
|
- [命令参考](#-命令参考)
|
|
29
|
-
- [工作流详解](#-工作流详解)
|
|
30
68
|
- [专家角色系统](#-专家角色系统)
|
|
31
69
|
- [配置文件](#-配置文件)
|
|
32
70
|
- [常见问题](#-常见问题)
|
|
33
|
-
- [开发指南](#-开发指南)
|
|
34
71
|
- [致谢](#-致谢)
|
|
35
72
|
|
|
36
73
|
---
|
|
@@ -53,6 +90,7 @@ CCG = **Claude Code** (主导编排) + **Codex CLI** (后端原型) + **Gemini C
|
|
|
53
90
|
| **智能路由** | 根据任务类型自动选择最合适的模型 |
|
|
54
91
|
| **交叉验证** | 双模型并行生成,相互验证减少错误 |
|
|
55
92
|
| **零写入权限** | 外部模型只能返回 Patch,Claude 保持代码主权 |
|
|
93
|
+
| **跨平台支持** | macOS、Linux、**Windows 自动修复** ✨ |
|
|
56
94
|
| **Token 优化** | ROLE_FILE 动态注入,专家提示词零 token 消耗 |
|
|
57
95
|
|
|
58
96
|
---
|
|
@@ -94,12 +132,12 @@ CCG = **Claude Code** (主导编排) + **Codex CLI** (后端原型) + **Gemini C
|
|
|
94
132
|
|------|------|
|
|
95
133
|
| **智能路由** | 前端任务→Gemini,后端任务→Codex,全栈整合→Claude |
|
|
96
134
|
| **双模型并行** | Codex ∥ Gemini 同时调用,交叉验证结果 |
|
|
97
|
-
| **MCP
|
|
135
|
+
| **MCP 自动配置** | **Windows 自动修复** + ace-tool/auggie 动态选择 |
|
|
98
136
|
| **6阶段工作流** | Prompt增强 → 代码检索 → 分析 → 原型 → 实施 → 审计 |
|
|
99
137
|
| **18个专家提示词** | Codex 6个 + Gemini 6个 + Claude 6个 |
|
|
100
138
|
| **Git 自动化** | 智能 commit、交互式回滚、分支清理、Worktree 管理 |
|
|
101
139
|
| **npx 一键安装** | 无需全局安装,交互式配置菜单 |
|
|
102
|
-
|
|
|
140
|
+
| **诊断工具** | **新增** `npx ccg diagnose-mcp` 和 `npx ccg fix-mcp` |
|
|
103
141
|
|
|
104
142
|
---
|
|
105
143
|
|
|
@@ -115,7 +153,7 @@ CCG = **Claude Code** (主导编排) + **Codex CLI** (后端原型) + **Gemini C
|
|
|
115
153
|
- [Codex CLI](https://github.com/openai/openai-codeinterpreter) - 后端任务
|
|
116
154
|
- [Gemini CLI](https://github.com/google/generative-ai-cli) - 前端任务
|
|
117
155
|
|
|
118
|
-
###
|
|
156
|
+
### 一键安装
|
|
119
157
|
|
|
120
158
|
```bash
|
|
121
159
|
# 交互式安装
|
|
@@ -128,98 +166,33 @@ npx ccg-workflow
|
|
|
128
166
|
# 重启终端
|
|
129
167
|
```
|
|
130
168
|
|
|
131
|
-
### 方式二:全局安装
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
npm install -g ccg-workflow
|
|
135
|
-
ccg
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### 方式三:源码安装
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
git clone https://github.com/fengshao1227/ccg-workflow.git
|
|
142
|
-
cd ccg-workflow/skills-v2
|
|
143
|
-
pnpm install && pnpm build
|
|
144
|
-
pnpm start
|
|
145
|
-
```
|
|
146
|
-
|
|
147
169
|
### 验证安装
|
|
148
170
|
|
|
149
171
|
```bash
|
|
150
|
-
# 检查 codeagent-wrapper
|
|
172
|
+
# 检查 codeagent-wrapper
|
|
151
173
|
codeagent-wrapper --version
|
|
152
174
|
|
|
153
|
-
# 应该显示类似:codeagent-wrapper v5.4.0
|
|
154
|
-
|
|
155
175
|
# 检查配置文件
|
|
156
176
|
cat ~/.claude/.ccg/config.toml
|
|
157
177
|
|
|
158
|
-
#
|
|
159
|
-
|
|
178
|
+
# 诊断 MCP 配置(v1.4.2 新增)
|
|
179
|
+
npx ccg diagnose-mcp
|
|
160
180
|
```
|
|
161
181
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
## 📦 安装指南
|
|
165
|
-
|
|
166
|
-
### 交互式菜单
|
|
167
|
-
|
|
168
|
-
运行后会显示交互式菜单:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
CCG - Claude + Codex + Gemini
|
|
172
|
-
Multi-Model Collaboration System
|
|
173
|
-
|
|
174
|
-
? CCG 主菜单
|
|
175
|
-
❯ ➜ 初始化 CCG 配置
|
|
176
|
-
➜ 更新工作流
|
|
177
|
-
➜ 卸载 CCG
|
|
178
|
-
? 帮助
|
|
179
|
-
✕ 退出
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### 首次安装
|
|
183
|
-
|
|
184
|
-
选择 **"初始化 CCG 配置"** 进行首次安装,会引导你:
|
|
185
|
-
|
|
186
|
-
1. **选择语言**(中文/English)
|
|
187
|
-
2. **选择 MCP 工具**:
|
|
188
|
-
- **[1] ace-tool**(推荐新手):开箱即用,自动配置 Prompt 增强 + 代码检索
|
|
189
|
-
- **[2] auggie**(官方原版):代码检索 + 可选 Prompt 增强(需额外配置,[查看教程](https://linux.do/t/topic/1280612))
|
|
190
|
-
- **[0] 跳过**:稍后手动配置
|
|
191
|
-
3. **自动检测旧版本并迁移**(v1.3.x → v1.4.x)
|
|
192
|
-
4. **安装命令模板和提示词**
|
|
193
|
-
5. **配置 PATH 环境变量**
|
|
194
|
-
|
|
195
|
-
### 更新到最新版
|
|
196
|
-
|
|
197
|
-
选择 **"更新工作流"**,系统将:
|
|
198
|
-
1. 🔍 检查 npm 最新版本
|
|
199
|
-
2. 📊 显示当前版本 vs 最新版本对比
|
|
200
|
-
3. 📥 自动更新所有命令模板和提示词
|
|
201
|
-
4. ✅ 保留用户配置和自定义内容
|
|
202
|
-
5. 🔄 自动迁移旧版本目录结构
|
|
203
|
-
|
|
204
|
-
**特性**:
|
|
205
|
-
- ✅ 自动检测版本,有更新时提示
|
|
206
|
-
- ✅ 已是最新版本时,可选择"强制重装"修复损坏文件
|
|
207
|
-
- ✅ 无需 sudo 权限
|
|
208
|
-
- ✅ 无需卸载重装
|
|
209
|
-
|
|
210
|
-
### 卸载
|
|
182
|
+
### 第一个命令
|
|
211
183
|
|
|
212
184
|
```bash
|
|
213
|
-
#
|
|
214
|
-
|
|
215
|
-
# 选择 "卸载 CCG"
|
|
216
|
-
```
|
|
185
|
+
# 在 Claude Code 中执行
|
|
186
|
+
/ccg:dev 实现用户登录功能
|
|
217
187
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
188
|
+
# 系统会自动执行 6 阶段工作流:
|
|
189
|
+
# Phase 0: Prompt 增强 (MCP)
|
|
190
|
+
# Phase 1: 代码检索 (MCP)
|
|
191
|
+
# Phase 2: 多模型分析 (Codex ∥ Gemini 并行)
|
|
192
|
+
# Phase 3: 原型生成 (前端→Gemini / 后端→Codex)
|
|
193
|
+
# Phase 4: 代码实施 (Claude 重构为生产级)
|
|
194
|
+
# Phase 5: 审计交付 (Codex ∥ Gemini 交叉验证)
|
|
195
|
+
```
|
|
223
196
|
|
|
224
197
|
---
|
|
225
198
|
|
|
@@ -229,20 +202,20 @@ npx ccg-workflow
|
|
|
229
202
|
|
|
230
203
|
| 命令 | 用途 | 模型路由 |
|
|
231
204
|
|-----|------|---------|
|
|
232
|
-
| `/ccg:dev` | 完整6
|
|
233
|
-
| `/ccg:code` |
|
|
205
|
+
| `/ccg:dev` | 完整6阶段开发工作流 | MCP + Codex + Gemini |
|
|
206
|
+
| `/ccg:code` | 智能代码生成(自动路由)| 前端→Gemini / 后端→Codex |
|
|
234
207
|
| `/ccg:frontend` | 前端/UI/样式任务 | Gemini |
|
|
235
208
|
| `/ccg:backend` | 后端/逻辑/算法任务 | Codex |
|
|
236
|
-
| `/ccg:debug` | UltraThink
|
|
209
|
+
| `/ccg:debug` | UltraThink 多模型调试 | Codex + Gemini 并行 |
|
|
237
210
|
| `/ccg:test` | 多模型测试生成 | Codex + Gemini 并行 |
|
|
238
|
-
| `/ccg:bugfix` | 质量门控修复(90%+
|
|
211
|
+
| `/ccg:bugfix` | 质量门控修复(90%+ 通过)| Codex + Gemini 交叉验证 |
|
|
239
212
|
| `/ccg:optimize` | 性能优化 | Codex + Gemini 并行 |
|
|
240
213
|
| `/ccg:review` | 代码审查(无参数自动审查 git diff)| Codex + Gemini 并行 |
|
|
241
214
|
| `/ccg:analyze` | 技术分析 | Codex + Gemini 并行 |
|
|
242
215
|
| `/ccg:think` | 深度分析 | Codex + Gemini 并行 |
|
|
243
216
|
| `/ccg:enhance` | Prompt 增强 | ace-tool MCP |
|
|
244
|
-
| `/ccg:scan` |
|
|
245
|
-
| `/ccg:feat` |
|
|
217
|
+
| `/ccg:scan` | 智能仓库扫描 | 分析项目结构 |
|
|
218
|
+
| `/ccg:feat` | 智能功能开发(规划→实施→审查)| 多模型协作 |
|
|
246
219
|
|
|
247
220
|
### Git 工具命令
|
|
248
221
|
|
|
@@ -250,69 +223,15 @@ npx ccg-workflow
|
|
|
250
223
|
|-----|------|
|
|
251
224
|
| `/ccg:commit` | 智能 commit:分析改动,生成 conventional commit 信息 |
|
|
252
225
|
| `/ccg:rollback` | 交互式回滚:列分支、列版本、二次确认 |
|
|
253
|
-
| `/ccg:clean-branches` |
|
|
226
|
+
| `/ccg:clean-branches` | 分支清理:安全查找并清理已合并分支 |
|
|
254
227
|
| `/ccg:worktree` | Worktree 管理:在 `../.ccg/项目名/` 下创建 |
|
|
255
228
|
|
|
256
|
-
###
|
|
229
|
+
### CLI 诊断工具(v1.4.2 新增)
|
|
257
230
|
|
|
258
231
|
| 命令 | 用途 |
|
|
259
232
|
|-----|------|
|
|
260
|
-
|
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## 🔄 工作流详解
|
|
265
|
-
|
|
266
|
-
### /ccg:dev - 完整6阶段开发工作流
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
┌─────────────────────────────────────────┐
|
|
270
|
-
│ Phase 0: Prompt 增强 (MCP) │
|
|
271
|
-
│ 优化用户输入,补充技术细节 │
|
|
272
|
-
└────────────────┬────────────────────────┘
|
|
273
|
-
↓
|
|
274
|
-
┌─────────────────────────────────────────┐
|
|
275
|
-
│ Phase 1: 代码检索 (MCP) │
|
|
276
|
-
│ 获取相关代码上下文 │
|
|
277
|
-
└────────────────┬────────────────────────┘
|
|
278
|
-
↓
|
|
279
|
-
┌─────────────────────────────────────────┐
|
|
280
|
-
│ Phase 2: 多模型分析 │
|
|
281
|
-
│ Codex (后端) ∥ Gemini (前端) 并行 │
|
|
282
|
-
│ 交叉验证技术方案 │
|
|
283
|
-
└────────────────┬────────────────────────┘
|
|
284
|
-
↓
|
|
285
|
-
┌─────────────────────────────────────────┐
|
|
286
|
-
│ Phase 3: 原型生成 │
|
|
287
|
-
│ 前端 → Gemini / 后端 → Codex │
|
|
288
|
-
│ 输出 Unified Diff Patch │
|
|
289
|
-
└────────────────┬────────────────────────┘
|
|
290
|
-
↓
|
|
291
|
-
┌─────────────────────────────────────────┐
|
|
292
|
-
│ Phase 4: 代码实施 (Claude 主导) │
|
|
293
|
-
│ 重构为生产级代码并应用 │
|
|
294
|
-
└────────────────┬────────────────────────┘
|
|
295
|
-
↓
|
|
296
|
-
┌─────────────────────────────────────────┐
|
|
297
|
-
│ Phase 5: 审计交付 │
|
|
298
|
-
│ Codex ∥ Gemini 交叉验证代码质量 │
|
|
299
|
-
└─────────────────────────────────────────┘
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### 使用示例
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
# 在 Claude Code 中执行
|
|
306
|
-
/ccg:dev 实现用户登录功能
|
|
307
|
-
|
|
308
|
-
# 系统会自动:
|
|
309
|
-
# 1. 增强 Prompt(补充技术细节、最佳实践)
|
|
310
|
-
# 2. 检索相关代码(认证模块、数据库模型)
|
|
311
|
-
# 3. 双模型分析(Codex 分析后端逻辑 ∥ Gemini 分析前端表单)
|
|
312
|
-
# 4. 生成原型(Codex 生成 API ∥ Gemini 生成登录表单)
|
|
313
|
-
# 5. Claude 重构并应用代码
|
|
314
|
-
# 6. 双模型审查(Codex 检查安全性 ∥ Gemini 检查 UI/UX)
|
|
315
|
-
```
|
|
233
|
+
| `npx ccg diagnose-mcp` | 诊断 MCP 配置问题 |
|
|
234
|
+
| `npx ccg fix-mcp` | 修复 Windows MCP 配置(Windows 用户)|
|
|
316
235
|
|
|
317
236
|
---
|
|
318
237
|
|
|
@@ -328,58 +247,41 @@ npx ccg-workflow
|
|
|
328
247
|
|
|
329
248
|
### 角色映射表
|
|
330
249
|
|
|
331
|
-
| 命令 | Codex 角色 | Gemini 角色 |
|
|
332
|
-
|
|
333
|
-
| `/ccg:code`, `/ccg:backend` | architect.md(后端架构师)| - |
|
|
334
|
-
| `/ccg:frontend` | - | frontend.md(前端架构师)|
|
|
335
|
-
| `/ccg:analyze`, `/ccg:think` | analyzer.md | analyzer.md |
|
|
336
|
-
| `/ccg:debug` | debugger.md | debugger.md |
|
|
337
|
-
| `/ccg:test` | tester.md | tester.md |
|
|
338
|
-
| `/ccg:review`, `/ccg:bugfix` | reviewer.md | reviewer.md |
|
|
339
|
-
| `/ccg:optimize` | optimizer.md | optimizer.md |
|
|
250
|
+
| 命令 | Codex 角色 | Gemini 角色 |
|
|
251
|
+
|------|-----------|------------|
|
|
252
|
+
| `/ccg:code`, `/ccg:backend` | architect.md(后端架构师)| - |
|
|
253
|
+
| `/ccg:frontend` | - | frontend.md(前端架构师)|
|
|
254
|
+
| `/ccg:analyze`, `/ccg:think` | analyzer.md | analyzer.md |
|
|
255
|
+
| `/ccg:debug` | debugger.md | debugger.md |
|
|
256
|
+
| `/ccg:test` | tester.md | tester.md |
|
|
257
|
+
| `/ccg:review`, `/ccg:bugfix` | reviewer.md | reviewer.md |
|
|
258
|
+
| `/ccg:optimize` | optimizer.md | optimizer.md |
|
|
340
259
|
|
|
341
260
|
### 提示词文件结构
|
|
342
261
|
|
|
343
262
|
```
|
|
344
|
-
~/.claude/.ccg/prompts/
|
|
263
|
+
~/.claude/.ccg/prompts/ # v1.4.0+ 新位置
|
|
345
264
|
├── codex/ # Codex CLI 后端专家(6个)
|
|
346
|
-
│ ├── architect.md
|
|
347
|
-
│ ├── analyzer.md
|
|
348
|
-
│ ├── debugger.md
|
|
349
|
-
│ ├── optimizer.md
|
|
350
|
-
│ ├── reviewer.md
|
|
351
|
-
│ └── tester.md
|
|
265
|
+
│ ├── architect.md
|
|
266
|
+
│ ├── analyzer.md
|
|
267
|
+
│ ├── debugger.md
|
|
268
|
+
│ ├── optimizer.md
|
|
269
|
+
│ ├── reviewer.md
|
|
270
|
+
│ └── tester.md
|
|
352
271
|
├── gemini/ # Gemini CLI 前端专家(6个)
|
|
353
|
-
│ ├── frontend.md
|
|
354
|
-
│ ├── analyzer.md
|
|
355
|
-
│ ├── debugger.md
|
|
356
|
-
│ ├── optimizer.md
|
|
357
|
-
│ ├── reviewer.md
|
|
358
|
-
│ └── tester.md
|
|
272
|
+
│ ├── frontend.md
|
|
273
|
+
│ ├── analyzer.md
|
|
274
|
+
│ ├── debugger.md
|
|
275
|
+
│ ├── optimizer.md
|
|
276
|
+
│ ├── reviewer.md
|
|
277
|
+
│ └── tester.md
|
|
359
278
|
└── claude/ # Claude CLI 全栈专家(6个)
|
|
360
|
-
├── architect.md
|
|
361
|
-
├── analyzer.md
|
|
362
|
-
├── debugger.md
|
|
363
|
-
├── optimizer.md
|
|
364
|
-
├── reviewer.md
|
|
365
|
-
└── tester.md
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### 动态注入示例
|
|
369
|
-
|
|
370
|
-
```bash
|
|
371
|
-
codeagent-wrapper --backend codex - $PROJECT_DIR <<'EOF'
|
|
372
|
-
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
373
|
-
|
|
374
|
-
<TASK>
|
|
375
|
-
实现后端逻辑: 用户登录 API
|
|
376
|
-
|
|
377
|
-
Context:
|
|
378
|
-
现有代码...
|
|
379
|
-
</TASK>
|
|
380
|
-
|
|
381
|
-
OUTPUT: Unified Diff Patch ONLY. Strictly prohibit any actual modifications.
|
|
382
|
-
EOF
|
|
279
|
+
├── architect.md
|
|
280
|
+
├── analyzer.md
|
|
281
|
+
├── debugger.md
|
|
282
|
+
├── optimizer.md
|
|
283
|
+
├── reviewer.md
|
|
284
|
+
└── tester.md
|
|
383
285
|
```
|
|
384
286
|
|
|
385
287
|
---
|
|
@@ -390,95 +292,49 @@ EOF
|
|
|
390
292
|
|
|
391
293
|
```toml
|
|
392
294
|
[general]
|
|
393
|
-
version = "1.4.
|
|
295
|
+
version = "1.4.2"
|
|
394
296
|
language = "zh-CN"
|
|
395
297
|
|
|
396
298
|
[mcp]
|
|
397
299
|
provider = "ace-tool" # ace-tool | auggie | none
|
|
398
|
-
setup_url = "https://linux.do/t/topic/1280612"
|
|
399
|
-
|
|
400
|
-
[mcp.tools]
|
|
401
|
-
# 工具名称映射(配置驱动,命令模板自动适配)
|
|
402
|
-
code_search_ace = "mcp__ace-tool__search_context"
|
|
403
|
-
code_search_auggie = "mcp__auggie-mcp__codebase-retrieval"
|
|
404
|
-
prompt_enhance_ace = "mcp__ace-tool__enhance_prompt"
|
|
405
|
-
prompt_enhance_auggie = "" # 留空表示未配置
|
|
406
|
-
|
|
407
|
-
# 参数名映射
|
|
408
|
-
query_param_ace = "query"
|
|
409
|
-
query_param_auggie = "information_request"
|
|
410
300
|
|
|
411
301
|
[routing]
|
|
412
302
|
mode = "smart" # smart | parallel | sequential
|
|
413
303
|
|
|
414
304
|
[routing.frontend]
|
|
415
|
-
models = ["gemini"
|
|
305
|
+
models = ["gemini"]
|
|
416
306
|
primary = "gemini"
|
|
417
|
-
strategy = "
|
|
307
|
+
strategy = "fallback"
|
|
418
308
|
|
|
419
309
|
[routing.backend]
|
|
420
|
-
models = ["codex"
|
|
310
|
+
models = ["codex"]
|
|
421
311
|
primary = "codex"
|
|
422
|
-
strategy = "
|
|
423
|
-
|
|
424
|
-
[routing.review]
|
|
425
|
-
models = ["codex", "gemini", "claude"]
|
|
426
|
-
strategy = "parallel"
|
|
312
|
+
strategy = "fallback"
|
|
427
313
|
```
|
|
428
314
|
|
|
429
|
-
### 配置说明
|
|
430
|
-
|
|
431
|
-
| 配置项 | 说明 |
|
|
432
|
-
|-------|------|
|
|
433
|
-
| `mcp.provider` | MCP 工具提供商(ace-tool / auggie / none)|
|
|
434
|
-
| `routing.mode` | 路由模式(smart: 智能路由 / parallel: 并行 / sequential: 顺序)|
|
|
435
|
-
| `routing.frontend.models` | 前端任务使用的模型列表 |
|
|
436
|
-
| `routing.backend.models` | 后端任务使用的模型列表 |
|
|
437
|
-
| `routing.*.strategy` | 执行策略(parallel: 并行 / fallback: 回退)|
|
|
438
|
-
|
|
439
315
|
---
|
|
440
316
|
|
|
441
317
|
## 🗂️ 安装目录结构
|
|
442
318
|
|
|
443
|
-
安装后的完整目录结构:
|
|
444
|
-
|
|
445
319
|
```
|
|
446
320
|
~/.claude/
|
|
447
|
-
├── commands/ccg/ # ✅
|
|
448
|
-
│ ├── dev.md
|
|
449
|
-
│ ├──
|
|
450
|
-
│ ├──
|
|
451
|
-
│ ├──
|
|
452
|
-
│ ├──
|
|
453
|
-
|
|
454
|
-
│ ├──
|
|
455
|
-
│ ├──
|
|
456
|
-
│ ├── optimize.md
|
|
457
|
-
│ ├── analyze.md
|
|
458
|
-
│ ├── think.md
|
|
459
|
-
│ ├── enhance.md
|
|
460
|
-
│ ├── scan.md
|
|
461
|
-
│ ├── feat.md
|
|
462
|
-
│ ├── commit.md
|
|
463
|
-
│ ├── rollback.md
|
|
464
|
-
│ ├── clean-branches.md
|
|
465
|
-
│ ├── worktree.md
|
|
466
|
-
│ └── init.md
|
|
467
|
-
├── agents/ccg/ # ✅ CC 读取的 subagents
|
|
468
|
-
│ ├── planner.md
|
|
469
|
-
│ ├── ui-ux-designer.md
|
|
470
|
-
│ ├── init-architect.md
|
|
471
|
-
│ └── get-current-datetime.md
|
|
321
|
+
├── commands/ccg/ # ✅ Claude Code 读取的 slash commands
|
|
322
|
+
│ ├── dev.md, code.md, frontend.md, backend.md
|
|
323
|
+
│ ├── debug.md, test.md, bugfix.md, review.md
|
|
324
|
+
│ ├── optimize.md, analyze.md, think.md, enhance.md
|
|
325
|
+
│ ├── scan.md, feat.md, commit.md, rollback.md
|
|
326
|
+
│ ├── clean-branches.md, worktree.md, init.md
|
|
327
|
+
├── agents/ccg/ # ✅ Claude Code 读取的 subagents
|
|
328
|
+
│ ├── planner.md, ui-ux-designer.md
|
|
329
|
+
│ ├── init-architect.md, get-current-datetime.md
|
|
472
330
|
├── bin/ # ✅ 二进制文件
|
|
473
|
-
│ └── codeagent-wrapper
|
|
474
|
-
└── .ccg/ # ✅ CCG 配置目录(
|
|
331
|
+
│ └── codeagent-wrapper # (Windows 自动包装 MCP 命令)
|
|
332
|
+
└── .ccg/ # ✅ CCG 配置目录(v1.4.0+)
|
|
475
333
|
├── config.toml # 主配置文件
|
|
476
334
|
├── shared-config.md # 共享配置
|
|
477
|
-
├── backup/ #
|
|
335
|
+
├── backup/ # ✨ v1.4.2 新增:自动备份
|
|
478
336
|
└── prompts/ # 专家提示词
|
|
479
|
-
├── codex/
|
|
480
|
-
├── gemini/
|
|
481
|
-
└── claude/
|
|
337
|
+
├── codex/, gemini/, claude/
|
|
482
338
|
```
|
|
483
339
|
|
|
484
340
|
---
|
|
@@ -486,9 +342,39 @@ strategy = "parallel"
|
|
|
486
342
|
## ❓ 常见问题
|
|
487
343
|
|
|
488
344
|
<details>
|
|
489
|
-
<summary><strong>Q1:
|
|
345
|
+
<summary><strong>Q1: Windows 用户 MCP 安装后不工作怎么办?</strong></summary>
|
|
346
|
+
|
|
347
|
+
**v1.4.2 已自动修复!**
|
|
348
|
+
|
|
349
|
+
新用户:
|
|
350
|
+
```bash
|
|
351
|
+
npx ccg-workflow@latest init
|
|
352
|
+
# 安装时自动应用 Windows 修复
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
现有用户:
|
|
356
|
+
```bash
|
|
357
|
+
# 诊断问题
|
|
358
|
+
npx ccg diagnose-mcp
|
|
359
|
+
|
|
360
|
+
# 一键修复
|
|
361
|
+
npx ccg fix-mcp
|
|
362
|
+
```
|
|
490
363
|
|
|
491
|
-
|
|
364
|
+
手动验证:
|
|
365
|
+
```bash
|
|
366
|
+
# 检查配置是否正确
|
|
367
|
+
cat ~/.claude.json
|
|
368
|
+
|
|
369
|
+
# 应该看到 "command": "cmd", "args": ["/c", "npx", ...]
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
</details>
|
|
373
|
+
|
|
374
|
+
<details>
|
|
375
|
+
<summary><strong>Q2: 如何更新到 v1.4.2?</strong></summary>
|
|
376
|
+
|
|
377
|
+
一键更新,无需卸载:
|
|
492
378
|
```bash
|
|
493
379
|
npx ccg-workflow
|
|
494
380
|
# 选择 "更新工作流"
|
|
@@ -499,52 +385,61 @@ npx ccg-workflow
|
|
|
499
385
|
- 增量更新命令模板和提示词
|
|
500
386
|
- 保留用户配置和 MCP 设置
|
|
501
387
|
- 自动迁移旧版本目录结构(v1.3.x → v1.4.x)
|
|
388
|
+
- **应用 Windows MCP 修复**(v1.4.2)
|
|
389
|
+
|
|
502
390
|
</details>
|
|
503
391
|
|
|
504
392
|
<details>
|
|
505
|
-
<summary><strong>
|
|
393
|
+
<summary><strong>Q3: v1.4.0 目录迁移会影响我吗?</strong></summary>
|
|
506
394
|
|
|
507
395
|
**不会影响**,系统会自动迁移:
|
|
508
396
|
|
|
397
|
+
旧位置 → 新位置:
|
|
398
|
+
```
|
|
399
|
+
~/.ccg/ → ~/.claude/.ccg/
|
|
400
|
+
~/.claude/prompts/ccg/ → ~/.claude/.ccg/prompts/
|
|
401
|
+
~/.claude/commands/ccg/ → 保持不变
|
|
402
|
+
```
|
|
403
|
+
|
|
509
404
|
安装/更新时会自动:
|
|
510
|
-
1.
|
|
511
|
-
2.
|
|
405
|
+
1. 检测旧版本目录
|
|
406
|
+
2. 迁移所有文件到新位置
|
|
512
407
|
3. 清理旧目录(安全检查后)
|
|
513
408
|
4. 显示迁移报告
|
|
514
409
|
|
|
515
|
-
手动迁移(如果需要):
|
|
516
|
-
```bash
|
|
517
|
-
# 旧版本 → 新版本
|
|
518
|
-
~/.ccg/ → ~/.claude/.ccg/
|
|
519
|
-
~/.claude/prompts/ccg/ → ~/.claude/.ccg/prompts/
|
|
520
|
-
~/.claude/commands/ccg/_config.md → ~/.claude/.ccg/shared-config.md
|
|
521
|
-
```
|
|
522
410
|
</details>
|
|
523
411
|
|
|
524
412
|
<details>
|
|
525
|
-
<summary><strong>
|
|
413
|
+
<summary><strong>Q4: MCP 工具如何选择?</strong></summary>
|
|
526
414
|
|
|
527
|
-
|
|
528
|
-
-
|
|
529
|
-
-
|
|
415
|
+
**ace-tool**(推荐):
|
|
416
|
+
- ✅ 开箱即用
|
|
417
|
+
- ✅ Prompt 增强 + 代码检索
|
|
418
|
+
- ✅ 无需额外配置
|
|
419
|
+
- 📖 获取 Token: https://augmentcode.com/
|
|
530
420
|
|
|
531
|
-
|
|
421
|
+
**auggie**(官方):
|
|
422
|
+
- ✅ 代码检索(开箱即用)
|
|
423
|
+
- ⚠️ Prompt 增强需额外配置
|
|
424
|
+
- 📖 配置教程: https://linux.do/t/topic/1280612
|
|
532
425
|
|
|
533
|
-
|
|
426
|
+
切换方法:
|
|
534
427
|
```toml
|
|
428
|
+
# 编辑 ~/.claude/.ccg/config.toml
|
|
535
429
|
[mcp]
|
|
536
430
|
provider = "ace-tool" # 或 "auggie"
|
|
537
431
|
```
|
|
432
|
+
|
|
538
433
|
</details>
|
|
539
434
|
|
|
540
435
|
<details>
|
|
541
|
-
<summary><strong>
|
|
436
|
+
<summary><strong>Q5: codeagent-wrapper 是什么?</strong></summary>
|
|
542
437
|
|
|
543
438
|
来自 [cexll/myclaude](https://github.com/cexll/myclaude) 的 Go 工具,封装了多 CLI 调用:
|
|
544
439
|
- 支持 `--backend codex/gemini/claude` 切换
|
|
545
440
|
- 会话管理(SESSION_ID)
|
|
546
441
|
- ROLE_FILE 动态注入
|
|
547
|
-
-
|
|
442
|
+
- **v1.4.2 新增**:Windows 命令自动包装
|
|
548
443
|
|
|
549
444
|
调用语法:
|
|
550
445
|
```bash
|
|
@@ -552,61 +447,11 @@ codeagent-wrapper --backend <codex|gemini|claude> - [工作目录] <<'EOF'
|
|
|
552
447
|
<任务内容>
|
|
553
448
|
EOF
|
|
554
449
|
```
|
|
555
|
-
</details>
|
|
556
|
-
|
|
557
|
-
<details>
|
|
558
|
-
<summary><strong>Q5: 如何切换 MCP 工具(ace-tool ↔ auggie)?</strong></summary>
|
|
559
|
-
|
|
560
|
-
手动编辑配置文件 `~/.claude/.ccg/config.toml`:
|
|
561
|
-
|
|
562
|
-
```toml
|
|
563
|
-
[mcp]
|
|
564
|
-
provider = "ace-tool" # 或 "auggie"
|
|
565
|
-
```
|
|
566
|
-
|
|
567
|
-
然后重新运行 `/ccg:dev` 等命令即可。
|
|
568
|
-
</details>
|
|
569
|
-
|
|
570
|
-
<details>
|
|
571
|
-
<summary><strong>Q6: ROLE_FILE 动态注入如何工作?</strong></summary>
|
|
572
|
-
|
|
573
|
-
`codeagent-wrapper` 会自动识别命令中的 `ROLE_FILE:` 指令:
|
|
574
|
-
|
|
575
|
-
```bash
|
|
576
|
-
ROLE_FILE: ~/.claude/.ccg/prompts/codex/architect.md
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
工具会读取文件内容并注入到外部 CLI(Codex/Gemini)的系统提示词中,零 token 消耗。
|
|
580
|
-
</details>
|
|
581
|
-
|
|
582
|
-
<details>
|
|
583
|
-
<summary><strong>Q7: 为什么需要 Codex CLI / Gemini CLI?</strong></summary>
|
|
584
|
-
|
|
585
|
-
**核心理念**:让 Claude 专注于编排决策,把具体代码生成交给专业模型。
|
|
586
|
-
|
|
587
|
-
- **Codex**:后端逻辑、算法、调试能力强
|
|
588
|
-
- **Gemini**:前端 UI、组件、样式能力强
|
|
589
|
-
- **Claude**:全栈整合、质量把控、编排能力强
|
|
590
450
|
|
|
591
|
-
如果只有 Claude Code,系统会降级为纯 Claude 工作流。
|
|
592
451
|
</details>
|
|
593
452
|
|
|
594
453
|
<details>
|
|
595
|
-
<summary><strong>
|
|
596
|
-
|
|
597
|
-
**问题描述**:使用 `/ccg:dev` 等命令时,Codex 后端思考时间过长,导致超时。
|
|
598
|
-
|
|
599
|
-
**解决方案**:
|
|
600
|
-
- 参考社区讨论:[linux.do - Codex 超时问题](https://linux.do/t/topic/1405588/256?u=feng_li)
|
|
601
|
-
|
|
602
|
-
**常见优化方法**:
|
|
603
|
-
- 减少任务复杂度,拆分为更小的子任务
|
|
604
|
-
- 调整 Codex CLI 的超时配置
|
|
605
|
-
- 使用 `--backend gemini` 切换到 Gemini 后端测试
|
|
606
|
-
</details>
|
|
607
|
-
|
|
608
|
-
<details>
|
|
609
|
-
<summary><strong>Q9: 安装后提示 "codeagent-wrapper: command not found"?</strong></summary>
|
|
454
|
+
<summary><strong>Q6: 安装后提示 "codeagent-wrapper: command not found"?</strong></summary>
|
|
610
455
|
|
|
611
456
|
**原因**:PATH 未生效。
|
|
612
457
|
|
|
@@ -623,13 +468,14 @@ source ~/.bashrc
|
|
|
623
468
|
Windows:
|
|
624
469
|
```powershell
|
|
625
470
|
# 重新打开 PowerShell
|
|
626
|
-
#
|
|
471
|
+
# 或手动验证环境变量:
|
|
627
472
|
# %USERPROFILE%\.claude\bin
|
|
628
473
|
```
|
|
474
|
+
|
|
629
475
|
</details>
|
|
630
476
|
|
|
631
477
|
<details>
|
|
632
|
-
<summary><strong>
|
|
478
|
+
<summary><strong>Q7: 如何卸载 CCG 系统?</strong></summary>
|
|
633
479
|
|
|
634
480
|
```bash
|
|
635
481
|
npx ccg-workflow
|
|
@@ -641,108 +487,20 @@ npx ccg-workflow
|
|
|
641
487
|
- 删除 `~/.claude/agents/ccg/` 子智能体
|
|
642
488
|
- 删除 `~/.claude/bin/codeagent-wrapper` 二进制
|
|
643
489
|
- 删除 `~/.claude/.ccg/` 配置目录(可选保留)
|
|
644
|
-
</details>
|
|
645
490
|
|
|
646
|
-
<details>
|
|
647
|
-
<summary><strong>Q11: auggie 如何配置 Prompt 增强功能?</strong></summary>
|
|
648
|
-
|
|
649
|
-
auggie 默认只有代码检索功能,要启用 Prompt 增强需要额外配置:
|
|
650
|
-
|
|
651
|
-
参考教程:[linux.do - auggie Prompt 增强配置](https://linux.do/t/topic/1280612)
|
|
652
|
-
|
|
653
|
-
配置完成后,编辑 `~/.claude/.ccg/config.toml`:
|
|
654
|
-
```toml
|
|
655
|
-
[mcp.tools]
|
|
656
|
-
prompt_enhance_auggie = "mcp__auggie__enhance_prompt" # 填入配置的工具名
|
|
657
|
-
```
|
|
658
491
|
</details>
|
|
659
492
|
|
|
660
493
|
---
|
|
661
494
|
|
|
662
|
-
## 🛠️ 开发指南
|
|
663
|
-
|
|
664
|
-
### 本地开发
|
|
665
|
-
|
|
666
|
-
```bash
|
|
667
|
-
# 克隆仓库
|
|
668
|
-
git clone https://github.com/fengshao1227/ccg-workflow.git
|
|
669
|
-
cd ccg-workflow/skills-v2
|
|
670
|
-
|
|
671
|
-
# 安装依赖
|
|
672
|
-
pnpm install
|
|
673
|
-
|
|
674
|
-
# 开发模式
|
|
675
|
-
pnpm dev
|
|
676
|
-
|
|
677
|
-
# 构建
|
|
678
|
-
pnpm build
|
|
679
|
-
|
|
680
|
-
# 本地测试
|
|
681
|
-
pnpm start
|
|
682
|
-
|
|
683
|
-
# 类型检查
|
|
684
|
-
pnpm typecheck
|
|
685
|
-
|
|
686
|
-
# 代码检查
|
|
687
|
-
pnpm lint
|
|
688
|
-
```
|
|
689
|
-
|
|
690
|
-
### 项目结构
|
|
691
|
-
|
|
692
|
-
```
|
|
693
|
-
skills-v2/
|
|
694
|
-
├── src/ # TypeScript 源码
|
|
695
|
-
│ ├── commands/ # CLI 命令
|
|
696
|
-
│ │ ├── init.ts # 初始化命令
|
|
697
|
-
│ │ ├── menu.ts # 主菜单
|
|
698
|
-
│ │ └── update.ts # 更新命令
|
|
699
|
-
│ ├── utils/ # 工具函数
|
|
700
|
-
│ │ ├── installer.ts # 安装器
|
|
701
|
-
│ │ ├── migration.ts # 迁移脚本
|
|
702
|
-
│ │ ├── config.ts # 配置管理
|
|
703
|
-
│ │ └── version.ts # 版本管理
|
|
704
|
-
│ ├── i18n/ # 国际化
|
|
705
|
-
│ ├── types.ts # TypeScript 类型
|
|
706
|
-
│ ├── cli.ts # CLI 入口
|
|
707
|
-
│ └── index.ts # 导出
|
|
708
|
-
├── templates/ # 安装模板
|
|
709
|
-
│ ├── commands/ # 命令模板
|
|
710
|
-
│ ├── config/ # 配置模板
|
|
711
|
-
│ └── prompts/ # 提示词模板
|
|
712
|
-
├── bin/ # 预编译二进制
|
|
713
|
-
│ └── codeagent-wrapper-*
|
|
714
|
-
├── dist/ # 构建输出
|
|
715
|
-
├── package.json
|
|
716
|
-
└── README.md
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
### 发布流程
|
|
720
|
-
|
|
721
|
-
```bash
|
|
722
|
-
# 1. 更新版本号(package.json)
|
|
723
|
-
# "version": "1.4.x" → "1.4.y"
|
|
724
|
-
|
|
725
|
-
# 2. 构建并发布
|
|
726
|
-
pnpm build
|
|
727
|
-
npm publish
|
|
728
|
-
|
|
729
|
-
# 3. 提交到 Git
|
|
730
|
-
git add -A
|
|
731
|
-
git commit -m "chore: bump version to x.y.z"
|
|
732
|
-
git push origin main
|
|
733
|
-
```
|
|
734
|
-
|
|
735
|
-
---
|
|
736
|
-
|
|
737
495
|
## 🙏 致谢
|
|
738
496
|
|
|
739
497
|
感谢以下开源项目的贡献:
|
|
740
498
|
|
|
741
|
-
- **[cexll/myclaude](https://github.com/cexll/myclaude)** - `codeagent-wrapper`
|
|
742
|
-
- **[UfoMiao/zcf](https://github.com/UfoMiao/zcf)** - Git
|
|
743
|
-
- **[GudaStudio/skills](https://github.com/GuDaStudio/skills)** -
|
|
744
|
-
- **[ace-tool MCP](https://linux.do/t/topic/1344562)** -
|
|
745
|
-
- **[linux.do 社区](https://linux.do/)** - 活跃的
|
|
499
|
+
- **[cexll/myclaude](https://github.com/cexll/myclaude)** - `codeagent-wrapper` 多后端调用工具
|
|
500
|
+
- **[UfoMiao/zcf](https://github.com/UfoMiao/zcf)** - Git 工具 + **MCP 跨平台配置逻辑**(v1.4.2)
|
|
501
|
+
- **[GudaStudio/skills](https://github.com/GuDaStudio/skills)** - 智能路由设计理念
|
|
502
|
+
- **[ace-tool MCP](https://linux.do/t/topic/1344562)** - 轻量级代码检索和 Prompt 增强方案
|
|
503
|
+
- **[linux.do 社区](https://linux.do/)** - 活跃的 Vibe Coding 大型技术交流社区
|
|
746
504
|
|
|
747
505
|
---
|
|
748
506
|
|
|
@@ -750,7 +508,7 @@ git push origin main
|
|
|
750
508
|
|
|
751
509
|
- **GitHub Issues**: [提交问题](https://github.com/fengshao1227/ccg-workflow/issues)
|
|
752
510
|
- **讨论社区**: [linux.do - CCG 讨论帖](https://linux.do/t/topic/1405588)
|
|
753
|
-
- **完整文档**: [README.md](https://github.com/fengshao1227/ccg-workflow
|
|
511
|
+
- **完整文档**: [README.md](https://github.com/fengshao1227/ccg-workflow)
|
|
754
512
|
|
|
755
513
|
---
|
|
756
514
|
|
|
@@ -764,7 +522,7 @@ Copyright (c) 2025 fengshao1227
|
|
|
764
522
|
|
|
765
523
|
<div align="center">
|
|
766
524
|
|
|
767
|
-
**最后更新**: 2026-01-06 | **版本**: v1.4.
|
|
525
|
+
**最后更新**: 2026-01-06 | **版本**: v1.4.2
|
|
768
526
|
|
|
769
527
|
Made with ❤️ by the CCG Community
|
|
770
528
|
|
package/dist/cli.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import 'smol-toml';
|
|
|
13
13
|
import 'node:child_process';
|
|
14
14
|
import 'node:util';
|
|
15
15
|
|
|
16
|
-
const version = "1.4.
|
|
16
|
+
const version = "1.4.3";
|
|
17
17
|
|
|
18
18
|
async function diagnoseMcp() {
|
|
19
19
|
console.log();
|
|
@@ -129,10 +129,10 @@ function customizeHelp(sections) {
|
|
|
129
129
|
async function setupCommands(cli) {
|
|
130
130
|
try {
|
|
131
131
|
const config = await readCcgConfig();
|
|
132
|
-
const defaultLang = config?.general?.language || "
|
|
132
|
+
const defaultLang = config?.general?.language || "zh-CN";
|
|
133
133
|
await initI18n(defaultLang);
|
|
134
134
|
} catch {
|
|
135
|
-
await initI18n("
|
|
135
|
+
await initI18n("zh-CN");
|
|
136
136
|
}
|
|
137
137
|
cli.command("", "Show interactive menu (default)").option("--lang, -l <lang>", "Display language (zh-CN, en)").action(async (options) => {
|
|
138
138
|
if (options.lang) {
|