ccg-ros2-workflow 2.1.0 → 2.2.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/README.md CHANGED
@@ -1,190 +1,141 @@
1
- # CCG - Claude + Codex + Gemini Multi-Model Collaboration
1
+ # CCG-ROS2 - Claude + Codex + Gemini ROS2 多模型协作系统
2
2
 
3
3
  <div align="center">
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/ccg-workflow.svg)](https://www.npmjs.com/package/ccg-workflow)
5
+ [![npm version](https://img.shields.io/npm/v/ccg-ros2-workflow.svg)](https://www.npmjs.com/package/ccg-ros2-workflow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Compatible-green.svg)](https://claude.ai/code)
8
+ [![ROS2](https://img.shields.io/badge/ROS2-Humble-blue.svg)](https://docs.ros.org/en/humble/)
8
9
 
9
10
  </div>
10
11
 
11
- Claude Code 编排 Codex + Gemini 的多模型协作开发系统。前端任务路由至 Gemini,后端任务路由至 Codex,Claude 负责编排决策和代码审核。
12
+ Claude Code 编排 Codex + Gemini ROS2 多模型协作开发系统。上层应用任务路由至 Gemini,底层控制任务路由至 Codex,Claude 负责编排决策和代码审核。
13
+
14
+ > Fork 自 [fengshao1227/ccg-workflow](https://github.com/fengshao1227/ccg-workflow) v1.7.61,专为 ROS2 机器人开发定制。
12
15
 
13
16
  ## 安装
14
17
 
15
18
  ```bash
16
- npx ccg-workflow
19
+ npx ccg-ros2-workflow
17
20
  ```
18
21
 
19
22
  **要求**:Claude Code CLI、Node.js 20+
20
23
 
21
- > **重要**:本项目依赖 `ora@9.x` 和 `string-width@8.x`,这些包要求 Node.js >= 20。使用 Node.js 18 会导致 `SyntaxError: Invalid regular expression flags` 错误。请确保升级到 Node.js 20 或更高版本。
24
+ > **重要**:本项目依赖 `ora@9.x` 和 `string-width@8.x`,这些包要求 Node.js >= 20。请确保升级到 Node.js 20 或更高版本。
25
+
26
+ **可选**:Codex CLI(底层控制)、Gemini CLI(上层应用)
27
+
28
+ ## 模型路由
22
29
 
23
- **可选**:Codex CLI(后端)、Gemini CLI(前端)
30
+ | 模型 | 职责 | 适用场景 |
31
+ |------|------|----------|
32
+ | **Codex** | 底层控制权威 | C++ 节点、硬件驱动、实时控制算法、消息定义 |
33
+ | **Gemini** | 上层应用权威 | Launch 文件、Python 节点、RViz 配置、仿真 |
34
+ | **Claude** | 编排 + 交付 | 计划审批、代码写入、质量把关 |
24
35
 
25
36
  ## 命令
26
37
 
38
+ ### ROS2 开发工作流
39
+
27
40
  | 命令 | 说明 |
28
41
  |------|------|
29
- | `/ccg:workflow` | 6 阶段完整工作流 |
30
- | `/ccg:plan` | 多模型协作规划 (Phase 1-2) |
31
- | `/ccg:execute` | 多模型协作执行 (Phase 3-5) |
32
- | `/ccg:feat` | 新功能开发 |
33
- | `/ccg:frontend` | 前端任务 (Gemini) |
34
- | `/ccg:backend` | 后端任务 (Codex) |
35
- | `/ccg:analyze` | 技术分析 |
36
- | `/ccg:debug` | 问题诊断 |
37
- | `/ccg:optimize` | 性能优化 |
38
- | `/ccg:test` | 测试生成 |
39
- | `/ccg:review` | 代码审查 |
40
- | `/ccg:commit` | Git 提交 |
41
- | `/ccg:rollback` | Git 回滚 |
42
- | `/ccg:clean-branches` | 清理分支 |
43
- | `/ccg:worktree` | Worktree 管理 |
44
- | `/ccg:init` | 初始化 CLAUDE.md |
42
+ | `/ccg:workflow` | 7 阶段完整工作流(含硬件部署) |
43
+ | `/ccg:plan` | 多模型协作规划(Phase 1-2 |
44
+ | `/ccg:execute` | 多模型协作执行(Phase 3-5 |
45
+ | `/ccg:frontend` | 上层应用专项(Gemini 主导:Launch/Python/RViz) |
46
+ | `/ccg:backend` | 底层控制专项(Codex 主导:C++/驱动/实时) |
47
+ | `/ccg:feat` | 智能功能开发 |
48
+ | `/ccg:analyze` | 双模型技术分析 |
49
+ | `/ccg:debug` | 多模型问题诊断 |
50
+ | `/ccg:optimize` | 多模型性能优化 |
51
+ | `/ccg:test` | 智能测试生成 |
52
+ | `/ccg:review` | 双模型代码审查 |
45
53
  | `/ccg:enhance` | Prompt 增强 |
54
+ | `/ccg:init` | 初始化 CLAUDE.md |
55
+
56
+ ### OpenSpec 规范驱动
57
+
58
+ | 命令 | 说明 |
59
+ |------|------|
46
60
  | `/ccg:spec-init` | 初始化 OPSX 环境 |
47
61
  | `/ccg:spec-research` | 需求 → 约束集 |
48
62
  | `/ccg:spec-plan` | 约束 → 零决策计划 |
49
- | `/ccg:spec-impl` | 按计划执行 + 归档 |
63
+ | `/ccg:spec-impl` | 按规范执行 + 归档 |
50
64
  | `/ccg:spec-review` | 双模型交叉审查 |
51
65
 
52
- ### OPSX 规范驱动(v1.7.52+)
53
-
54
- 集成 [OPSX 架构](https://github.com/fission-ai/opsx),把需求变成约束,让 AI 没法自由发挥:
66
+ ### Agent Teams 并行实施
55
67
 
56
- ```bash
57
- # 初始化 OPSX 环境
58
- /ccg:spec-init
59
-
60
- # 研究需求 输出约束集
61
- /ccg:spec-research 实现用户认证
62
-
63
- # 并行分析 → 零决策计划
64
- /ccg:spec-plan
65
-
66
- # 按计划执行
67
- /ccg:spec-impl
68
-
69
- # 独立审查(随时可用)
70
- /ccg:spec-review
71
- ```
72
-
73
- **说明**:`/ccg:spec-*` 命令是 CCG 对 OPSX 的封装,内部调用 `/opsx:*` 命令。每阶段之间可 `/clear`,状态存在 `openspec/` 目录,不怕上下文爆。
74
-
75
- ### 规划与执行分离
76
-
77
- v1.7.39 新增 `/ccg:plan` 和 `/ccg:execute` 命令,将规划与执行解耦:
78
-
79
- ```bash
80
- # 1. 生成实施计划
81
- /ccg:plan 实现用户认证功能
82
-
83
- # 2. 审查计划(可修改)
84
- # 计划保存至 .claude/plan/user-auth.md
85
-
86
- # 3. 执行计划(新会话也可执行)
87
- /ccg:execute .claude/plan/user-auth.md
88
- ```
68
+ | 命令 | 说明 |
69
+ |------|------|
70
+ | `/ccg:team-research` | 并行约束集研究(Codex 底层 + Gemini 上层) |
71
+ | `/ccg:team-plan` | 零决策并行实施计划 |
72
+ | `/ccg:team-exec` | spawn Builder teammates 并行写代码 |
73
+ | `/ccg:team-review` | 双模型交叉审查实施产出 |
89
74
 
90
- ## 配置
75
+ ### Git 工具
91
76
 
92
- ### 目录结构
77
+ | 命令 | 说明 |
78
+ |------|------|
79
+ | `/ccg:commit` | 智能 Git 提交(conventional commit) |
80
+ | `/ccg:rollback` | 交互式 Git 回滚 |
81
+ | `/ccg:clean-branches` | 清理已合并分支 |
82
+ | `/ccg:worktree` | Worktree 管理 |
93
83
 
94
- ```
95
- ~/.claude/
96
- ├── commands/ccg/ # 斜杠命令
97
- ├── agents/ccg/ # 子智能体
98
- ├── bin/codeagent-wrapper
99
- └── .ccg/
100
- ├── config.toml
101
- └── prompts/{codex,gemini}/
102
- ```
84
+ ## 7 阶段工作流
103
85
 
104
- ### 环境变量
105
-
106
- | 变量 | 说明 | 默认值 |
107
- |------|------|--------|
108
- | `CODEAGENT_POST_MESSAGE_DELAY` | Codex 完成后等待时间(秒) | 5 |
109
- | `CODEX_TIMEOUT` | codeagent-wrapper 执行超时(秒) | 7200 |
110
- | `BASH_DEFAULT_TIMEOUT_MS` | Claude Code Bash 默认超时(毫秒) | 120000 |
111
- | `BASH_MAX_TIMEOUT_MS` | Claude Code Bash 最大超时(毫秒) | 600000 |
112
-
113
- 配置方式(`~/.claude/settings.json`):
114
-
115
- ```json
116
- {
117
- "env": {
118
- "CODEAGENT_POST_MESSAGE_DELAY": "1",
119
- "CODEX_TIMEOUT": "7200",
120
- "BASH_DEFAULT_TIMEOUT_MS": "600000",
121
- "BASH_MAX_TIMEOUT_MS": "3600000",
122
- "GEMINI_API_KEY": "your-gemini-api-key",
123
- "GOOGLE_API_KEY": "your-google-api-key"
124
- }
125
- }
126
86
  ```
127
-
128
- > **VSCode 插件用户注意**:VSCode 启动的子进程不会继承终端环境变量,必须在 `settings.json` 中配置 API 密钥,否则 Gemini 会报退出码 41(授权失败)。
129
-
130
- ### MCP 配置
131
-
132
- ace-tool 用于代码检索和 Prompt 增强,安装时可选配置。
133
-
134
- Token 获取:https://augmentcode.com/
135
-
136
- ## 更新 / 卸载
137
-
138
- ```bash
139
- # 更新
140
- npx ccg-workflow@latest # npx 用户
141
- npm install -g ccg-workflow@latest # npm 全局用户
142
-
143
- # 卸载
144
- npx ccg-workflow # 选择 "卸载工作流"
145
- npm uninstall -g ccg-workflow # npm 全局用户需额外执行
87
+ 研究 → 构思 → 计划 → 执行 → 优化 → 评审 → 硬件部署
146
88
  ```
147
89
 
148
- ## 已知问题
149
-
150
- **Codex CLI 0.80.0 进程不退出**
151
-
152
- `--json` 模式下 Codex 完成输出后进程不会自动退出。
153
-
154
- 解决:设置 `CODEAGENT_POST_MESSAGE_DELAY=1`
90
+ - **阶段 1-2(研究/构思)**:Codex + Gemini 并行分析,双视角评估
91
+ - **阶段 3(计划)**:Claude 综合方案,用户批准后存档
92
+ - **阶段 4(执行)**:Claude 主导代码实现
93
+ - **阶段 5(优化)**:Codex + Gemini 并行审查,Claude 整合修复
94
+ - **阶段 6(评审)**:最终质量把关
95
+ - **阶段 7(硬件部署)**:生成部署脚本、检查硬件依赖(串口/CAN/传感器)、Gazebo 仿真验证
155
96
 
156
97
  ## 架构
157
98
 
158
99
  ```
159
- Claude Code (编排)
160
-
161
- ┌───┴───┐
162
- ↓ ↓
163
- Codex Gemini
164
- (后端) (前端)
165
- │ │
166
- └───┬───┘
167
-
168
- Unified Patch
100
+ Claude(编排 + 最终写代码)
101
+ ├── Codex → 只读,返回 patch(底层控制:C++/驱动/实时)
102
+ └── Gemini → 只读,返回 patch(上层应用:Launch/Python/RViz)
169
103
  ```
170
104
 
171
- 外部模型无写入权限,仅返回 Patch,由 Claude 审核后应用。
105
+ 外部模型对文件系统零写入权限,所有代码由 Claude 审核后落盘。
106
+
107
+ ## 子智能体
172
108
 
173
- ## 致谢
109
+ | 智能体 | 用途 |
110
+ |--------|------|
111
+ | `system-integrator` | ROS2 系统集成设计师(节点架构/Topic-Service/QoS 设计) |
112
+ | `planner` | ROS2 任务规划师(WBS 分解) |
113
+ | `init-architect` | 项目初始化架构师 |
114
+ | `get-current-datetime` | 获取当前时间 |
174
115
 
175
- - [cexll/myclaude](https://github.com/cexll/myclaude) - codeagent-wrapper
176
- - [UfoMiao/zcf](https://github.com/UfoMiao/zcf) - Git 工具
177
- - [GudaStudio/skills](https://github.com/GuDaStudio/skills) - 路由设计
178
- - [ace-tool](https://linux.do/t/topic/1344562) - MCP 工具
116
+ ## 输出风格
179
117
 
180
- ## Star History
118
+ 安装后可通过 output-styles 目录选择 AI 输出风格:
181
119
 
182
- [![Star History Chart](https://api.star-history.com/svg?repos=fengshao1227/ccg-workflow&type=timeline&legend=top-left)](https://www.star-history.com/#fengshao1227/ccg-workflow&type=timeline&legend=top-left)
120
+ - `engineer-professional` - SOLID/KISS/DRY 专业工程师风格
121
+ - `nekomata-engineer` - 猫娘工程师(幽浮喵)
122
+ - `laowang-engineer` - 老王工程师
123
+ - `abyss-cultivator` - 深渊修炼者
124
+ - `ojousama-engineer` - 小姐风格
183
125
 
184
- ## License
126
+ ## 固定配置
185
127
 
186
- MIT
128
+ | 项目 | 值 |
129
+ |------|----|
130
+ | ROS2 版本 | Humble Hawksbill(LTS) |
131
+ | 目标平台 | 物理机器人 |
132
+ | 上层应用模型 | Gemini |
133
+ | 底层控制模型 | Codex |
134
+ | 工作流阶段 | 7 阶段(含硬件部署) |
187
135
 
188
- ---
136
+ ## 相关链接
189
137
 
190
- v1.7.52 | [Issues](https://github.com/fengshao1227/ccg-workflow/issues)
138
+ - [npm ](https://www.npmjs.com/package/ccg-ros2-workflow)
139
+ - [GitHub 仓库](https://github.com/GuYu-001/ccg-ros2-workflow)
140
+ - [官方 ccg-workflow](https://github.com/fengshao1227/ccg-workflow)
141
+ - [ROS2 Humble 文档](https://docs.ros.org/en/humble/)
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, t as readCcgConfig, n as initI18n, u as showMainMenu, m as init, E as configMcp, F as version, l as i18n } from './shared/ccg-ros2-workflow.CpLJvcLP.mjs';
4
+ import { z as diagnoseMcpConfig, A as isWindows, B as readClaudeCodeConfig, C as fixWindowsMcpConfig, D as writeClaudeCodeConfig, t as readCcgConfig, n as initI18n, u as showMainMenu, m as init, E as configMcp, F as version, l as i18n } from './shared/ccg-ros2-workflow.B6DeI0On.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, a as checkForUpdates, b as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, h as getCurrentVersion, i as getLatestVersion, j as getWorkflowById, k as getWorkflowConfigs, l as i18n, m as init, n as initI18n, o as installAceTool, p as installAceToolRs, q as installWorkflows, r as migrateToV1_4_0, s as needsMigration, t as readCcgConfig, u as showMainMenu, v as uninstallAceTool, w as uninstallWorkflows, x as update, y as writeCcgConfig } from './shared/ccg-ros2-workflow.CpLJvcLP.mjs';
1
+ export { c as changeLanguage, a as checkForUpdates, b as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, h as getCurrentVersion, i as getLatestVersion, j as getWorkflowById, k as getWorkflowConfigs, l as i18n, m as init, n as initI18n, o as installAceTool, p as installAceToolRs, q as installWorkflows, r as migrateToV1_4_0, s as needsMigration, t as readCcgConfig, u as showMainMenu, v as uninstallAceTool, w as uninstallWorkflows, x as update, y as writeCcgConfig } from './shared/ccg-ros2-workflow.B6DeI0On.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:child_process';
@@ -10,7 +10,7 @@ import i18next from 'i18next';
10
10
  import ora from 'ora';
11
11
  import { parse, stringify } from 'smol-toml';
12
12
 
13
- const version = "2.1.0";
13
+ const version = "2.2.0";
14
14
 
15
15
  function isWindows() {
16
16
  return process.platform === "win32";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccg-ros2-workflow",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "ROS2 Multi-Model Collaborative Development Workflow - Codex (Low-level Control) + Gemini (Upper-layer Application) + Claude (Orchestration)",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -34,38 +34,9 @@
34
34
  "files": [
35
35
  "bin",
36
36
  "dist",
37
- "templates/commands/analyze.md",
38
- "templates/commands/backend.md",
39
- "templates/commands/clean-branches.md",
40
- "templates/commands/commit.md",
41
- "templates/commands/debug.md",
42
- "templates/commands/enhance.md",
43
- "templates/commands/execute.md",
44
- "templates/commands/feat.md",
45
- "templates/commands/frontend.md",
46
- "templates/commands/init.md",
47
- "templates/commands/optimize.md",
48
- "templates/commands/plan.md",
49
- "templates/commands/review.md",
50
- "templates/commands/rollback.md",
51
- "templates/commands/test.md",
52
- "templates/commands/workflow.md",
53
- "templates/commands/worktree.md",
54
- "templates/commands/spec-init.md",
55
- "templates/commands/spec-research.md",
56
- "templates/commands/spec-plan.md",
57
- "templates/commands/spec-impl.md",
58
- "templates/commands/spec-review.md",
59
- "templates/commands/agents/",
60
- "templates/prompts/codex/",
61
- "templates/prompts/gemini/analyzer.md",
62
- "templates/prompts/gemini/architect.md",
63
- "templates/prompts/gemini/debugger.md",
64
- "templates/prompts/gemini/frontend.md",
65
- "templates/prompts/gemini/optimizer.md",
66
- "templates/prompts/gemini/reviewer.md",
67
- "templates/prompts/gemini/tester.md",
68
- "templates/prompts/claude/"
37
+ "templates/commands/",
38
+ "templates/prompts/",
39
+ "templates/output-styles/"
69
40
  ],
70
41
  "engines": {
71
42
  "node": ">=20.0.0"
@@ -28,7 +28,7 @@ description: 'ROS2 多模型技术分析(并行执行):Codex 底层控制
28
28
 
29
29
  ```
30
30
  Bash({
31
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
31
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
32
32
  ROLE_FILE: <角色提示词路径>
33
33
  <TASK>
34
34
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -49,6 +49,15 @@ EOF",
49
49
  | Codex | `~/.claude/.ccg/prompts/codex/analyzer.md` |
50
50
  | Gemini | `~/.claude/.ccg/prompts/gemini/analyzer.md` |
51
51
 
52
+ **工作目录**:
53
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
54
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
55
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
56
+ - 默认使用当前工作目录
57
+
58
+ **模型参数说明**:
59
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
60
+
52
61
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
53
62
 
54
63
  **等待后台任务**(使用最大超时 600000ms = 10 分钟):
@@ -76,7 +85,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
76
85
 
77
86
  `[模式:研究]`
78
87
 
79
- 1. 调用 `mcp__ace-tool__search_context` 检索相关代码
88
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码
80
89
  2. 识别分析范围和关键组件
81
90
  3. 列出已知约束和假设
82
91
 
@@ -35,7 +35,7 @@ description: 'ROS2 底层控制专项工作流(研究→构思→计划→执
35
35
  ```
36
36
  # 新会话调用
37
37
  Bash({
38
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex - \"$PWD\" <<'EOF'
38
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex - \"{{WORKDIR}}\" <<'EOF'
39
39
  ROLE_FILE: <角色提示词路径>
40
40
  <TASK>
41
41
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -50,7 +50,7 @@ EOF",
50
50
 
51
51
  # 复用会话调用
52
52
  Bash({
53
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex resume <SESSION_ID> - \"$PWD\" <<'EOF'
53
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend codex resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
54
54
  ROLE_FILE: <角色提示词路径>
55
55
  <TASK>
56
56
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -94,7 +94,7 @@ EOF",
94
94
 
95
95
  `[模式:研究]` - 理解需求并收集上下文
96
96
 
97
- 1. **代码检索**(如 ace-tool MCP 可用):调用 `mcp__ace-tool__search_context` 检索现有驱动、控制器、消息定义、硬件接口
97
+ 1. **代码检索**(如 ace-tool MCP 可用):调用 `{{MCP_SEARCH_TOOL}}` 检索现有驱动、控制器、消息定义、硬件接口
98
98
  2. 需求完整性评分(0-10 分):≥7 继续,<7 停止补充
99
99
 
100
100
  ### 💡 阶段 2:构思
@@ -27,7 +27,7 @@ description: 'ROS2 多模型调试:Codex 底层控制诊断 + Gemini 上层应
27
27
 
28
28
  ```
29
29
  Bash({
30
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
30
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
31
31
  ROLE_FILE: <角色提示词路径>
32
32
  <TASK>
33
33
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -48,6 +48,15 @@ EOF",
48
48
  | Codex | `~/.claude/.ccg/prompts/codex/debugger.md` |
49
49
  | Gemini | `~/.claude/.ccg/prompts/gemini/debugger.md` |
50
50
 
51
+ **工作目录**:
52
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
53
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
54
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
55
+ - 默认使用当前工作目录
56
+
57
+ **模型参数说明**:
58
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
59
+
51
60
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
52
61
 
53
62
  **等待后台任务**(使用最大超时 600000ms = 10 分钟):
@@ -75,7 +84,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
75
84
 
76
85
  `[模式:研究]`
77
86
 
78
- 1. 调用 `mcp__ace-tool__search_context` 检索相关代码(如可用)
87
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码(如可用)
79
88
  2. 收集错误日志、堆栈信息、复现步骤
80
89
  3. 识别问题类型:[底层控制/上层应用/全栈]
81
90
 
@@ -26,7 +26,7 @@ $ARGUMENTS
26
26
  ```
27
27
  # 复用会话调用(推荐)- 原型生成(Implementation Prototype)
28
28
  Bash({
29
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
29
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
30
30
  ROLE_FILE: <角色提示词路径>
31
31
  <TASK>
32
32
  需求:<任务描述>
@@ -41,7 +41,7 @@ EOF",
41
41
 
42
42
  # 新会话调用 - 原型生成(Implementation Prototype)
43
43
  Bash({
44
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
44
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
45
45
  ROLE_FILE: <角色提示词路径>
46
46
  <TASK>
47
47
  需求:<任务描述>
@@ -59,7 +59,7 @@ EOF",
59
59
 
60
60
  ```
61
61
  Bash({
62
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
62
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
63
63
  ROLE_FILE: <角色提示词路径>
64
64
  <TASK>
65
65
  Scope: Audit the final code changes.
@@ -87,6 +87,15 @@ EOF",
87
87
  | 实施 | `~/.claude/.ccg/prompts/codex/architect.md` | `~/.claude/.ccg/prompts/gemini/frontend.md` |
88
88
  | 审查 | `~/.claude/.ccg/prompts/codex/reviewer.md` | `~/.claude/.ccg/prompts/gemini/reviewer.md` |
89
89
 
90
+ **工作目录**:
91
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
92
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
93
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
94
+ - 默认使用当前工作目录
95
+
96
+ **模型参数说明**:
97
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
98
+
90
99
  **会话复用**:如果 `/ccg:plan` 提供了 SESSION_ID,使用 `resume <SESSION_ID>` 复用上下文。
91
100
 
92
101
  **等待后台任务**(最大超时 600000ms = 10 分钟):
@@ -138,12 +147,12 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
138
147
 
139
148
  **⚠️ 必须使用 MCP 工具快速检索上下文,禁止手动逐个读取文件**
140
149
 
141
- 根据计划中的"关键文件"列表,调用 `mcp__ace-tool__search_context` 检索相关代码:
150
+ 根据计划中的"关键文件"列表,调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码:
142
151
 
143
152
  ```
144
- mcp__ace-tool__search_context({
153
+ {{MCP_SEARCH_TOOL}}({
145
154
  query: "<基于计划内容构建的语义查询,包含关键文件、模块、函数名>",
146
- project_root_path: "$PWD"
155
+ project_root_path: "{{WORKDIR}}"
147
156
  })
148
157
  ```
149
158
 
@@ -15,7 +15,7 @@ $ARGUMENTS
15
15
  ```
16
16
  # 新会话调用
17
17
  Bash({
18
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
18
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
19
19
  ROLE_FILE: <角色提示词路径>
20
20
  <TASK>
21
21
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -30,7 +30,7 @@ EOF",
30
30
 
31
31
  # 复用会话调用
32
32
  Bash({
33
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
33
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
34
34
  ROLE_FILE: <角色提示词路径>
35
35
  <TASK>
36
36
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -53,6 +53,15 @@ EOF",
53
53
  | 实施 | `~/.claude/.ccg/prompts/codex/architect.md` | `~/.claude/.ccg/prompts/gemini/frontend.md` |
54
54
  | 审查 | `~/.claude/.ccg/prompts/codex/reviewer.md` | `~/.claude/.ccg/prompts/gemini/reviewer.md` |
55
55
 
56
+ **工作目录**:
57
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
58
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
59
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
60
+ - 默认使用当前工作目录
61
+
62
+ **模型参数说明**:
63
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
64
+
56
65
  **会话复用**:每次调用返回 `SESSION_ID: xxx`,后续阶段用 `resume xxx` 复用上下文。
57
66
 
58
67
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
@@ -98,7 +107,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
98
107
 
99
108
  #### 2.1 上下文检索
100
109
 
101
- 调用 `mcp__ace-tool__search_context` 检索相关代码、组件、技术栈。
110
+ 调用 `{{MCP_SEARCH_TOOL}}` 检索相关代码、组件、技术栈。
102
111
 
103
112
  #### 2.2 任务类型判断
104
113
 
@@ -35,7 +35,7 @@ description: 'ROS2 上层应用专项工作流(研究→构思→计划→执
35
35
  ```
36
36
  # 新会话调用
37
37
  Bash({
38
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini - \"$PWD\" <<'EOF'
38
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'
39
39
  ROLE_FILE: <角色提示词路径>
40
40
  <TASK>
41
41
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -50,7 +50,7 @@ EOF",
50
50
 
51
51
  # 复用会话调用
52
52
  Bash({
53
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini resume <SESSION_ID> - \"$PWD\" <<'EOF'
53
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend gemini {{GEMINI_MODEL_FLAG}}resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
54
54
  ROLE_FILE: <角色提示词路径>
55
55
  <TASK>
56
56
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -94,7 +94,7 @@ EOF",
94
94
 
95
95
  `[模式:研究]` - 理解需求并收集上下文
96
96
 
97
- 1. **代码检索**(如 ace-tool MCP 可用):调用 `mcp__ace-tool__search_context` 检索现有 Launch 文件、参数配置、RViz 配置、Python 节点
97
+ 1. **代码检索**(如 ace-tool MCP 可用):调用 `{{MCP_SEARCH_TOOL}}` 检索现有 Launch 文件、参数配置、RViz 配置、Python 节点
98
98
  2. 需求完整性评分(0-10 分):≥7 继续,<7 停止补充
99
99
 
100
100
  ### 💡 阶段 2:构思
@@ -33,7 +33,7 @@ description: 'ROS2 多模型性能优化:Codex 实时性优化 + Gemini 仿真
33
33
 
34
34
  ```
35
35
  Bash({
36
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
36
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
37
37
  ROLE_FILE: <角色提示词路径>
38
38
  <TASK>
39
39
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -54,6 +54,15 @@ EOF",
54
54
  | Codex | `~/.claude/.ccg/prompts/codex/optimizer.md` |
55
55
  | Gemini | `~/.claude/.ccg/prompts/gemini/optimizer.md` |
56
56
 
57
+ **工作目录**:
58
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
59
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
60
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
61
+ - 默认使用当前工作目录
62
+
63
+ **模型参数说明**:
64
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
65
+
57
66
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
58
67
 
59
68
  **等待后台任务**(使用最大超时 600000ms = 10 分钟):
@@ -87,7 +96,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
87
96
 
88
97
  `[模式:研究]`
89
98
 
90
- 1. 调用 `mcp__ace-tool__search_context` 检索目标代码(如可用)
99
+ 1. 调用 `{{MCP_SEARCH_TOOL}}` 检索目标代码(如可用)
91
100
  2. 识别性能关键路径
92
101
  3. 收集现有指标(如有)
93
102