ccgx-workflow 2.1.2 → 2.3.0
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 +2 -2
- package/dist/shared/{ccgx-workflow.dK6O-vwe.mjs → ccgx-workflow.BYuVglaM.mjs} +1 -1
- package/package.json +1 -1
- package/templates/commands/codex-exec.md +114 -68
- package/templates/commands/spec-impl.md +172 -19
- package/templates/commands/spec-plan.md +109 -13
- package/templates/commands/spec-research.md +119 -13
- package/templates/commands/spec-review.md +146 -13
- package/templates/commands/team.md +209 -22
- package/templates/commands/workflow.md +56 -21
|
@@ -70,8 +70,8 @@ TaskUpdate({ taskId: "1", owner: "architect" })
|
|
|
70
70
|
| 📜 Dev × N | Agent Teams teammates | `Agent(team_name=T, name="dev-1")` | Sonnet | 并行编码,文件隔离 |
|
|
71
71
|
| 🧪 QA | Agent Teams teammate | `Agent(team_name=T, name="qa")` | Sonnet | 写测试、跑测试、lint、typecheck |
|
|
72
72
|
| 🔬 Reviewer | Agent Teams teammate | `Agent(team_name=T, name="reviewer")` | Sonnet | 综合审查,分级判决 |
|
|
73
|
-
| 🔥 {{BACKEND_PRIMARY}} | 外部模型(非 teammate) | Bash
|
|
74
|
-
| 🔮 {{FRONTEND_PRIMARY}} | 外部模型(非 teammate) | Bash
|
|
73
|
+
| 🔥 {{BACKEND_PRIMARY}} | 外部模型(非 teammate) | 默认 `Agent(codex:codex-rescue)` / BC fallback Bash codeagent-wrapper | {{BACKEND_PRIMARY}} | 后端分析/审查(Phase 2, 6) |
|
|
74
|
+
| 🔮 {{FRONTEND_PRIMARY}} | 外部模型(非 teammate) | 默认 `Agent(gemini:gemini-rescue)` / BC fallback Bash codeagent-wrapper | {{FRONTEND_PRIMARY}} | 前端分析/审查(Phase 2, 6) |
|
|
75
75
|
|
|
76
76
|
**8 阶段流水线**
|
|
77
77
|
|
|
@@ -156,29 +156,127 @@ Phase 8: INTEGRATION → Lead 全量验证 + 报告 + 清理
|
|
|
156
156
|
1. **Team 已在 Phase 0 创建**,直接使用已有的 team_name。
|
|
157
157
|
|
|
158
158
|
2. **{{BACKEND_PRIMARY}} + {{FRONTEND_PRIMARY}} 并行分析(PARALLEL)**
|
|
159
|
-
- **CRITICAL**: 必须在一条消息中同时发起两个 Bash 调用,`run_in_background: true`。
|
|
160
159
|
|
|
161
|
-
|
|
160
|
+
**调用通道路由(CCG codeagent 退役,v2.2.0+)**
|
|
161
|
+
|
|
162
|
+
双模型并行通道从 `Bash(codeagent-wrapper)` **默认切换**为 plugin spawn:
|
|
163
|
+
|
|
164
|
+
1. **优先 plugin spawn**(默认):装了 `codex@openai-codex` + gemini plugin → 用 `Agent(subagent_type="codex:codex-rescue")` + `Agent(subagent_type="gemini:gemini-rescue")` 并行,主线接 ≤200 token 摘要。
|
|
165
|
+
2. **降级 codeagent-wrapper**(BC fallback):plugin 未装 → fallback Bash 调用,行为与 plugin 路径等价。
|
|
166
|
+
|
|
167
|
+
**判定**:preflight `Bash` 跑 `ls ~/.claude/plugins/` 看有无 `codex@*` / `gemini@*` 子目录。
|
|
168
|
+
|
|
169
|
+
- **CRITICAL**: 必须在一条消息中同时发起两个并行调用。
|
|
170
|
+
|
|
171
|
+
**⚠ 预备动作(spawn 前必须执行)**:`codex:codex-rescue` / `gemini:gemini-rescue` 是 thin forwarder,不会主动 Read 路径文件。主线必须在 spawn 前先 Read 两个角色提示词文件,把**内容**直接拼入下方 Agent prompt 的 `<role>` 块。
|
|
172
|
+
|
|
173
|
+
- backend role: `Read("~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md")` → `${backendRole}`
|
|
174
|
+
- frontend role: `Read("~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/architect.md")` → `${frontendRole}`
|
|
175
|
+
|
|
176
|
+
**通道 A — plugin spawn(默认)**:
|
|
177
|
+
|
|
178
|
+
**FIRST Agent call ({{BACKEND_PRIMARY}})**:
|
|
179
|
+
```
|
|
180
|
+
Agent({
|
|
181
|
+
subagent_type: "codex:codex-rescue",
|
|
182
|
+
description: "team Phase 2: 后端架构分析",
|
|
183
|
+
prompt: `<role>
|
|
184
|
+
${backendRole}
|
|
185
|
+
</role>
|
|
186
|
+
|
|
187
|
+
<workdir>{{WORKDIR}}</workdir>
|
|
188
|
+
|
|
189
|
+
<task>
|
|
190
|
+
PRD:<PRD 内容>
|
|
191
|
+
|
|
192
|
+
请分析后端架构:
|
|
193
|
+
- 模块边界、API 设计、数据模型
|
|
194
|
+
- 依赖关系、关键算法选择
|
|
195
|
+
- 实施风险与建议
|
|
196
|
+
</task>
|
|
197
|
+
|
|
198
|
+
<grounding_rules>
|
|
199
|
+
- 引用 file:line 标注现有代码模式
|
|
200
|
+
- 区分「现有模式已支持」vs「需要新建」
|
|
201
|
+
- 不要捏造未观察到的依赖
|
|
202
|
+
</grounding_rules>
|
|
203
|
+
|
|
204
|
+
<structured_output_contract>
|
|
205
|
+
Return JSON ONLY:
|
|
206
|
+
{
|
|
207
|
+
"module_boundaries": [{"name": "...", "responsibility": "...", "files_involved": []}],
|
|
208
|
+
"api_design": [{"endpoint": "...", "verb": "...", "purpose": "..."}],
|
|
209
|
+
"data_model": [{"entity": "...", "fields": [], "relations": []}],
|
|
210
|
+
"dependencies": [{"from": "...", "to": "...", "reason": "..."}],
|
|
211
|
+
"implementation_risks": [{"risk": "...", "mitigation": "..."}]
|
|
212
|
+
}
|
|
213
|
+
Return ≤200 token structured summary.
|
|
214
|
+
</structured_output_contract>`
|
|
215
|
+
})
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**SECOND Agent call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE**:
|
|
219
|
+
```
|
|
220
|
+
Agent({
|
|
221
|
+
subagent_type: "gemini:gemini-rescue",
|
|
222
|
+
description: "team Phase 2: 前端架构分析",
|
|
223
|
+
prompt: `<role>
|
|
224
|
+
${frontendRole}
|
|
225
|
+
</role>
|
|
226
|
+
|
|
227
|
+
<workdir>{{WORKDIR}}</workdir>
|
|
228
|
+
|
|
229
|
+
<task>
|
|
230
|
+
PRD:<PRD 内容>
|
|
231
|
+
|
|
232
|
+
请分析前端架构:
|
|
233
|
+
- 组件拆分、状态管理、路由设计
|
|
234
|
+
- UI/UX 关键流程、无障碍考量
|
|
235
|
+
- 实施风险与建议
|
|
236
|
+
</task>
|
|
237
|
+
|
|
238
|
+
<grounding_rules>
|
|
239
|
+
- 引用 file:line 标注现有组件 / 设计 token
|
|
240
|
+
- 区分「现有组件复用」vs「需新建」
|
|
241
|
+
- 不要捏造未观察到的设计系统约定
|
|
242
|
+
</grounding_rules>
|
|
243
|
+
|
|
244
|
+
<structured_output_contract>
|
|
245
|
+
Return JSON ONLY:
|
|
246
|
+
{
|
|
247
|
+
"component_decomposition": [{"component": "...", "purpose": "...", "reuses": []}],
|
|
248
|
+
"state_management": {"approach": "...", "stores": []},
|
|
249
|
+
"routing": [{"path": "...", "screen": "..."}],
|
|
250
|
+
"ux_flows": [{"flow": "...", "steps": []}],
|
|
251
|
+
"implementation_risks": [{"risk": "...", "mitigation": "..."}]
|
|
252
|
+
}
|
|
253
|
+
Return ≤200 token structured summary.
|
|
254
|
+
</structured_output_contract>`
|
|
255
|
+
})
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**通道 B — codeagent-wrapper fallback**(plugin 未装时降级,并行用 `run_in_background: true`):
|
|
259
|
+
|
|
162
260
|
```
|
|
163
261
|
Bash({
|
|
164
262
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md\n<TASK>\n需求:<PRD 内容>\n请分析后端架构:模块边界、API 设计、数据模型、依赖关系、实施建议。\n</TASK>\nEOF",
|
|
165
263
|
run_in_background: true,
|
|
166
264
|
timeout: 3600000,
|
|
167
|
-
description: "{{BACKEND_PRIMARY}} 后端架构分析"
|
|
265
|
+
description: "{{BACKEND_PRIMARY}} 后端架构分析 (BC)"
|
|
168
266
|
})
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
**SECOND Bash call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE**:
|
|
172
|
-
```
|
|
173
267
|
Bash({
|
|
174
268
|
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/architect.md\n<TASK>\n需求:<PRD 内容>\n请分析前端架构:组件拆分、状态管理、路由设计、UI/UX 要点、实施建议。\n</TASK>\nEOF",
|
|
175
269
|
run_in_background: true,
|
|
176
270
|
timeout: 3600000,
|
|
177
|
-
description: "{{FRONTEND_PRIMARY}} 前端架构分析"
|
|
271
|
+
description: "{{FRONTEND_PRIMARY}} 前端架构分析 (BC)"
|
|
178
272
|
})
|
|
179
273
|
```
|
|
180
274
|
|
|
181
|
-
|
|
275
|
+
> ⚠️ 通道 B `codeagent-wrapper` 已标 **deprecated**,仅为不能升级 plugin 的环境保留。
|
|
276
|
+
|
|
277
|
+
**事件驱动等待**:
|
|
278
|
+
- **通道 A(plugin)**:两个 Agent 同 message 内 spawn,主线接 ≤200 token 摘要。Agent 完成后自动返回结果。
|
|
279
|
+
- **通道 B(BC wrapper)**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理结果。**不调 TaskOutput**。两个 task 都收到通知后才进下一步。
|
|
182
280
|
|
|
183
281
|
⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
|
|
184
282
|
⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
|
|
@@ -308,29 +406,118 @@ Phase 8: INTEGRATION → Lead 全量验证 + 报告 + 清理
|
|
|
308
406
|
- `Bash: git diff` 获取完整变更内容。
|
|
309
407
|
|
|
310
408
|
2. **{{BACKEND_PRIMARY}} + {{FRONTEND_PRIMARY}} 并行审查(PARALLEL)**
|
|
311
|
-
- 模式与 Phase 2
|
|
409
|
+
- 模式与 Phase 2 相同(plugin 优先 + wrapper BC fallback),使用 reviewer prompt。
|
|
410
|
+
|
|
411
|
+
**⚠ 预备动作(spawn 前必须执行)**:主线先 Read 角色提示词,把内容拼入 `<role>` 块。
|
|
412
|
+
|
|
413
|
+
- backend role: `Read("~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md")` → `${backendRole}`
|
|
414
|
+
- frontend role: `Read("~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md")` → `${frontendRole}`
|
|
415
|
+
|
|
416
|
+
**通道 A — plugin spawn(默认)**:
|
|
312
417
|
|
|
313
|
-
**FIRST
|
|
418
|
+
**FIRST Agent call ({{BACKEND_PRIMARY}})**:
|
|
314
419
|
```
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
420
|
+
Agent({
|
|
421
|
+
subagent_type: "codex:codex-rescue",
|
|
422
|
+
description: "team Phase 6: 后端审查",
|
|
423
|
+
prompt: `<role>
|
|
424
|
+
${backendRole}
|
|
425
|
+
</role>
|
|
426
|
+
|
|
427
|
+
<workdir>{{WORKDIR}}</workdir>
|
|
428
|
+
|
|
429
|
+
<task>
|
|
430
|
+
审查以下变更(后端维度:逻辑 / 安全 / 性能 / 错误处理):
|
|
431
|
+
<git diff 输出或变更文件列表>
|
|
432
|
+
|
|
433
|
+
Read-only review. Do NOT modify any file.
|
|
434
|
+
</task>
|
|
435
|
+
|
|
436
|
+
<grounding_rules>
|
|
437
|
+
- 每条 finding 必须含 file:line
|
|
438
|
+
- 区分 bug(可触发失败路径)与 concern(风格/可维护性偏好)
|
|
439
|
+
- 检查过但没问题的项放进 passed_checks
|
|
440
|
+
</grounding_rules>
|
|
441
|
+
|
|
442
|
+
<dig_deeper_nudge>
|
|
443
|
+
- 同根因可能扩散到其他文件——抽样验证
|
|
444
|
+
- 一条精准 Critical > 五条模糊 Warning
|
|
445
|
+
</dig_deeper_nudge>
|
|
446
|
+
|
|
447
|
+
<structured_output_contract>
|
|
448
|
+
Return JSON ONLY:
|
|
449
|
+
{
|
|
450
|
+
"findings": [{"severity": "Critical|Warning|Info", "dimension": "logic|security|performance|error_handling", "file": "path", "line": N, "description": "描述", "fix_suggestion": "修复建议"}],
|
|
451
|
+
"passed_checks": ["检查项"],
|
|
452
|
+
"summary": "总体评估"
|
|
453
|
+
}
|
|
454
|
+
Return ≤200 token structured summary.
|
|
455
|
+
</structured_output_contract>`
|
|
456
|
+
})
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
**SECOND Agent call ({{FRONTEND_PRIMARY}}) - IN THE SAME MESSAGE**:
|
|
460
|
+
```
|
|
461
|
+
Agent({
|
|
462
|
+
subagent_type: "gemini:gemini-rescue",
|
|
463
|
+
description: "team Phase 6: 前端审查",
|
|
464
|
+
prompt: `<role>
|
|
465
|
+
${frontendRole}
|
|
466
|
+
</role>
|
|
467
|
+
|
|
468
|
+
<workdir>{{WORKDIR}}</workdir>
|
|
469
|
+
|
|
470
|
+
<task>
|
|
471
|
+
审查以下变更(前端维度:模式一致性 / 可维护性 / 无障碍 / UX / 前端安全):
|
|
472
|
+
<git diff 输出或变更文件列表>
|
|
473
|
+
|
|
474
|
+
Read-only review. Do NOT modify any file.
|
|
475
|
+
</task>
|
|
476
|
+
|
|
477
|
+
<grounding_rules>
|
|
478
|
+
- 每条 finding 必须含 file:line
|
|
479
|
+
- 检查过但没问题的项放进 passed_checks
|
|
480
|
+
</grounding_rules>
|
|
481
|
+
|
|
482
|
+
<dig_deeper_nudge>
|
|
483
|
+
- 同模式问题可能扩散到相邻文件——抽样验证
|
|
484
|
+
- 一条精准 Critical > 五条模糊 Warning
|
|
485
|
+
</dig_deeper_nudge>
|
|
486
|
+
|
|
487
|
+
<structured_output_contract>
|
|
488
|
+
Return JSON ONLY:
|
|
489
|
+
{
|
|
490
|
+
"findings": [{"severity": "Critical|Warning|Info", "dimension": "patterns|maintainability|accessibility|ux|frontend_security", "file": "path", "line": N, "description": "描述", "fix_suggestion": "修复建议"}],
|
|
491
|
+
"passed_checks": ["检查项"],
|
|
492
|
+
"summary": "总体评估"
|
|
493
|
+
}
|
|
494
|
+
Return ≤200 token structured summary.
|
|
495
|
+
</structured_output_contract>`
|
|
320
496
|
})
|
|
321
497
|
```
|
|
322
498
|
|
|
323
|
-
|
|
499
|
+
**通道 B — codeagent-wrapper fallback**(plugin 未装时降级):
|
|
500
|
+
|
|
324
501
|
```
|
|
325
502
|
Bash({
|
|
326
|
-
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend {{
|
|
503
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend {{BACKEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: ~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md\n<TASK>\n审查以下变更:\n<git diff 输出或变更文件列表>\n</TASK>\nOUTPUT (JSON): [same schema as 通道 A]\nEOF",
|
|
327
504
|
run_in_background: true,
|
|
328
505
|
timeout: 3600000,
|
|
329
|
-
description: "{{
|
|
506
|
+
description: "{{BACKEND_PRIMARY}} 后端审查 (BC)"
|
|
507
|
+
})
|
|
508
|
+
Bash({
|
|
509
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend {{FRONTEND_PRIMARY}} {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: ~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md\n<TASK>\n审查以下变更:\n<git diff 输出或变更文件列表>\n</TASK>\nOUTPUT (JSON): [same schema as 通道 A]\nEOF",
|
|
510
|
+
run_in_background: true,
|
|
511
|
+
timeout: 3600000,
|
|
512
|
+
description: "{{FRONTEND_PRIMARY}} 前端审查 (BC)"
|
|
330
513
|
})
|
|
331
514
|
```
|
|
332
515
|
|
|
333
|
-
|
|
516
|
+
> ⚠️ 通道 B `codeagent-wrapper` 已标 **deprecated**,仅为不能升级 plugin 的环境保留。
|
|
517
|
+
|
|
518
|
+
**事件驱动等待**:
|
|
519
|
+
- **通道 A(plugin)**:两个 Agent 同 message 内 spawn,主线接 ≤200 token 摘要。
|
|
520
|
+
- **通道 B(BC wrapper)**:spawn 两个 Bash bg 后说明 task-id 然后 **turn end**。引擎在每个 task 完成时自动发 `<task-notification>`,主线在通知触发的新 turn 处理。**不调 TaskOutput**。两个 task 都收到通知才进 step 3。
|
|
334
521
|
|
|
335
522
|
⛔ **禁止**:调 `TaskOutput({block: true, timeout: 600000})` (旧 freeze poll 模式) / Kill task。
|
|
336
523
|
⚠️ **失败处理**:notification status=failed / exit ≠ 0 / parse 失败 → v1.7.87 标准 2-retry / 5s / 3-attempts;3 次全失败才降级单模型。
|
|
@@ -39,41 +39,74 @@ subagent_freshness: required
|
|
|
39
39
|
- 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
|
|
40
40
|
- 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
**调用通道路由(CCG codeagent 退役,v2.2.0+)**
|
|
43
|
+
|
|
44
|
+
1. **优先 plugin spawn**(默认):plugin 已装 → `Agent(subagent_type="<codex:codex-rescue|gemini:gemini-rescue>")`。session 复用通过 prompt 内 `--resume` flag 表达(subagent 映射为 codex/gemini `--resume-last`,**注意是 last,不是 by-id**)。
|
|
45
|
+
2. **降级 codeagent-wrapper**(BC fallback):plugin 未装 → Bash 调用,保留 `resume <SESSION_ID>` 显式会话管理。
|
|
46
|
+
|
|
47
|
+
**判定**:preflight `Bash` 跑 `ls ~/.claude/plugins/` 看有无 `codex@*` / `gemini@*` 子目录。
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
**通道 A — plugin spawn(默认)**:
|
|
52
|
+
|
|
53
|
+
**预备动作**:spawn 前主线先 Read 对应阶段的角色提示词(见下方表),把内容拼入 `<role>` 块。
|
|
43
54
|
|
|
44
55
|
```
|
|
45
56
|
# 新会话调用
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
Agent({
|
|
58
|
+
subagent_type: "<codex:codex-rescue|gemini:gemini-rescue>",
|
|
59
|
+
description: "简短描述",
|
|
60
|
+
prompt: `<role>
|
|
61
|
+
${roleContent} // 主线 Read 后的角色提示词内容
|
|
62
|
+
</role>
|
|
63
|
+
|
|
64
|
+
<workdir>{{WORKDIR}}</workdir>
|
|
65
|
+
|
|
66
|
+
<task>
|
|
50
67
|
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
51
68
|
上下文:<前序阶段收集的项目上下文、分析结果等>
|
|
52
|
-
</
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
</task>
|
|
70
|
+
|
|
71
|
+
<structured_output_contract>
|
|
72
|
+
<期望输出格式 / JSON schema>
|
|
73
|
+
Return ≤200 token structured summary.
|
|
74
|
+
</structured_output_contract>`
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
# 复用会话(同一 Claude session 内的连续阶段)
|
|
78
|
+
Agent({
|
|
79
|
+
subagent_type: "<codex:codex-rescue|gemini:gemini-rescue>",
|
|
80
|
+
description: "简短描述",
|
|
81
|
+
prompt: `--resume
|
|
82
|
+
|
|
83
|
+
<task>
|
|
84
|
+
<delta 指令(仅本阶段变化,不重述前序上下文,由 codex/gemini thread 自带历史)>
|
|
85
|
+
</task>`
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**通道 B — wrapper BC fallback**(plugin 未装时):
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
# 新会话
|
|
93
|
+
Bash({
|
|
94
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend <{{BACKEND_PRIMARY}}|{{FRONTEND_PRIMARY}}> {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: <角色提示词路径>\n<TASK>\n需求:<增强后的需求>\n上下文:<前序阶段上下文>\n</TASK>\nOUTPUT: 期望输出格式\nEOF",
|
|
55
95
|
run_in_background: true,
|
|
56
96
|
timeout: 3600000,
|
|
57
|
-
description: "简短描述"
|
|
97
|
+
description: "简短描述 (BC)"
|
|
58
98
|
})
|
|
59
99
|
|
|
60
|
-
#
|
|
100
|
+
# 复用会话(显式 SESSION_ID)
|
|
61
101
|
Bash({
|
|
62
|
-
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend <{{BACKEND_PRIMARY}}|{{FRONTEND_PRIMARY}}> {{GEMINI_MODEL_FLAG}}resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
|
|
63
|
-
ROLE_FILE: <角色提示词路径>
|
|
64
|
-
<TASK>
|
|
65
|
-
需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
|
|
66
|
-
上下文:<前序阶段收集的项目上下文、分析结果等>
|
|
67
|
-
</TASK>
|
|
68
|
-
OUTPUT: 期望输出格式
|
|
69
|
-
EOF",
|
|
102
|
+
command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--progress --backend <{{BACKEND_PRIMARY}}|{{FRONTEND_PRIMARY}}> {{GEMINI_MODEL_FLAG}}resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'\nROLE_FILE: <角色提示词路径>\n<TASK>\n需求:<增强后的需求>\n上下文:<前序阶段上下文>\n</TASK>\nEOF",
|
|
70
103
|
run_in_background: true,
|
|
71
104
|
timeout: 3600000,
|
|
72
|
-
description: "简短描述"
|
|
105
|
+
description: "简短描述 (BC, resume)"
|
|
73
106
|
})
|
|
74
107
|
```
|
|
75
108
|
|
|
76
|
-
|
|
109
|
+
**角色提示词路径**(通道 A 主线 Read 后拼入 `<role>` 块;通道 B 仍用 `ROLE_FILE:` 写在 EOF 内):
|
|
77
110
|
|
|
78
111
|
| 阶段 | 后端 | 前端 |
|
|
79
112
|
|------|-------|--------|
|
|
@@ -81,7 +114,9 @@ EOF",
|
|
|
81
114
|
| 规划 | `~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/architect.md` | `~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/architect.md` |
|
|
82
115
|
| 审查 | `~/.claude/.ccg/prompts/{{BACKEND_PRIMARY}}/reviewer.md` | `~/.claude/.ccg/prompts/{{FRONTEND_PRIMARY}}/reviewer.md` |
|
|
83
116
|
|
|
84
|
-
|
|
117
|
+
**会话复用模型差异**:
|
|
118
|
+
- **通道 A(plugin)**:同 Claude session 内连续阶段用 `--resume`,自动接上一次同 backend 的 thread(codex/gemini 各自独立的 `--resume-last` 行为)。**不支持跨任务跳点 resume by ID**——若中间插了其他 codex 调用会串。
|
|
119
|
+
- **通道 B(wrapper)**:每次 spawn 返回 `SESSION_ID: xxx`,后续 `resume xxx` 任意复用(注意:是 `resume`,不是 `--resume`)。
|
|
85
120
|
|
|
86
121
|
**并行调用 + 事件驱动等待**:
|
|
87
122
|
|