ccgx-workflow 1.0.4 → 1.0.5

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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.mjs +180 -2
  3. package/dist/index.mjs +3 -2
  4. package/dist/shared/{ccgx-workflow.Bl0vlpC_.mjs → ccgx-workflow.CZSjTyQd.mjs} +22 -13
  5. package/package.json +1 -1
  6. package/templates/commands/agents/code-fixer.md +1 -1
  7. package/templates/commands/agents/codebase-mapper.md +1 -1
  8. package/templates/commands/agents/debug-session-manager.md +1 -1
  9. package/templates/commands/agents/debugger.md +1 -1
  10. package/templates/commands/agents/interface-auditor.md +8 -8
  11. package/templates/commands/agents/phase-runner.md +27 -27
  12. package/templates/commands/agents/plan-checker.md +4 -4
  13. package/templates/commands/analyze.md +10 -10
  14. package/templates/commands/autonomous.md +45 -46
  15. package/templates/commands/cancel.md +8 -8
  16. package/templates/commands/codex-exec.md +2 -2
  17. package/templates/commands/debate.md +5 -5
  18. package/templates/commands/debug.md +8 -8
  19. package/templates/commands/execute.md +6 -6
  20. package/templates/commands/init.md +1 -1
  21. package/templates/commands/optimize.md +10 -10
  22. package/templates/commands/plan.md +15 -15
  23. package/templates/commands/result.md +1 -1
  24. package/templates/commands/review.md +49 -36
  25. package/templates/commands/spec-impl.md +1 -1
  26. package/templates/commands/spec-plan.md +2 -2
  27. package/templates/commands/spec-research.md +1 -1
  28. package/templates/commands/spec-review.md +1 -1
  29. package/templates/commands/status.md +15 -15
  30. package/templates/commands/team-exec.md +1 -1
  31. package/templates/commands/team.md +6 -6
  32. package/templates/commands/test.md +9 -9
  33. package/templates/commands/verify-work.md +8 -8
  34. package/templates/commands/verify.md +3 -3
  35. package/templates/commands/workflow.md +2 -2
  36. package/templates/rules/ccg-skills.md +1 -1
  37. package/templates/scripts/ccgx-call-plugin.mjs +324 -0
  38. package/templates/skills/tools/extract-learnings/SKILL.md +1 -3
  39. package/templates/skills/tools/forensics/SKILL.md +0 -2
  40. package/templates/skills/tools/health/SKILL.md +0 -2
  41. package/templates/skills/tools/map-codebase/SKILL.md +0 -2
  42. package/templates/skills/tools/verify-change/SKILL.md +2 -2
  43. package/templates/skills/tools/verify-module/SKILL.md +2 -2
  44. package/templates/skills/tools/verify-quality/SKILL.md +2 -2
  45. package/templates/skills/tools/verify-security/SKILL.md +2 -2
@@ -13,7 +13,7 @@ argument-hint: "<优化目标> [--role=architect|critic|implementer|tester|write
13
13
  /optimize <优化目标> [--role=<name>]
14
14
  ```
15
15
 
16
- ## Role-based routing(v4.1 specialist matrix)
16
+ ## Role-based routing(specialist matrix)
17
17
 
18
18
  可选 `--role=<name>` 叠加 role 维度路由:
19
19
 
@@ -23,7 +23,7 @@ argument-hint: "<优化目标> [--role=architect|critic|implementer|tester|write
23
23
  | **frontend** | gemini/architect.md | gemini/reviewer.md (adversarial) | gemini/architect.md | gemini/tester.md | gemini/analyzer.md |
24
24
  | **fullstack** | codex+gemini/architect.md | both reviewer.md (adversarial) | runner 决 | runner 决 | claude |
25
25
 
26
- **未传 --role 时按 v4.0 双模型并行({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}} optimizer.md),完全兼容**。`--role=critic` 触发"性价比反对意见"——挑战通用优化套路(如盲目缓存 / over-engineering)。详见 `src/utils/specialist-router.ts`。
26
+ **未传 --role 时按双模型并行({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}} optimizer.md),完全兼容**。`--role=critic` 触发"性价比反对意见"——挑战通用优化套路(如盲目缓存 / over-engineering)。详见 `src/utils/specialist-router.ts`。
27
27
 
28
28
  ## 上下文
29
29
 
@@ -40,12 +40,12 @@ argument-hint: "<优化目标> [--role=architect|critic|implementer|tester|write
40
40
 
41
41
  ---
42
42
 
43
- ## 调用通道路由(v4.1 Phase 20,CCG codeagent 退役)
43
+ ## 调用通道路由(CCG codeagent 退役)
44
44
 
45
- CCG v4.1 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn:
45
+ CCG 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn:
46
46
 
47
47
  1. **优先 plugin spawn**(默认):装了 `codex@openai-codex` + `gemini@google-gemini` plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行,主线接 ≤200 token 摘要。
48
- 2. **降级 codeagent-wrapper**(v4.0 BC fallback):plugin 未装 → fallback 到 Bash 调用,行为与 v4.0 完全一致。
48
+ 2. **降级 codeagent-wrapper**(BC fallback):plugin 未装 → fallback 到 Bash 调用,行为与 plugin 路径等价。
49
49
 
50
50
  **判定**:preflight `Bash` 跑 `ls ~/.claude/plugins/` 看有无 `codex@*` / `gemini@*` 子目录。helper 见 `src/utils/plugin-detection.ts`。
51
51
 
@@ -60,7 +60,7 @@ CCG v4.1 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**
60
60
  - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
61
61
  - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
62
62
 
63
- **调用语法**(v4.1 Phase 20 双通道):
63
+ **调用语法**(双通道):
64
64
 
65
65
  **通道 A — plugin spawn(默认)**:
66
66
 
@@ -101,7 +101,7 @@ EOF",
101
101
  })
102
102
  ```
103
103
 
104
- > ⚠️ 通道 B `codeagent-wrapper` 在 v4.1 已标 **deprecated**,将在 v5.0 移除。
104
+ > ⚠️ 通道 B `codeagent-wrapper` 已标 **deprecated**。
105
105
 
106
106
  **角色提示词**:
107
107
 
@@ -110,7 +110,7 @@ EOF",
110
110
  | 后端 | `~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/optimizer.md` |
111
111
  | 前端 | `~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/optimizer.md` |
112
112
 
113
- **并行调用 + 事件驱动等待(v4.5.2 起)**:
113
+ **并行调用 + 事件驱动等待**:
114
114
 
115
115
  1. 同 message 内 spawn 多个 `Bash(run_in_background: true)` 并行任务
116
116
  2. spawn 完后主线说明已启动 task-id,**直接 turn end**,**不调 TaskOutput**
@@ -119,7 +119,7 @@ EOF",
119
119
  5. **必须等所有相关 task 都收到通知**才进入下一阶段(按 task-id 计数已收齐)
120
120
 
121
121
  ⛔ **禁止**:
122
- - 调 `TaskOutput({block: true, timeout: 600000})` —— v4.5.1 之前的旧 freeze poll 模式,已废弃
122
+ - 调 `TaskOutput({block: true, timeout: 600000})` —— freeze poll 模式,已废弃
123
123
  - 收到部分通知就跳过等其他模型
124
124
  - 主动 Kill task
125
125
 
@@ -165,7 +165,7 @@ EOF",
165
165
  - 需求:分析前端性能问题(Core Web Vitals)
166
166
  - OUTPUT:性能瓶颈列表、优化方案、预期收益
167
167
 
168
- 事件驱动等待 (v4.5.2):spawn 完两个 Bash bg 后主线 turn end,等 task-notification 自动唤醒。**必须等所有模型返回后才能进入下一阶段**。
168
+ 事件驱动等待:spawn 完两个 Bash bg 后主线 turn end,等 task-notification 自动唤醒。**必须等所有模型返回后才能进入下一阶段**。
169
169
 
170
170
  **务必遵循上方 `多模型调用规范` 的 `重要` 指示**
171
171
 
@@ -9,9 +9,9 @@ $ARGUMENTS
9
9
 
10
10
  ---
11
11
 
12
- ## Role-based routing(v4.1 specialist matrix)
12
+ ## Role-based routing(specialist matrix)
13
13
 
14
- 可选参数 `--role=<name>` 在 v4.0 的 backend/frontend layer 路由之上叠加 **role 维度**,自动选择更精准的 prompt 文件。**未传 `--role` 时按现状路由({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}}),完全保留 v4.0 行为兼容**——无破坏性变更。
14
+ 可选参数 `--role=<name>` 在 backend/frontend layer 路由之上叠加 **role 维度**,自动选择更精准的 prompt 文件。**未传 `--role` 时按现状路由({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}}),完全保留默认行为兼容**——无破坏性变更。
15
15
 
16
16
  **Role × Layer 路由矩阵**:
17
17
 
@@ -23,11 +23,11 @@ $ARGUMENTS
23
23
 
24
24
  **判定流程**:
25
25
 
26
- 1. **解析 layer**:根据 $ARGUMENTS 涉及文件类型推断 `backend` / `frontend` / `fullstack`(与 v4.0 现有逻辑一致)。
27
- 2. **解析 role**:从 $ARGUMENTS 提取 `--role=<name>`(5 个合法值:`architect` / `critic` / `implementer` / `tester` / `writer`),不存在或非法值 → fallback v4.0 模型路由。
26
+ 1. **解析 layer**:根据 $ARGUMENTS 涉及文件类型推断 `backend` / `frontend` / `fullstack`。
27
+ 2. **解析 role**:从 $ARGUMENTS 提取 `--role=<name>`(5 个合法值:`architect` / `critic` / `implementer` / `tester` / `writer`),不存在或非法值 → fallback 默认模型路由。
28
28
  3. **选 prompt 文件**:按矩阵查 `(role, layer)` 单元格 → ROLE_FILE 路径。
29
29
  4. **adversarial 标记**:role=critic 时,prompt 段额外注入 "deliberately hunt for flaws / contradict majority view" 指令,触发敌对审查模式。
30
- 5. **runner 决**:fullstack × {implementer, tester} 时,per-file 选 codex 或 gemini(同 v4.0 phase-runner Type 路由逻辑)。
30
+ 5. **runner 决**:fullstack × {implementer, tester} 时,per-file 选 codex 或 gemini(同 phase-runner Type 路由逻辑)。
31
31
 
32
32
  **示例**:
33
33
 
@@ -50,18 +50,18 @@ $ARGUMENTS
50
50
 
51
51
  ---
52
52
 
53
- ## 调用通道路由(v4.1 Phase 20,CCG codeagent 退役)
53
+ ## 调用通道路由(CCG codeagent 退役)
54
54
 
55
- CCG v4.1 把 6 核心命令的"双模型并行"通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn。判定流程:
55
+ CCG 把 6 核心命令的"双模型并行"通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn。判定流程:
56
56
 
57
57
  1. **优先 plugin spawn 路径**(默认):用户已装 `codex@openai-codex` 和 `gemini@google-gemini` plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行 spawn,主线只接 plugin 自家 ≤200 token 摘要协议(`STATUS: ... / FINDINGS: ... / NOTES: ...`)。
58
- 2. **降级 codeagent-wrapper 路径**(v4.0 BC fallback):plugin 未装 → fallback 到 `Bash(~/.claude/bin/codeagent-wrapper --backend ... resume ... <<'EOF' ... EOF)`,与 v4.0 行为完全一致。
58
+ 2. **降级 codeagent-wrapper 路径**(BC fallback):plugin 未装 → fallback 到 `Bash(~/.claude/bin/codeagent-wrapper --backend ... resume ... <<'EOF' ... EOF)`,与 plugin 路径行为等价。
59
59
 
60
60
  **判断方法**:preflight 用 `Bash` 跑 `ls ~/.claude/plugins/ 2>/dev/null | grep -E '^codex@'` 与 `... | grep -E '^gemini@'` 各一次。匹配到对应行 → plugin 已装。两个 plugin 独立判定,可分别 mix-and-match(仅 codex plugin 装了 → backend 走 plugin、frontend 走 codeagent)。
61
61
 
62
62
  **单一真相源**:plugin 检测逻辑 helper 见 `src/utils/plugin-detection.ts`(导出 `detectPlugin` / `detectPluginAvailability` / `bothPluginsInstalled`)。命令模板把判定结果渲染到执行计划,`Agent(...)` 调用与 `Bash(...)` 调用的具体语法见下面"多模型调用规范"段。
63
63
 
64
- **为什么默认 plugin**:v4.0.1 nested-spawn 测试证明 plugin advisor 摘要协议(≤200 token)压制了 codeagent stdout 全文回灌主线的痛点,主线 context 增量从 +5%/调用 降到 +1.5%/调用。详见 `.ccg-research/07-multimodel-collaboration-rethink.md`。
64
+ **为什么默认 plugin**:nested-spawn 测试证明 plugin advisor 摘要协议(≤200 token)压制了 codeagent stdout 全文回灌主线的痛点,主线 context 增量从 +5%/调用 降到 +1.5%/调用。详见 `.ccg-research/07-multimodel-collaboration-rethink.md`。
65
65
 
66
66
  ⚠️ **重要**:本命令本身不在 subagent context 内(主线命令),**可以**调 `Agent(...)` 工具——这跟 `phase-runner` 等 subagent 的"引擎层禁止嵌套 spawn Agent"约束不冲突。
67
67
 
@@ -74,7 +74,7 @@ CCG v4.1 把 6 核心命令的"双模型并行"通道从 `Bash(codeagent-wrapper
74
74
  - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
75
75
  - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
76
76
 
77
- **调用语法**(v4.1 Phase 20 双通道):
77
+ **调用语法**(双通道):
78
78
 
79
79
  **通道 A — plugin spawn(默认)**:
80
80
 
@@ -115,7 +115,7 @@ EOF",
115
115
  })
116
116
  ```
117
117
 
118
- > ⚠️ 通道 B 走 `codeagent-wrapper`(Node 脚本 `templates/scripts/invoke-model.mjs`),v4.1 已标 **deprecated**,将在 v5.0 移除。建议用户安装 codex/gemini plugin 享受 v4.1 主线 context 优化。
118
+ > ⚠️ 通道 B 走 `codeagent-wrapper`(Node 脚本 `templates/scripts/invoke-model.mjs`),已标 **deprecated**,建议用户安装 codex/gemini plugin 享受主线 context 优化。
119
119
 
120
120
  **角色提示词**:
121
121
 
@@ -126,7 +126,7 @@ EOF",
126
126
 
127
127
  **会话复用**:每次调用返回 `SESSION_ID: xxx`(通常由 wrapper 输出),**必须保存**以供后续 `/ccg:execute` 使用。
128
128
 
129
- **事件驱动等待(v4.5.2 起)**:spawn 后主线说明 task-id 然后 **turn end**,引擎自动 `<task-notification>` 触发新 turn 处理结果。**不调 TaskOutput**。
129
+ **事件驱动等待**:spawn 后主线说明 task-id 然后 **turn end**,引擎自动 `<task-notification>` 触发新 turn 处理结果。**不调 TaskOutput**。
130
130
 
131
131
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` 旧 freeze poll 模式 / Kill task。
132
132
 
@@ -192,7 +192,7 @@ EOF",
192
192
  - 关注:UI/UX 影响、用户体验、视觉设计
193
193
  - OUTPUT: 多角度解决方案 + 优劣势分析
194
194
 
195
- 事件驱动等待 (v4.5.2):spawn 完两个 Bash bg 后主线 turn end,等 task-notification 自动唤醒。**📌 保存 SESSION_ID**(`CODEX_SESSION` 和 `GEMINI_SESSION`)。
195
+ 事件驱动等待:spawn 完两个 Bash bg 后主线 turn end,等 task-notification 自动唤醒。**📌 保存 SESSION_ID**(`CODEX_SESSION` 和 `GEMINI_SESSION`)。
196
196
 
197
197
  #### 2.2 交叉验证
198
198
 
@@ -251,7 +251,7 @@ EOF",
251
251
  - GEMINI_SESSION: <session_id>
252
252
  ```
253
253
 
254
- ### 🛡 Phase 2.5:自动 plan-checker 校验(5 维度 + max-3-loop,CCG v4.0 Phase 6
254
+ ### 🛡 Phase 2.5:自动 plan-checker 校验(5 维度 + max-3-loop)
255
255
 
256
256
  写出 `.claude/plan/<功能名>.md` 后、向用户交付前,**必须**自动 spawn `plan-checker` agent 做 5 维度强校验:
257
257
 
@@ -289,7 +289,7 @@ if loop_count == 3 and result.hasBlocker:
289
289
 
290
290
  1. 向用户展示完整实施计划(含伪代码)+ plan-checker 报告摘要(BLOCKER/WARNING 数量 + verdict)
291
291
  2. 将计划保存至 `.claude/plan/<功能名>.md`(功能名从需求中提取,如 `user-auth`、`payment-module` 等)
292
- 3. **写 phase-scoped CONTEXT.md**(v4.0 Phase 2 状态机):把本次 plan 的冻结决策固化到 `.context/<phase>/CONTEXT.md`,下游 `/ccg:execute` 与 `/ccg:team-exec` 仅读此文件的 YAML frontmatter 即可获得全部决策(< 200 tokens / phase)。**目录约定**:`<phase>` 取计划文件主名(如 `user-auth`),用 `sanitizePhase()` 规范化非法字符。
292
+ 3. **写 phase-scoped CONTEXT.md**(状态机):把本次 plan 的冻结决策固化到 `.context/<phase>/CONTEXT.md`,下游 `/ccg:execute` 与 `/ccg:team-exec` 仅读此文件的 YAML frontmatter 即可获得全部决策(< 200 tokens / phase)。**目录约定**:`<phase>` 取计划文件主名(如 `user-auth`),用 `sanitizePhase()` 规范化非法字符。
293
293
 
294
294
  **CONTEXT.md 必含 frontmatter 字段(机器可读契约)**:
295
295
  ```yaml
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: '取后台任务最终结果:读取 .context/jobs/<id>/result.md,输出 ≤ 200 token 摘要(v4.0 异步三件套)'
2
+ description: '取后台任务最终结果:读取 .context/jobs/<id>/result.md,输出 ≤ 200 token 摘要'
3
3
  argument-hint: "<job-id>"
4
4
  allowed-tools:
5
5
  - Read
@@ -5,7 +5,7 @@ argument-hint: "[代码或描述] [--adversarial] [--fix [--all] [--auto]] [--ro
5
5
 
6
6
  # Review - 多模型代码审查
7
7
 
8
- ## Role-based routing(v4.1 specialist matrix)
8
+ ## Role-based routing(specialist matrix)
9
9
 
10
10
  可选 `--role=<name>` 叠加 role 维度路由:
11
11
 
@@ -15,13 +15,13 @@ argument-hint: "[代码或描述] [--adversarial] [--fix [--all] [--auto]] [--ro
15
15
  | **frontend** | gemini/architect.md | gemini/reviewer.md (adversarial) | gemini/architect.md | gemini/tester.md | gemini/analyzer.md |
16
16
  | **fullstack** | codex+gemini/architect.md | both reviewer.md (adversarial) | runner 决 | runner 决 | claude |
17
17
 
18
- **未传 --role 时按 v4.0 双模型路由({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}} reviewer.md)**——完全兼容现有 `--adversarial` / `--fix` 行为。`--role=critic` 等价于隐式 `--adversarial`(语义同义)。详见 `src/utils/specialist-router.ts`。
18
+ **未传 --role 时按双模型路由({{BACKEND_PRIMARY}}/{{FRONTEND_PRIMARY}} reviewer.md)**——完全兼容现有 `--adversarial` / `--fix` 行为。`--role=critic` 等价于隐式 `--adversarial`(语义同义)。详见 `src/utils/specialist-router.ts`。
19
19
 
20
20
  ---
21
21
 
22
22
  双模型并行审查,交叉验证综合反馈。无参数时自动审查当前 git 变更。
23
23
 
24
- **v4.1 Phase 20**:双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn —— 装了 `codex@openai-codex` + `gemini@google-gemini` plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行,主线只接 ≤200 token 摘要;plugin 未装 → fallback 到 codeagent-wrapper 路径(v4.0 BC,将在 v5.0 移除)。preflight 用 `Bash` 跑 `ls ~/.claude/plugins/` 检测,helper 见 `src/utils/plugin-detection.ts`。
24
+ **双模型并行通道**:默认走 plugin spawn —— 装了 `codex@openai-codex` + `gemini@google-gemini` plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行,主线只接 ≤200 token 摘要;plugin 未装 → fallback 到 codeagent-wrapper 路径(BC fallback)。preflight 用 `Bash` 跑 `ls ~/.claude/plugins/` 检测,helper 见 `src/utils/plugin-detection.ts`。
25
25
 
26
26
  `--adversarial` 模式下额外触发第三层"敌对视角"审查,由官方 codex plugin 的 `Agent(codex:codex-rescue)` 在 fresh context 中专门挑前两轮意见的漏洞,适合极重要 PR / 安全敏感变更。需用户已装 `codex@openai-codex` plugin,否则降级为双模型审查。
27
27
 
@@ -49,36 +49,45 @@ argument-hint: "[代码或描述] [--adversarial] [--fix [--all] [--auto]] [--ro
49
49
  - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
50
50
  - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
51
51
 
52
- **调用语法**(v4.4.2 起 review/verify 路径默认走 Bash 直调):
52
+ **调用语法**(review/verify 路径默认走 Bash 直调):
53
53
 
54
54
  **通道 A — Bash 直调 plugin script(默认,绕开 sonnet wrapper)**:
55
55
 
56
- > 1.0.4 Bash 命令字符串由 install 时直接渲染(基于 `~/.claude/plugins/installed_plugins.json`
57
- > 真值源),LLM 只需 copy 整段 + 替换 `%PROMPT%` 即可。**禁止凭印象拼 `node "$(ls ...) | head -1"
58
- > task -p ...` inline 命令** —— glob hack 在 plugin 多版本 cache 下行为不可预测,且参数漂移
59
- > v4.4.1 195 处错名 bug 同型。
56
+ > 占位符 `{{CODEX_BASH_TASK}}` / `{{GEMINI_BASH_TASK}}` install 时渲染为
57
+ > `node <ccgx-call-plugin.mjs 绝对路径> <vendor> --json`。LLM **只需把 prompt
58
+ > 写入 tmpfile、追加 `--prompt-file <tmpfile>`、运行**。helper 内部处理路径解析、
59
+ > spawn array args、shell escape 全部规避——LLM 不参与任何命令构造。
60
60
 
61
- ```
62
- # 后端审查(codex 视角)
63
- Bash({
64
- command: `{{CODEX_BASH_TASK}}`, ← install 时已渲染为完整命令,含 heredoc 安全 prompt 注入
65
- description: "Review: backend (codex direct)",
66
- run_in_background: true,
67
- timeout: 3600000
68
- })
61
+ **LLM 工作流(严格 3 步)**:
69
62
 
70
- # 前端审查(gemini 视角)
71
- Bash({
72
- command: `{{GEMINI_BASH_TASK}}`,
73
- description: "Review: frontend (gemini direct)",
74
- run_in_background: true,
75
- timeout: 3600000
76
- })
63
+ ```
64
+ Step 1. 用 Write 工具把完整 prompt 写到 tmpfile
65
+ Write({ file_path: "/tmp/ccg-review-codex-$JOB.txt", content: "<完整 prompt>" })
66
+ Write({ file_path: "/tmp/ccg-review-gemini-$JOB.txt", content: "<完整 prompt>" })
67
+
68
+ Step 2. 用 Bash 调 helper(占位符已渲染):
69
+ Bash({
70
+ command: `{{CODEX_BASH_TASK}} --prompt-file /tmp/ccg-review-codex-$JOB.txt`,
71
+ description: "Review: backend (codex direct)",
72
+ run_in_background: true,
73
+ timeout: 3600000
74
+ })
75
+ Bash({
76
+ command: `{{GEMINI_BASH_TASK}} --prompt-file /tmp/ccg-review-gemini-$JOB.txt`,
77
+ description: "Review: frontend (gemini direct)",
78
+ run_in_background: true,
79
+ timeout: 3600000
80
+ })
81
+
82
+ Step 3. 等 task-notification 通知后 Read 各自 stdout(即 helper 输出的 JSON),parse
83
+ `result.stdout` 拿真实 plugin 输出,再按 plugin --json schema 解析。
77
84
  ```
78
85
 
79
- LLM 消费协议:把上面命令字符串里的 `%PROMPT%` 替换为完整 prompt 文本(含 ROLE_FILE 引用 +
80
- TASK 描述 + OUTPUT 要求),**不要在外面加任何 escape**——heredoc `<<'CCG_PROMPT_EOF'`
81
- 的单引号 delimiter 已保证 `$` / `'` / `"` / `\` 全部按字面量处理。
86
+ **严禁** 任何形式自拼命令:
87
+ - 不要写 `node "$(ls ...)/codex-companion.mjs"`
88
+ - 不要 `cat <<EOF`、不要 heredoc、不要 `-p "..."` 内联 prompt
89
+ - 不要硬编码 plugin 路径——helper 内部解析 SSoT
90
+ - **唯一允许**:copy 占位符内容 + 追加 `--prompt-file <tmpfile>`
82
91
 
83
92
  ⛔ **不要**用 `Agent(subagent_type="codex:codex-rescue"|"gemini:gemini-rescue")`:
84
93
 
@@ -114,7 +123,7 @@ EOF",
114
123
  })
115
124
  ```
116
125
 
117
- > ⚠️ 通道 B `codeagent-wrapper` 在 v4.1 已标 **deprecated**,将在 v5.0 移除。
126
+ > ⚠️ 通道 B `codeagent-wrapper` 已标 **deprecated**。
118
127
 
119
128
  **角色提示词**:
120
129
 
@@ -123,7 +132,7 @@ EOF",
123
132
  | 后端 | `~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md` |
124
133
  | 前端 | `~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md` |
125
134
 
126
- **并行调用 + 事件驱动等待(v4.5.2 起)**:
135
+ **并行调用 + 事件驱动等待**:
127
136
 
128
137
  1. 在同一 message 内 spawn 两个(或多个)`Bash(run_in_background: true)` 并行任务
129
138
  2. spawn 完成后主线说明已启动哪些 task(含 task-id),然后**直接 turn end**,**不调 TaskOutput**
@@ -135,7 +144,7 @@ EOF",
135
144
  5. **必须等所有相关 task 都收到通知**才进入下一阶段(主线按 task-id 计数已收齐)
136
145
 
137
146
  ⛔ **禁止做**:
138
- - 调 `TaskOutput({block: true, timeout: 600000})` —— 这会 freeze 主线 10 分钟,且超时后还要轮询,体验极差(v4.5.1 之前的旧模式,已废弃)
147
+ - 调 `TaskOutput({block: true, timeout: 600000})` —— 这会 freeze 主线 10 分钟,且超时后还要轮询,体验极差(旧模式,已废弃)
139
148
  - 收到部分通知就跳过等其他模型
140
149
  - 主动 Kill task
141
150
 
@@ -187,15 +196,19 @@ EOF",
187
196
  调用方式(Bash 直调,绕开 sonnet wrapper):
188
197
 
189
198
  ```
190
- Bash({
191
- command: `{{CODEX_BASH_TASK}}`, ← 同上,install 时渲染为完整命令
192
- description: "Adversarial review (codex direct)",
193
- run_in_background: true,
194
- timeout: 3600000
195
- })
199
+ Step 1. 用 Write 把以下 adversarial prompt 写入 tmpfile:
200
+ Write({ file_path: "/tmp/ccg-review-adv-$JOB.txt", content: <见下方 prompt body> })
201
+
202
+ Step 2. 调 helper:
203
+ Bash({
204
+ command: `{{CODEX_BASH_TASK}} --prompt-file /tmp/ccg-review-adv-$JOB.txt`,
205
+ description: "Adversarial review (codex direct)",
206
+ run_in_background: true,
207
+ timeout: 3600000
208
+ })
196
209
  ```
197
210
 
198
- 把命令里的 `%PROMPT%` 替换为以下完整 prompt 文本(heredoc 已保证字面量传递,不需要 escape):
211
+ **Adversarial prompt body**(写入 tmpfile 的内容):
199
212
 
200
213
  ```
201
214
  --adversarial-review
@@ -100,7 +100,7 @@ description: '按规范执行 + 多模型协作 + 归档'
100
100
  })
101
101
  ```
102
102
 
103
- **Step 7.2 (v4.5.2 事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 7.3。
103
+ **Step 7.2 (事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 7.3。
104
104
 
105
105
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
106
106
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -50,7 +50,7 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
50
50
  })
51
51
  ```
52
52
 
53
- **Step 2.2 (v4.5.2 事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 2.3。
53
+ **Step 2.2 (事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 2.3。
54
54
 
55
55
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
56
56
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -158,7 +158,7 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
158
158
  "Plan phase complete. Artifacts generated: specs.md, design.md, tasks.md. Run `/ccg:spec-impl` to start implementation."
159
159
  Do NOT proceed to modify source code.
160
160
 
161
- 5.5. **自动 plan-checker 校验(5 维度 + max-3-loop,CCG v4.0 Phase 6)**
161
+ 5.5. **自动 plan-checker 校验(5 维度 + max-3-loop)**
162
162
 
163
163
  生成 OPSX artifacts 后,**必须**自动 spawn `plan-checker` agent 对 specs.md / design.md / tasks.md 做 5 维度校验:
164
164
 
@@ -89,7 +89,7 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
89
89
  })
90
90
  ```
91
91
 
92
- **Step 4.2 (v4.5.2 事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 4.3。
92
+ **Step 4.2 (事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 4.3。
93
93
 
94
94
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
95
95
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -51,7 +51,7 @@ description: '双模型交叉审查(独立工具,随时可用)'
51
51
  })
52
52
  ```
53
53
 
54
- **Step 3.2 (v4.5.2 事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 3.3。
54
+ **Step 3.2 (事件驱动)**: spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进 step 3.3。
55
55
 
56
56
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
57
57
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: '后台任务观测:列表 / 单查 / 阻塞等待 / dashboard / tail 流式 / 卡点检测 / 单 phase cancel(v4.5 P7 升级)'
2
+ description: '后台任务观测:列表 / 单查 / 阻塞等待 / dashboard / tail 流式 / 卡点检测 / 单 phase cancel'
3
3
  argument-hint: "[<job-id>] [--wait --timeout-ms <ms>] [--tail <job-id>] [--cancel <phase-id>]"
4
4
  allowed-tools:
5
5
  - Read
@@ -7,9 +7,9 @@ allowed-tools:
7
7
  - Glob
8
8
  ---
9
9
 
10
- # Status — 后台任务观测(v4.5 dashboard + tail)
10
+ # Status — 后台任务观测(dashboard + tail)
11
11
 
12
- CCG v4.5 起 phase-runner 走 Bash subprocess(`claude -p --output-format stream-json ...`),stream 落盘到 `<workdir>/.context/jobs/<job-id>/progress.jsonl`。失去 sidechain inline UI 后,本命令是用户**唯一**的微观干预入口,必须复刻这四个长跑场景:
12
+ phase-runner 走 Bash subprocess(`claude -p --output-format stream-json ...`),stream 落盘到 `<workdir>/.context/jobs/<job-id>/progress.jsonl`。失去 sidechain inline UI 后,本命令是用户**唯一**的微观干预入口,必须复刻这四个长跑场景:
13
13
 
14
14
  | 场景 | 模式 |
15
15
  |------|------|
@@ -33,8 +33,8 @@ CCG v4.5 起 phase-runner 走 Bash subprocess(`claude -p --output-format strea
33
33
  /ccg:status # 模式 A:列表 / dashboard
34
34
  /ccg:status <job-id> # 模式 B:单查详情
35
35
  /ccg:status <job-id> --wait --timeout-ms <ms> # 模式 C:阻塞等待
36
- /ccg:status --tail <job-id> # 模式 D:流式 tail(v4.5 新增)
37
- /ccg:status --cancel <phase-id> # 模式 E:单 phase 协作 cancel(v4.5 新增)
36
+ /ccg:status --tail <job-id> # 模式 D:流式 tail
37
+ /ccg:status --cancel <phase-id> # 模式 E:单 phase 协作 cancel
38
38
  ```
39
39
 
40
40
  ## 模式 A:Dashboard(无参数)
@@ -77,7 +77,7 @@ Phase 7 (Status v2) [============> ] 60% (12m 04s) 🛠️ edit_file
77
77
  4. 超时 → "⏱ Timeout after <X>s — job still in <status>,retry with longer --timeout-ms 或 /ccg:cancel <id>"
78
78
  5. 超时退出码 0(不视为失败)
79
79
 
80
- ## 模式 D:Tail 流式(v4.5 新增)
80
+ ## 模式 D:Tail 流式
81
81
 
82
82
  `/ccg:status --tail <job-id>` 持续读 `progress.jsonl`,单行覆写:
83
83
 
@@ -130,7 +130,7 @@ done
130
130
 
131
131
  每次 tail 前调 `detectStuck` 注入 banner(loop / slow-tool / stalled 三类警告)。
132
132
 
133
- ## 模式 E:单 phase 协作 cancel(v4.5 新增)
133
+ ## 模式 E:单 phase 协作 cancel
134
134
 
135
135
  `/ccg:status --cancel <phase-id>` 流程:
136
136
 
@@ -138,7 +138,7 @@ done
138
138
  2. 写 `.context/jobs/<job-id>/cancel.flag` —— 内容 `phase=<phase-id>\nrequested-at=<iso>`
139
139
  3. 翻 `state.cancel_requested=true`
140
140
  4. **5 秒 grace 等待** —— 给 phase-runner 子进程读 cancel.flag 优雅退出
141
- 5. 5s 后子进程仍 running → 调用 `killProcessTree({ pid: state.cli_pid, pgid: state.process_group_id, graceMs: 5000 })`(来自 `src/utils/process-tree.ts`,v4.5 P1b 已落地,P1f wired)
141
+ 5. 5s 后子进程仍 running → 调用 `killProcessTree({ pid: state.cli_pid, pgid: state.process_group_id, graceMs: 5000 })`(来自 `src/utils/process-tree.ts`)
142
142
  6. 输出最终结果:`canceled gracefully` / `force-killed pid=N` / `not found`
143
143
 
144
144
  **实施样板**(主线 LLM 用 Bash + node -e 调用 helper):
@@ -187,20 +187,20 @@ const { renderJsonl, progressBar, formatElapsed } = require('~/.claude/.ccg/dist
187
187
  // 卡点检测
188
188
  const { detectStuck, hasStuckWarning } = require('~/.claude/.ccg/dist/index.mjs')
189
189
 
190
- // 已有 v4.0 helper
190
+ // job helper
191
191
  const { listJobs, getJob, requestCancel } = require('~/.claude/.ccg/dist/index.mjs')
192
192
  ```
193
193
 
194
194
  源码真相:
195
195
  - `src/utils/jobs.ts` — `listJobs / getJob / requestCancel`
196
- - `src/utils/stream-renderer.ts`(v4.5 P7) — `renderJsonl / renderEvent / progressBar / formatElapsed`
197
- - `src/utils/stuck-detector.ts`(v4.5 P7) — `detectStuck / hasStuckWarning`
198
- - `src/utils/process-tree.ts`(v4.5 P1b 落地 + P1f wired) — `killProcessTree / sampleProcessRssMb / writeDegradedFlag / readDegradedFlag / reconcileStaleJobs`
196
+ - `src/utils/stream-renderer.ts` — `renderJsonl / renderEvent / progressBar / formatElapsed`
197
+ - `src/utils/stuck-detector.ts` — `detectStuck / hasStuckWarning`
198
+ - `src/utils/process-tree.ts` — `killProcessTree / sampleProcessRssMb / writeDegradedFlag / readDegradedFlag / reconcileStaleJobs`
199
199
 
200
- v4.x 暂未把 `dist/` 暴露给命令模板,主线 LLM 走 Bash + Read 等价行为:
200
+ `dist/` 未暴露给命令模板时,主线 LLM 走 Bash + Read 等价行为:
201
201
 
202
202
  - dashboard:调 `node -e` 读各 state.json + 简单进度推断 + `=`/`>`/空格手动拼字符串
203
203
  - tail:调 `node -e` 解析 ndjson + 走 `renderEvent` 等价 switch(TS helper 是真相源)
204
- - cancel:直接 `echo > cancel.flag` + sleep 5 + 调 process-tree(Phase 2 ready 后)
204
+ - cancel:直接 `echo > cancel.flag` + sleep 5 + 调 process-tree
205
205
 
206
- 升级路径见 `.ccg-migration/v4.4-to-v4.5.md` § "/ccg:status v2 升级"。
206
+ 历史升级记录见 `.ccg-migration/INTERNAL-DEV-LOG.md`。
@@ -167,7 +167,7 @@ subagent_freshness: required
167
167
 
168
168
  用 `AskUserQuestion` 让用户选择。**重试**最多再走一轮 wave 调度,第二次仍失败则强制选 2/3。
169
169
 
170
- ### Step 5.5: Frontmatter-only Summary 读取(v4.0 Phase 2 状态机)
170
+ ### Step 5.5: Frontmatter-only Summary 读取(状态机契约)
171
171
 
172
172
  **核心契约**:Lead 不接 Builder 的全部 stdout。每个 Builder 完成任务后,**必须由 Lead 读取该任务对应的 `.context/<phase>/SUMMARY.md` 的 YAML frontmatter**——不读 body,不读 builder transcript。
173
173
 
@@ -3,16 +3,16 @@ description: 'Agent Teams 8 阶段企业级工作流 - 7 角色全流程统一
3
3
  ---
4
4
  <!-- CCG:TEAM:UNIFIED:START -->
5
5
 
6
- ## 子命令路由(v4.1-p18)
6
+ ## 子命令路由
7
7
 
8
8
  `/ccg:team` 同时承载子命令调度。根据 `$ARGUMENTS` 第一个 token 路由到具体阶段:
9
9
 
10
10
  | 子命令 | 含义 | 替代旧命令 |
11
11
  |--------|------|----------|
12
12
  | `/ccg:team` (无参 / 任意非保留字) | 8 阶段全流程 | (主流程) |
13
- | `/ccg:team research <需求>` | 仅跑需求研究阶段 | `/ccg:team-research`(v4.1 删除) |
14
- | `/ccg:team plan <约束文件>` | 仅跑规划阶段 | `/ccg:team-plan`(v4.1 删除) |
15
- | `/ccg:team review [git-range]` | 仅跑双模型审查阶段 | `/ccg:team-review`(v4.1 删除) |
13
+ | `/ccg:team research <需求>` | 仅跑需求研究阶段 | `/ccg:team-research`(已删除) |
14
+ | `/ccg:team plan <约束文件>` | 仅跑规划阶段 | `/ccg:team-plan`(已删除) |
15
+ | `/ccg:team review [git-range]` | 仅跑双模型审查阶段 | `/ccg:team-review`(已删除) |
16
16
  | `/ccg:team exec <plan-file>` | 仅跑并行实施阶段 | 等价 `/ccg:team-exec` |
17
17
 
18
18
  > **路由规则**:将 `$ARGUMENTS` 拆分为 `[subcmd, ...rest]`。若 `subcmd ∈ {research, plan, review, exec}`,跳到对应 Phase(Research → Phase 1 / plan → Phase 3 / review → Phase 6 / exec → Phase 4);否则走完整 Phase 0-8。
@@ -178,7 +178,7 @@ Phase 8: INTEGRATION → Lead 全量验证 + 报告 + 清理
178
178
  })
179
179
  ```
180
180
 
181
- **事件驱动等待 (v4.5.2)**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进下一步。
181
+ **事件驱动等待**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进下一步。
182
182
 
183
183
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
184
184
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -330,7 +330,7 @@ Phase 8: INTEGRATION → Lead 全量验证 + 报告 + 清理
330
330
  })
331
331
  ```
332
332
 
333
- **事件驱动等待 (v4.5.2)**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理。**不调 TaskOutput**。两个 task 都收到通知才进 step 3。
333
+ **事件驱动等待**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理。**不调 TaskOutput**。两个 task 都收到通知才进 step 3。
334
334
 
335
335
  ⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
336
336
  ⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
@@ -13,7 +13,7 @@ argument-hint: "<测试目标> [--role=architect|critic|implementer|tester|write
13
13
  /test <测试目标> [--role=<name>]
14
14
  ```
15
15
 
16
- ## Role-based routing(v4.1 specialist matrix)
16
+ ## Role-based routing(specialist matrix)
17
17
 
18
18
  可选 `--role=<name>` 叠加 role 维度路由(默认 `tester`,可显式覆盖):
19
19
 
@@ -23,7 +23,7 @@ argument-hint: "<测试目标> [--role=architect|critic|implementer|tester|write
23
23
  | **frontend** | gemini/architect.md | gemini/reviewer.md (adversarial) | gemini/architect.md | gemini/tester.md | gemini/analyzer.md |
24
24
  | **fullstack** | codex+gemini/architect.md | both reviewer.md (adversarial) | runner 决(per-file) | runner 决(per-file) | claude |
25
25
 
26
- **未传 --role 时按 v4.0 智能路由(后端 → {{BACKEND_PRIMARY}}/tester.md,前端 → {{FRONTEND_PRIMARY}}/tester.md,全栈并行),完全兼容**。`--role=critic` 触发"测试用例反例挖掘"——专门构造打破现有测试假设的边界条件。详见 `src/utils/specialist-router.ts`。
26
+ **未传 --role 时按智能路由(后端 → {{BACKEND_PRIMARY}}/tester.md,前端 → {{FRONTEND_PRIMARY}}/tester.md,全栈并行),完全兼容**。`--role=critic` 触发"测试用例反例挖掘"——专门构造打破现有测试假设的边界条件。详见 `src/utils/specialist-router.ts`。
27
27
 
28
28
  ## 上下文
29
29
 
@@ -40,12 +40,12 @@ argument-hint: "<测试目标> [--role=architect|critic|implementer|tester|write
40
40
 
41
41
  ---
42
42
 
43
- ## 调用通道路由(v4.1 Phase 20,CCG codeagent 退役)
43
+ ## 调用通道路由(CCG codeagent 退役)
44
44
 
45
- CCG v4.1 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn:
45
+ CCG 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn:
46
46
 
47
47
  1. **优先 plugin spawn**(默认):装了 `codex@openai-codex` + `gemini@google-gemini` plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行,主线接 ≤200 token 摘要。
48
- 2. **降级 codeagent-wrapper**(v4.0 BC fallback):plugin 未装 → fallback 到 Bash 调用,行为与 v4.0 完全一致。
48
+ 2. **降级 codeagent-wrapper**(BC fallback):plugin 未装 → fallback 到 Bash 调用,行为与 plugin 路径等价。
49
49
 
50
50
  **判定**:preflight `Bash` 跑 `ls ~/.claude/plugins/` 看有无 `codex@*` / `gemini@*` 子目录。helper 见 `src/utils/plugin-detection.ts`。
51
51
 
@@ -60,7 +60,7 @@ CCG v4.1 把双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**
60
60
  - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
61
61
  - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
62
62
 
63
- **调用语法**(v4.1 Phase 20 双通道):
63
+ **调用语法**(双通道):
64
64
 
65
65
  **通道 A — plugin spawn(默认)**:
66
66
 
@@ -109,7 +109,7 @@ EOF",
109
109
  })
110
110
  ```
111
111
 
112
- > ⚠️ 通道 B `codeagent-wrapper` 在 v4.1 已标 **deprecated**,将在 v5.0 移除。
112
+ > ⚠️ 通道 B `codeagent-wrapper` 已标 **deprecated**。
113
113
 
114
114
  **角色提示词**:
115
115
 
@@ -126,7 +126,7 @@ EOF",
126
126
  | 前端 | {{FRONTEND_PRIMARY}} |
127
127
  | 全栈 | 并行执行两者 |
128
128
 
129
- **并行调用 + 事件驱动等待(v4.5.2 起)**:
129
+ **并行调用 + 事件驱动等待**:
130
130
 
131
131
  1. 同 message 内 spawn 多个 `Bash(run_in_background: true)` 并行任务
132
132
  2. spawn 完后主线说明已启动 task-id,**直接 turn end**,**不调 TaskOutput**
@@ -135,7 +135,7 @@ EOF",
135
135
  5. **必须等所有相关 task 都收到通知**才进入下一阶段(按 task-id 计数已收齐)
136
136
 
137
137
  ⛔ **禁止**:
138
- - 调 `TaskOutput({block: true, timeout: 600000})` —— v4.5.1 之前的旧 freeze poll 模式,已废弃
138
+ - 调 `TaskOutput({block: true, timeout: 600000})` —— freeze poll 模式,已废弃
139
139
  - 收到部分通知就跳过等其他模型
140
140
  - 主动 Kill task
141
141