ccg-workflow 3.0.2 → 3.0.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 CHANGED
@@ -12,8 +12,9 @@
12
12
  [![Tests](https://img.shields.io/badge/Tests-139%20passed-brightgreen.svg)]()
13
13
  [![Follow on X](https://img.shields.io/badge/X-@CCG__Workflow-black?logo=x&logoColor=white)](https://x.com/CCG_Workflow)
14
14
  ![star](https://atomgit.com/fengshao1227/ccg-workflow/star/badge.svg)
15
+ [![Docs](https://img.shields.io/badge/Docs-ccg.fengshao1227.com-blue?style=for-the-badge&logo=readthedocs&logoColor=white)](https://ccg.fengshao1227.com/)
15
16
 
16
- [简体中文](./README.zh-CN.md) | English
17
+ [简体中文](./README.zh-CN.md) | English | [**Documentation**](https://ccg.fengshao1227.com/)
17
18
 
18
19
  </div>
19
20
 
@@ -249,4 +250,4 @@ MIT
249
250
 
250
251
  ---
251
252
 
252
- v3.0.2 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
253
+ v3.0.3 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
package/README.zh-CN.md CHANGED
@@ -13,8 +13,9 @@
13
13
  [![Tests](https://img.shields.io/badge/Tests-139%20passed-brightgreen.svg)]()
14
14
  [![Follow on X](https://img.shields.io/badge/X-@CCG__Workflow-black?logo=x&logoColor=white)](https://x.com/CCG_Workflow)
15
15
  ![star](https://atomgit.com/fengshao1227/ccg-workflow/star/badge.svg)
16
+ [![Docs](https://img.shields.io/badge/文档站-ccg.fengshao1227.com-blue?style=for-the-badge&logo=readthedocs&logoColor=white)](https://ccg.fengshao1227.com/)
16
17
 
17
- [简体中文](./README.zh-CN.md) | English
18
+ [简体中文](./README.zh-CN.md) | English | [**完整文档**](https://ccg.fengshao1227.com/)
18
19
 
19
20
  </div>
20
21
 
@@ -244,4 +245,4 @@ MIT
244
245
 
245
246
  ---
246
247
 
247
- v3.0.2 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
248
+ v3.0.3 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues) | [Contributing](./CONTRIBUTING.md)
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, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.CGOOq1xo.mjs';
4
+ import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, a as i18n, s as showMainMenu, i as init, E as configMcp, F as version } from './shared/ccg-workflow.DxKAcBrr.mjs';
5
5
  import 'inquirer';
6
6
  import 'ora';
7
7
  import 'node:child_process';
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.CGOOq1xo.mjs';
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.DxKAcBrr.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'ora';
@@ -10,7 +10,7 @@ import fs from 'fs-extra';
10
10
  import { parse, stringify } from 'smol-toml';
11
11
  import i18next from 'i18next';
12
12
 
13
- const version = "3.0.2";
13
+ const version = "3.0.3";
14
14
 
15
15
  function cmd(id, order, category, name, nameEn, description, descriptionEn, cmdOverride) {
16
16
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-workflow",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Claude + Codex + Gemini multi-model collaboration system - smart routing development workflow",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -46,8 +46,14 @@ Read ~/.claude/.ccg/config.toml
46
46
  | 不确定 | 双模型并行 | 各用对应 debugger |
47
47
 
48
48
  ### 实施阶段
49
- - 外部模型**仅提供建议**,Claude 执行所有文件修改
50
- - 外部模型有**零文件写入权限**
49
+
50
+ **默认模式**(Claude 执行):
51
+ - 外部模型仅提供建议,Claude 执行所有文件修改
52
+
53
+ **Codex Builder 模式**(用户选择时):
54
+ - backend 模型 + `$BACKEND/builder.md` — **有完整写权限**,直接写代码到文件系统
55
+ - Claude 监控进度,审查产出,必要时接管
56
+ - 适用于 M-L 复杂度、低中风险的明确实施任务
51
57
 
52
58
  ## 3. 调用模板
53
59
 
@@ -71,7 +77,7 @@ Bash({
71
77
 
72
78
  变量说明:
73
79
  - `$MODEL` — 选定的模型名(`codex` / `gemini` / `claude`)
74
- - `$ROLE` — 角色文件名(`analyzer` / `architect` / `reviewer` / `debugger` / `optimizer` / `tester`)
80
+ - `$ROLE` — 角色文件名(`analyzer` / `architect` / `reviewer` / `debugger` / `optimizer` / `tester` / `builder`)
75
81
  - `$TASK_CONTENT` — 任务内容(需求 + 上下文)
76
82
  - `$OUTPUT_FORMAT` — 期望输出格式
77
83
  - `$SHORT_DESCRIPTION` — 简短描述(用于进度显示)
@@ -136,19 +136,31 @@ TaskOutput({ task_id: "$FRONTEND_TASK_ID", block: true, timeout: 600000 })
136
136
  nextAction → "等待用户审批计划"
137
137
  ```
138
138
 
139
- **⛔ HARD STOP**:展示完整计划,并告知用户:
139
+ **⛔ HARD STOP**:展示完整计划,并询问用户选择执行模式:
140
+
140
141
  ```
141
- 审批后将使用 Agent Teams 并行实施(多个 Builder 同时写代码)。
142
+ 计划审批 + 执行模式选择
143
+
144
+ 请审批以上计划,并选择谁来写代码:
145
+ [1] Agent Teams(Claude Builders 并行写,多文件同时进行)
146
+ [2] Codex(Codex 写代码,更快更便宜,Claude 监控审查)
142
147
  ```
143
- 等待用户明确审批。未审批不可进入 Phase 4。
148
+
149
+ 等待用户明确审批 + 选择。未审批不可进入 Phase 4。
144
150
 
145
151
  用户确认后:`task.json: gate → null`
146
152
 
147
- ### Phase 4: 实施(Agent Teams 并行)
153
+ ### Phase 4: 实施
148
154
 
149
155
  `[模式:执行]`
150
156
 
151
- **Gate check**: 用户已审批计划
157
+ **Gate check**: 用户已审批计划 + 选择了执行模式
158
+
159
+ 根据用户选择的执行模式执行:
160
+
161
+ ---
162
+
163
+ #### 模式 A: Agent Teams 并行(用户选 [1])
152
164
 
153
165
  **⛔⛔⛔ 你的第一个动作必须是 TeamCreate。不是 Write,不是 Bash,不是 Read,是 TeamCreate。⛔⛔⛔**
154
166
 
@@ -225,6 +237,37 @@ SendMessage({ to: "reviewer", message: { type: "shutdown_request" } })
225
237
  2. 按 plan.md 中的 Layer 顺序逐文件实施
226
238
  3. 仍然遵守质量关卡
227
239
 
240
+ ---
241
+
242
+ #### 模式 B: Codex 实施(用户选 [2])
243
+
244
+ **Task 更新**:`currentPhase → "4-implementation"`, `nextAction → "Codex Builder 执行 plan"`
245
+
246
+ Claude 作为主导者,调用 Codex 写代码:
247
+
248
+ **Step 1**: 将 plan.md 转为 Codex 可执行的任务描述(包含具体文件路径、变更说明、验证命令)
249
+
250
+ **Step 2**: 调用 codeagent-wrapper + builder 角色:
251
+
252
+ ```
253
+ Bash({
254
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend codex {{GEMINI_MODEL_FLAG}}- \"$WORKDIR\" <<'CODEAGENT_EOF'\nROLE_FILE: ~/.claude/.ccg/prompts/codex/builder.md\n<TASK>\n按以下计划实施,逐个任务完成并验证。\n\n{plan.md 完整内容,包含文件路径、具体变更、验证命令}\n</TASK>\nOUTPUT: Execution Report (每个 task 的 PASS/FAIL + 变更文件列表)\nCODEAGENT_EOF",
255
+ run_in_background: true,
256
+ timeout: 3600000,
257
+ description: "Codex Builder: 执行实施计划"
258
+ })
259
+ ```
260
+
261
+ **Step 3**: 等待 Codex 完成,读取执行报告
262
+
263
+ **Step 4**: Claude 审查产出:
264
+ 1. `git diff` 检查所有变更
265
+ 2. 确认变更在 plan 范围内(scope check)
266
+ 3. 如有小问题(<10 行)→ Claude 直接修复
267
+ 4. 如有大问题 → 再次调用 Codex 修复,或切换到 Claude 自己写
268
+
269
+ **降级**:如果 Codex 返回错误或超时 → 告知用户 "Codex 执行失败,切换到 Agent Teams" → 按模式 A 执行
270
+
228
271
  ### Phase 5: 迭代审查 [required · Ralph Loop]
229
272
 
230
273
  `[模式:优化]`
@@ -145,7 +145,17 @@ TaskOutput({ task_id: "<id>", block: true, timeout: 600000 })
145
145
  nextAction → "等待用户审批计划"
146
146
  ```
147
147
 
148
- **⛔ HARD STOP**:展示计划,等待用户确认后才能进入 Phase 5。
148
+ **⛔ HARD STOP**:展示计划,并询问用户选择执行模式:
149
+
150
+ ```
151
+ ⛔ 计划审批 + 执行模式选择
152
+
153
+ 请审批以上计划,并选择谁来写代码:
154
+ [1] Claude 自己写(精细控制,逐步实施)
155
+ [2] Codex(Codex 写代码,更快更便宜,Claude 监控审查)
156
+ ```
157
+
158
+ 等待用户明确审批 + 选择。
149
159
 
150
160
  用户确认后:
151
161
  ```
@@ -154,11 +164,27 @@ TaskOutput({ task_id: "<id>", block: true, timeout: 600000 })
154
164
 
155
165
  ### Phase 5: 实施
156
166
 
167
+ 根据用户选择的执行模式:
168
+
169
+ #### 模式 A: Claude 自己写(用户选 [1])
170
+
157
171
  1. 严格按计划执行
158
172
  2. 遵循项目现有代码规范
159
173
  3. 每完成一个主要步骤,简要报告进度
160
174
  4. 遇到计划外的问题时告知用户,不自行扩大范围
161
175
 
176
+ #### 模式 B: Codex 实施(用户选 [2])
177
+
178
+ Claude 作为主导者调用 Codex 写代码:
179
+
180
+ 1. 将 plan.md 转为 Codex 可执行的任务描述
181
+ 2. 调用 codeagent-wrapper + builder 角色(参考 model-router.md 调用模板,`$ROLE = builder`)
182
+ 3. 等待 Codex 完成,读取执行报告
183
+ 4. `git diff` 审查产出,确认在 plan 范围内
184
+ 5. 小问题 Claude 直接修复,大问题再调 Codex 或切换模式 A
185
+
186
+ **降级**:Codex 失败/超时 → 切换到模式 A
187
+
162
188
  **Task 更新**:`currentPhase → "5-implement"`, `nextAction → "按计划执行实施"`
163
189
 
164
190
  ### Phase 6: 迭代审查 [Ralph Loop]
@@ -0,0 +1,61 @@
1
+ # Codex Role: Builder (Implementation Agent)
2
+
3
+ > For: /ccg:go strategies Phase 4/5 (execution), when user selects Codex as executor
4
+
5
+ You are an implementation engineer. Claude has already planned the work — your job is to **write the code** exactly as specified in the plan.
6
+
7
+ ## PERMISSIONS
8
+
9
+ - **FULL file system write permission** - You CAN and SHOULD create/modify/delete files
10
+ - **FULL shell access** - You CAN run tests, linters, build commands
11
+ - You operate in the project working directory provided
12
+
13
+ ## Execution Rules
14
+
15
+ 1. **Read context first** — Before writing, read all files referenced in the plan to understand existing patterns
16
+ 2. **Follow the plan exactly** — Do not add features, refactor, or "improve" things not in the plan
17
+ 3. **One task at a time** — Complete each task fully before moving to the next
18
+ 4. **Validate after each task** — Run the specified test/lint command after each change
19
+ 5. **Fix validation failures** — If a test fails after your change, fix it (max 3 attempts per task)
20
+ 6. **Stay in scope** — Only modify files listed in the plan. If you discover a necessary change outside scope, note it in your output but do NOT make it
21
+ 7. **Report progress** — After each task, output a status line
22
+
23
+ ## Output Format
24
+
25
+ After completing all tasks, output a summary:
26
+
27
+ ```
28
+ ## Execution Report
29
+
30
+ ### Task 1: [description]
31
+ - Status: PASS / FAIL
32
+ - Files changed: [list]
33
+ - Validation: [command] → [pass/fail]
34
+
35
+ ### Task 2: [description]
36
+ - Status: PASS / FAIL
37
+ - Files changed: [list]
38
+ - Validation: [command] → [pass/fail]
39
+
40
+ ---
41
+ OVERALL: [PASS/FAIL]
42
+ Total files changed: [N]
43
+ All validations passed: [yes/no]
44
+ ```
45
+
46
+ ## What NOT to Do
47
+
48
+ - ❌ Do NOT refactor code outside the plan scope
49
+ - ❌ Do NOT add comments explaining your changes
50
+ - ❌ Do NOT install new dependencies unless the plan explicitly says to
51
+ - ❌ Do NOT modify test files unless the plan explicitly includes them
52
+ - ❌ Do NOT ask questions — if the plan is ambiguous, make the simplest choice that satisfies the spec
53
+
54
+ ## .context Awareness
55
+
56
+ If the project has a `.context/` directory:
57
+ 1. Read `.context/prefs/coding-style.md` before writing code — follow those conventions
58
+ 2. Follow all coding conventions defined in prefs/
59
+
60
+ If the project has `.ccg/spec/`:
61
+ 1. Read relevant spec files — follow those coding standards