ccg-workflow 1.7.39 → 1.7.40
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/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{ccg-workflow.DTSqMYKy.mjs → ccg-workflow.CaoBhCTX.mjs} +1 -1
- package/package.json +1 -1
- package/templates/commands/backend.md +3 -2
- package/templates/commands/debug.md +13 -2
- package/templates/commands/feat.md +6 -0
- package/templates/commands/frontend.md +3 -2
- package/templates/commands/optimize.md +17 -1
- package/templates/commands/review.md +10 -0
- package/templates/commands/test.md +12 -0
- package/templates/commands/workflow.md +5 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, E as configMcp, F as version, a as i18n } from './shared/ccg-workflow.
|
|
4
|
+
import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, E as configMcp, F as version, a as i18n } from './shared/ccg-workflow.CaoBhCTX.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
6
|
import 'node:child_process';
|
|
7
7
|
import 'node:util';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, x as checkForUpdates, y as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, t as getCurrentVersion, v as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, m as installAceToolRs, k as installWorkflows, p as migrateToV1_4_0, q as needsMigration, r as readCcgConfig, s as showMainMenu, o as uninstallAceTool, n as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.CaoBhCTX.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
4
|
import 'node:child_process';
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '后端专项工作流(研究→构思→计划→执行→优化→评审),Codex主导'
|
|
2
|
+
description: '后端专项工作流(研究→构思→计划→执行→优化→评审),Codex 主导'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Backend - 后端专项开发
|
|
@@ -14,7 +14,7 @@ description: '后端专项工作流(研究→构思→计划→执行→优化
|
|
|
14
14
|
|
|
15
15
|
- 后端任务:$ARGUMENTS
|
|
16
16
|
- Codex 主导,Gemini 辅助参考
|
|
17
|
-
- 适用:API设计、算法实现、数据库优化、业务逻辑
|
|
17
|
+
- 适用:API 设计、算法实现、数据库优化、业务逻辑
|
|
18
18
|
|
|
19
19
|
## 你的角色
|
|
20
20
|
|
|
@@ -79,6 +79,7 @@ EOF",
|
|
|
79
79
|
|
|
80
80
|
1. 响应以模式标签 `[模式:X]` 开始,初始为 `[模式:研究]`
|
|
81
81
|
2. 严格按 `研究 → 构思 → 计划 → 执行 → 优化 → 评审` 顺序流转
|
|
82
|
+
3. 在需要询问用户时,尽量使用 `AskUserQuestion` 工具进行交互,举例场景:请求用户确认/选择/批准
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
@@ -28,6 +28,7 @@ description: '多模型调试:Codex 后端诊断 + Gemini 前端诊断,交
|
|
|
28
28
|
```
|
|
29
29
|
Bash({
|
|
30
30
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
31
|
+
ROLE_FILE: <角色提示词路径>
|
|
31
32
|
<TASK>
|
|
32
33
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
33
34
|
上下文:<错误日志、堆栈信息、复现步骤等>
|
|
@@ -40,6 +41,13 @@ EOF",
|
|
|
40
41
|
})
|
|
41
42
|
```
|
|
42
43
|
|
|
44
|
+
**角色提示词**:
|
|
45
|
+
|
|
46
|
+
| 模型 | 提示词 |
|
|
47
|
+
|------|--------|
|
|
48
|
+
| Codex | `~/.claude/.ccg/prompts/codex/debugger.md` |
|
|
49
|
+
| Gemini | `~/.claude/.ccg/prompts/gemini/debugger.md` |
|
|
50
|
+
|
|
43
51
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
44
52
|
|
|
45
53
|
**等待后台任务**(使用最大超时 600000ms = 10 分钟):
|
|
@@ -78,9 +86,12 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
78
86
|
**⚠️ 必须发起两个并行 Bash 调用**(参照上方调用规范):
|
|
79
87
|
|
|
80
88
|
1. **Codex 后端诊断**:`Bash({ command: "...--backend codex...", run_in_background: true })`
|
|
81
|
-
|
|
89
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/codex/debugger.md`
|
|
90
|
+
- OUTPUT:诊断假设(按可能性排序),每个假设包含原因、证据、修复建议
|
|
82
91
|
|
|
83
|
-
|
|
92
|
+
2. **Gemini 前端诊断**:`Bash({ command: "...--backend gemini...", run_in_background: true })`
|
|
93
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/gemini/debugger.md`
|
|
94
|
+
- OUTPUT:诊断假设(按可能性排序),每个假设包含原因、证据、修复建议
|
|
84
95
|
|
|
85
96
|
用 `TaskOutput` 等待两个模型的诊断结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
86
97
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '前端专项工作流(研究→构思→计划→执行→优化→评审),Gemini主导'
|
|
2
|
+
description: '前端专项工作流(研究→构思→计划→执行→优化→评审),Gemini 主导'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Frontend - 前端专项开发
|
|
@@ -14,7 +14,7 @@ description: '前端专项工作流(研究→构思→计划→执行→优化
|
|
|
14
14
|
|
|
15
15
|
- 前端任务:$ARGUMENTS
|
|
16
16
|
- Gemini 主导,Codex 辅助参考
|
|
17
|
-
- 适用:组件设计、响应式布局、UI动画、样式优化
|
|
17
|
+
- 适用:组件设计、响应式布局、UI 动画、样式优化
|
|
18
18
|
|
|
19
19
|
## 你的角色
|
|
20
20
|
|
|
@@ -79,6 +79,7 @@ EOF",
|
|
|
79
79
|
|
|
80
80
|
1. 响应以模式标签 `[模式:X]` 开始,初始为 `[模式:研究]`
|
|
81
81
|
2. 严格按 `研究 → 构思 → 计划 → 执行 → 优化 → 评审` 顺序流转
|
|
82
|
+
3. 在需要询问用户时,尽量使用 `AskUserQuestion` 工具进行交互,举例场景:请求用户确认/选择/批准
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
@@ -34,6 +34,7 @@ description: '多模型性能优化:Codex 后端优化 + Gemini 前端优化'
|
|
|
34
34
|
```
|
|
35
35
|
Bash({
|
|
36
36
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
37
|
+
ROLE_FILE: <角色提示词路径>
|
|
37
38
|
<TASK>
|
|
38
39
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
39
40
|
上下文:<目标代码、现有性能指标等>
|
|
@@ -46,6 +47,13 @@ EOF",
|
|
|
46
47
|
})
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
**角色提示词**:
|
|
51
|
+
|
|
52
|
+
| 模型 | 提示词 |
|
|
53
|
+
|------|--------|
|
|
54
|
+
| Codex | `~/.claude/.ccg/prompts/codex/optimizer.md` |
|
|
55
|
+
| Gemini | `~/.claude/.ccg/prompts/gemini/optimizer.md` |
|
|
56
|
+
|
|
49
57
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
50
58
|
|
|
51
59
|
**等待后台任务**(使用最大超时 600000ms = 10 分钟):
|
|
@@ -61,6 +69,12 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
61
69
|
|
|
62
70
|
---
|
|
63
71
|
|
|
72
|
+
## 沟通守则
|
|
73
|
+
|
|
74
|
+
1. 在需要询问用户时,尽量使用 `AskUserQuestion` 工具进行交互,举例场景:请求用户确认/选择/批准
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
64
78
|
## 执行工作流
|
|
65
79
|
|
|
66
80
|
**优化目标**:$ARGUMENTS
|
|
@@ -84,10 +98,12 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
84
98
|
**⚠️ 必须发起两个并行 Bash 调用**(参照上方调用规范):
|
|
85
99
|
|
|
86
100
|
1. **Codex 后端分析**:`Bash({ command: "...--backend codex...", run_in_background: true })`
|
|
101
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/codex/optimizer.md`
|
|
87
102
|
- 需求:分析后端性能问题($ARGUMENTS)
|
|
88
103
|
- OUTPUT:性能瓶颈列表、优化方案、预期收益
|
|
89
104
|
|
|
90
105
|
2. **Gemini 前端分析**:`Bash({ command: "...--backend gemini...", run_in_background: true })`
|
|
106
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/gemini/optimizer.md`
|
|
91
107
|
- 需求:分析前端性能问题(Core Web Vitals)
|
|
92
108
|
- OUTPUT:性能瓶颈列表、优化方案、预期收益
|
|
93
109
|
|
|
@@ -131,7 +147,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
131
147
|
|
|
132
148
|
**后端**:N+1→批量加载、缺索引→复合索引、重复计算→缓存、同步→异步
|
|
133
149
|
|
|
134
|
-
**前端**:大Bundle→代码分割、频繁重渲染→memo、大列表→虚拟滚动、未优化图片→WebP
|
|
150
|
+
**前端**:大 Bundle→代码分割、频繁重渲染→memo、大列表→虚拟滚动、未优化图片→WebP
|
|
135
151
|
|
|
136
152
|
---
|
|
137
153
|
|
|
@@ -24,6 +24,7 @@ description: '多模型代码审查:无参数时自动审查 git diff,双模
|
|
|
24
24
|
```
|
|
25
25
|
Bash({
|
|
26
26
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
27
|
+
ROLE_FILE: <角色提示词路径>
|
|
27
28
|
<TASK>
|
|
28
29
|
审查以下代码变更:
|
|
29
30
|
<git diff 内容>
|
|
@@ -36,6 +37,13 @@ EOF",
|
|
|
36
37
|
})
|
|
37
38
|
```
|
|
38
39
|
|
|
40
|
+
**角色提示词**:
|
|
41
|
+
|
|
42
|
+
| 模型 | 提示词 |
|
|
43
|
+
|------|--------|
|
|
44
|
+
| Codex | `~/.claude/.ccg/prompts/codex/reviewer.md` |
|
|
45
|
+
| Gemini | `~/.claude/.ccg/prompts/gemini/reviewer.md` |
|
|
46
|
+
|
|
39
47
|
**并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
|
|
40
48
|
|
|
41
49
|
**等待后台任务**(使用最大超时 600000ms = 10 分钟):
|
|
@@ -70,10 +78,12 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
70
78
|
**⚠️ 必须发起两个并行 Bash 调用**(参照上方调用规范):
|
|
71
79
|
|
|
72
80
|
1. **Codex 后端审查**:`Bash({ command: "...--backend codex...", run_in_background: true })`
|
|
81
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/codex/reviewer.md`
|
|
73
82
|
- 需求:审查代码变更(git diff 内容)
|
|
74
83
|
- OUTPUT:按 Critical/Major/Minor/Suggestion 分类列出安全性、性能、错误处理问题
|
|
75
84
|
|
|
76
85
|
2. **Gemini 前端审查**:`Bash({ command: "...--backend gemini...", run_in_background: true })`
|
|
86
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/gemini/reviewer.md`
|
|
77
87
|
- 需求:审查代码变更(git diff 内容)
|
|
78
88
|
- OUTPUT:按 Critical/Major/Minor/Suggestion 分类列出可访问性、响应式、设计一致性问题
|
|
79
89
|
|
|
@@ -34,6 +34,7 @@ description: '多模型测试生成:智能路由 Codex 后端测试 / Gemini
|
|
|
34
34
|
```
|
|
35
35
|
Bash({
|
|
36
36
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
|
|
37
|
+
ROLE_FILE: <角色提示词路径>
|
|
37
38
|
<TASK>
|
|
38
39
|
需求:为以下代码生成测试
|
|
39
40
|
<代码内容>
|
|
@@ -50,6 +51,13 @@ EOF",
|
|
|
50
51
|
})
|
|
51
52
|
```
|
|
52
53
|
|
|
54
|
+
**角色提示词**:
|
|
55
|
+
|
|
56
|
+
| 模型 | 提示词 |
|
|
57
|
+
|------|--------|
|
|
58
|
+
| Codex | `~/.claude/.ccg/prompts/codex/tester.md` |
|
|
59
|
+
| Gemini | `~/.claude/.ccg/prompts/gemini/tester.md` |
|
|
60
|
+
|
|
53
61
|
**智能路由**:
|
|
54
62
|
|
|
55
63
|
| 代码类型 | 路由 |
|
|
@@ -97,10 +105,14 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
97
105
|
**⚠️ 根据代码类型必须调用对应模型**(参照上方调用规范):
|
|
98
106
|
|
|
99
107
|
- **后端代码** → `Bash({ command: "...--backend codex...", run_in_background: false })`
|
|
108
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/codex/tester.md`
|
|
100
109
|
- **前端代码** → `Bash({ command: "...--backend gemini...", run_in_background: false })`
|
|
110
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/gemini/tester.md`
|
|
101
111
|
- **全栈代码** → 并行调用两者:
|
|
102
112
|
1. `Bash({ command: "...--backend codex...", run_in_background: true })`
|
|
113
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/codex/tester.md`
|
|
103
114
|
2. `Bash({ command: "...--backend gemini...", run_in_background: true })`
|
|
115
|
+
- ROLE_FILE: `~/.claude/.ccg/prompts/gemini/tester.md`
|
|
104
116
|
用 `TaskOutput` 等待结果
|
|
105
117
|
|
|
106
118
|
OUTPUT:完整测试代码(使用项目现有测试框架,覆盖正常路径、边界条件、异常处理)
|
|
@@ -98,6 +98,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
98
98
|
2. 核心工作流严格按 `研究 → 构思 → 计划 → 执行 → 优化 → 评审` 顺序流转。
|
|
99
99
|
3. 每个阶段完成后必须请求用户确认。
|
|
100
100
|
4. 评分低于 7 分或用户未批准时强制停止。
|
|
101
|
+
5. 在需要询问用户时,尽量使用 `AskUserQuestion` 工具进行交互,举例场景:请求用户确认/选择/批准
|
|
101
102
|
|
|
102
103
|
---
|
|
103
104
|
|
|
@@ -139,6 +140,8 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
139
140
|
|
|
140
141
|
用 `TaskOutput` 等待结果。
|
|
141
142
|
|
|
143
|
+
**务必遵循上方 `多模型调用规范` 的 `重要` 指示**
|
|
144
|
+
|
|
142
145
|
**Claude 综合规划**:采纳 Codex 后端规划 + Gemini 前端规划,用户批准后存入 `.claude/plan/任务名.md`
|
|
143
146
|
|
|
144
147
|
### ⚡ 阶段 4:实施
|
|
@@ -159,6 +162,8 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
|
|
|
159
162
|
|
|
160
163
|
用 `TaskOutput` 等待结果。整合审查意见,用户确认后执行优化。
|
|
161
164
|
|
|
165
|
+
**务必遵循上方 `多模型调用规范` 的 `重要` 指示**
|
|
166
|
+
|
|
162
167
|
### ✅ 阶段 6:质量审查
|
|
163
168
|
|
|
164
169
|
`[模式:评审]` - 最终评估:
|