ccg-ros2-workflow 2.1.1 → 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.BlRbcCvK.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.BlRbcCvK.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.1";
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.1",
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",
@@ -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
 
@@ -25,7 +25,7 @@ $ARGUMENTS
25
25
 
26
26
  ```
27
27
  Bash({
28
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
28
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
29
29
  ROLE_FILE: <角色提示词路径>
30
30
  <TASK>
31
31
  需求:<增强后的需求>
@@ -46,6 +46,15 @@ EOF",
46
46
  | 分析 | `~/.claude/.ccg/prompts/codex/analyzer.md` | `~/.claude/.ccg/prompts/gemini/analyzer.md` |
47
47
  | 规划 | `~/.claude/.ccg/prompts/codex/architect.md` | `~/.claude/.ccg/prompts/gemini/architect.md` |
48
48
 
49
+ **工作目录**:
50
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
51
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
52
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
53
+ - 默认使用当前工作目录
54
+
55
+ **模型参数说明**:
56
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
57
+
49
58
  **会话复用**:每次调用返回 `SESSION_ID: xxx`(通常由 wrapper 输出),**必须保存**以供后续 `/ccg:execute` 使用。
50
59
 
51
60
  **等待后台任务**(最大超时 600000ms = 10 分钟):
@@ -77,7 +86,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
77
86
  mcp__ace-tool__enhance_prompt({
78
87
  prompt: "$ARGUMENTS",
79
88
  conversation_history: "<最近5-10轮对话历史>",
80
- project_root_path: "$PWD"
89
+ project_root_path: "{{WORKDIR}}"
81
90
  })
82
91
  ```
83
92
 
@@ -85,12 +94,12 @@ mcp__ace-tool__enhance_prompt({
85
94
 
86
95
  #### 1.2 上下文检索
87
96
 
88
- **调用 `mcp__ace-tool__search_context` 工具**:
97
+ **调用 `{{MCP_SEARCH_TOOL}}` 工具**:
89
98
 
90
99
  ```
91
- mcp__ace-tool__search_context({
100
+ {{MCP_SEARCH_TOOL}}({
92
101
  query: "<基于增强后需求构建的语义查询>",
93
- project_root_path: "$PWD"
102
+ project_root_path: "{{WORKDIR}}"
94
103
  })
95
104
  ```
96
105
 
@@ -23,7 +23,7 @@ description: 'ROS2 多模型代码审查:无参数时自动审查 git diff,
23
23
 
24
24
  ```
25
25
  Bash({
26
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
26
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
27
27
  ROLE_FILE: <角色提示词路径>
28
28
  <TASK>
29
29
  审查以下代码变更:
@@ -44,6 +44,15 @@ EOF",
44
44
  | Codex | `~/.claude/.ccg/prompts/codex/reviewer.md` |
45
45
  | Gemini | `~/.claude/.ccg/prompts/gemini/reviewer.md` |
46
46
 
47
+ **工作目录**:
48
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
49
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
50
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
51
+ - 默认使用当前工作目录
52
+
53
+ **模型参数说明**:
54
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
55
+
47
56
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
48
57
 
49
58
  **等待后台任务**(使用最大超时 600000ms = 10 分钟):
@@ -69,7 +78,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
69
78
 
70
79
  **有参数时**:使用指定的代码/描述
71
80
 
72
- 调用 `mcp__ace-tool__search_context` 获取相关上下文。
81
+ 调用 `{{MCP_SEARCH_TOOL}}` 获取相关上下文。
73
82
 
74
83
  ### 🔬 阶段 2:并行审查
75
84
 
@@ -35,7 +35,7 @@ description: '按规范执行 + 多模型协作 + 归档'
35
35
 
36
36
  For each task:
37
37
  ```
38
- codeagent-wrapper --backend <codex|gemini> - "$PWD" <<'EOF'
38
+ codeagent-wrapper --backend <codex|gemini> - "{{WORKDIR}}" <<'EOF'
39
39
  TASK: <task description from tasks.md>
40
40
  CONTEXT: <relevant code context>
41
41
  CONSTRAINTS: <constraints from spec>
@@ -69,7 +69,7 @@ description: '按规范执行 + 多模型协作 + 归档'
69
69
  **FIRST Bash call (Codex)**:
70
70
  ```
71
71
  Bash({
72
- command: "~/.claude/bin/codeagent-wrapper --backend codex - \"$PWD\" <<'EOF'\nReview the implementation changes:\n- Correctness: logic errors, edge cases\n- Security: injection, auth issues\n- Spec compliance: constraints satisfied\nOUTPUT: JSON with findings\nEOF",
72
+ command: "~/.claude/bin/codeagent-wrapper --backend codex - \"{{WORKDIR}}\" <<'EOF'\nReview the implementation changes:\n- Correctness: logic errors, edge cases\n- Security: injection, auth issues\n- Spec compliance: constraints satisfied\nOUTPUT: JSON with findings\nEOF",
73
73
  run_in_background: true,
74
74
  timeout: 300000,
75
75
  description: "Codex: correctness/security review"
@@ -79,7 +79,7 @@ description: '按规范执行 + 多模型协作 + 归档'
79
79
  **SECOND Bash call (Gemini) - IN THE SAME MESSAGE**:
80
80
  ```
81
81
  Bash({
82
- command: "~/.claude/bin/codeagent-wrapper --backend gemini - \"$PWD\" <<'EOF'\nReview the implementation changes:\n- Maintainability: readability, complexity\n- Patterns: consistency with project style\n- Integration: cross-module impacts\nOUTPUT: JSON with findings\nEOF",
82
+ command: "~/.claude/bin/codeagent-wrapper --backend gemini {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nReview the implementation changes:\n- Maintainability: readability, complexity\n- Patterns: consistency with project style\n- Integration: cross-module impacts\nOUTPUT: JSON with findings\nEOF",
83
83
  run_in_background: true,
84
84
  timeout: 300000,
85
85
  description: "Gemini: maintainability/patterns review"
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
2
+ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具(ROS2 版本)'
3
3
  ---
4
4
  <!-- CCG:SPEC:INIT:START -->
5
5
  **Core Philosophy**
@@ -19,47 +19,61 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
19
19
  - Inform user which OS was detected.
20
20
 
21
21
  2. **Check and Install OpenSpec (OPSX)**
22
- - Verify if OPSX commands are available: `/opsx:version`
23
- - If not installed or not found:
22
+ - **IMPORTANT**: OpenSpec CLI command is `openspec`, NOT `opsx`
23
+ - Verify if OpenSpec is available:
24
+ ```bash
25
+ npx @fission-ai/openspec --version
26
+ ```
27
+ - If not found, install globally:
24
28
  ```bash
25
29
  npm install -g @fission-ai/openspec@latest
26
30
  ```
27
- - **Path Verification**:
28
- - If `/opsx:version` command is not found after installation:
29
- 1. Ensure Claude Code commands are properly loaded
30
- 2. Restart Claude Code session if needed
31
- 3. Check if OPSX skills are installed in `.claude/skills/`
32
- - Confirm installation success by running `/opsx:version` again.
31
+ - After installation, verify again:
32
+ ```bash
33
+ openspec --version
34
+ ```
35
+ - If `openspec` command not found after global install, use `npx`:
36
+ ```bash
37
+ npx @fission-ai/openspec --version
38
+ ```
39
+ - **Note**: Always use `openspec` (not `opsx`) for CLI commands.
33
40
 
34
- 3. **Initialize OPSX for Current Project**
35
- - Run:
41
+ 3. **Initialize OPSX for Current ROS2 Project**
42
+ - Check if already initialized:
43
+ ```bash
44
+ ls -la openspec/ .claude/skills/openspec-* 2>/dev/null || echo "Not initialized"
45
+ ```
46
+ - If not initialized, run:
36
47
  ```bash
37
- /opsx:init --tools claude
48
+ npx @fission-ai/openspec init --tools claude
38
49
  ```
39
- - Verify `openspec/` directory structure is created.
40
- - Verify `.claude/skills/` contains `opsx-*` skills.
50
+ - Verify initialization:
51
+ - Check `openspec/` directory exists
52
+ - Check `.claude/skills/` contains `openspec-*` skills
53
+ - Check `.claude/commands/opsx/` contains OPSX commands
41
54
  - Report any errors with remediation steps.
42
55
 
43
56
  4. **Validate Multi-Model MCP Tools**
44
57
  - Check `codeagent-wrapper` availability: `~/.claude/bin/codeagent-wrapper --version`
45
- - Test Codex backend:
58
+ - **工作目录**:`{{WORKDIR}}` 替换为目标工作目录的绝对路径。如果用户通过 `/add-dir` 添加了多个工作区,先确定任务相关的工作区。
59
+ - Test Codex backend(底层控制):
46
60
  ```bash
47
- ~/.claude/bin/codeagent-wrapper --backend codex - "$PWD" <<< "echo test"
61
+ ~/.claude/bin/codeagent-wrapper --backend codex - "{{WORKDIR}}" <<< "echo test"
48
62
  ```
49
- - Test Gemini backend:
63
+ - Test Gemini backend(上层应用):
50
64
  ```bash
51
- ~/.claude/bin/codeagent-wrapper --backend gemini - "$PWD" <<< "echo test"
65
+ ~/.claude/bin/codeagent-wrapper --backend gemini --gemini-model gemini-3.1-pro-preview - "{{WORKDIR}}" <<< "echo test"
52
66
  ```
53
67
  - For each unavailable tool, display warning with installation instructions.
54
68
 
55
69
  5. **Validate Context Retrieval MCP** (Optional)
56
- - **Check Active Tool**: Is `mcp__ace-tool__search_context` available in the current session?
57
- - **Check Configuration**: If tool is missing, check `~/.claude.json` (or `%APPDATA%\Claude\claude.json` on Windows) for `"ace-tool"` or `"ace-tool-rs"` in `mcpServers`.
70
+ - **Check Active Tool**: Is `{{MCP_SEARCH_TOOL}}` available in the current session?
71
+ - **Check Configuration**: If tool is missing, check `~/.claude.json` for `"ace-tool"` or `"ace-tool-rs"` in `mcpServers`.
58
72
  - **Diagnosis**:
59
73
  - If tool available: Mark as "✓ Active".
60
74
  - If config exists but tool missing: Mark as "⚠️ Configured but inactive (Try restarting Claude)".
61
75
  - If neither: Mark as "○ Not installed (Optional)".
62
- - If not installed/configured, suggest: "Run `npx ccg-workflow` and select ace-tool MCP option."
76
+ - If not installed/configured, suggest: "Run `npx ccg-ros2-workflow` and select ace-tool MCP option."
63
77
 
64
78
  6. **Summary Report**
65
79
  Display status table:
@@ -70,8 +84,8 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
70
84
  Project initialized ✓/✗
71
85
  OPSX Skills ✓/✗
72
86
  codeagent-wrapper ✓/✗
73
- Codex backend ✓/✗
74
- Gemini backend ✓/✗
87
+ Codex backend(底层控制) ✓/✗
88
+ Gemini backend(上层应用) ✓/✗
75
89
  ace-tool MCP ✓/✗ (optional)
76
90
  ```
77
91
 
@@ -84,8 +98,10 @@ description: '初始化 OpenSpec (OPSX) 环境 + 验证多模型 MCP 工具'
84
98
  - Code Review: `/ccg:spec-review` (Independent dual-model review)
85
99
 
86
100
  **Reference**
87
- - OpenSpec (OPSX) CLI: `/opsx:help`
88
- - CCG Workflow: `npx ccg-workflow`
101
+ - OpenSpec (OPSX) CLI: `npx @fission-ai/openspec --help`
102
+ - OPSX Commands: `/opsx:new`, `/opsx:continue`, `/opsx:apply`, etc.
103
+ - CCG ROS2 Workflow: `npx ccg-ros2-workflow`
89
104
  - Codex/Gemini MCP: Bundled with codeagent-wrapper
90
- - Node.js >= 18.x required for OpenSpec
105
+ - Node.js >= 20.x required
106
+ - ROS2 Humble: https://docs.ros.org/en/humble/
91
107
  <!-- CCG:SPEC:INIT:END -->
@@ -29,7 +29,7 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
29
29
  **FIRST Bash call (Codex)**:
30
30
  ```
31
31
  Bash({
32
- command: "~/.claude/bin/codeagent-wrapper --backend codex - \"$PWD\" <<'EOF'\nAnalyze change <change_id> from backend perspective:\n- Implementation approach\n- Technical risks\n- Alternative architectures\n- Edge cases and failure modes\nOUTPUT: JSON with analysis\nEOF",
32
+ command: "~/.claude/bin/codeagent-wrapper --backend codex - \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from backend perspective:\n- Implementation approach\n- Technical risks\n- Alternative architectures\n- Edge cases and failure modes\nOUTPUT: JSON with analysis\nEOF",
33
33
  run_in_background: true,
34
34
  timeout: 300000,
35
35
  description: "Codex: backend analysis"
@@ -39,7 +39,7 @@ description: '多模型分析 → 消除歧义 → 零决策可执行计划'
39
39
  **SECOND Bash call (Gemini) - IN THE SAME MESSAGE**:
40
40
  ```
41
41
  Bash({
42
- command: "~/.claude/bin/codeagent-wrapper --backend gemini - \"$PWD\" <<'EOF'\nAnalyze change <change_id> from frontend/integration perspective:\n- Maintainability assessment\n- Scalability considerations\n- Integration conflicts\nOUTPUT: JSON with analysis\nEOF",
42
+ command: "~/.claude/bin/codeagent-wrapper --backend gemini {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nAnalyze change <change_id> from frontend/integration perspective:\n- Maintainability assessment\n- Scalability considerations\n- Integration conflicts\nOUTPUT: JSON with analysis\nEOF",
43
43
  run_in_background: true,
44
44
  timeout: 300000,
45
45
  description: "Gemini: frontend analysis"
@@ -13,7 +13,7 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
13
13
  - **NEVER** divide subagent tasks by roles (e.g., "架构师agent", "安全专家agent").
14
14
  - **ALWAYS** divide by context boundaries (e.g., "user-related code", "authentication logic").
15
15
  - Each subagent context must be self-contained with independent output.
16
- - Use `mcp__ace-tool__search_context` to minimize grep/find operations.
16
+ - Use `{{MCP_SEARCH_TOOL}}` to minimize grep/find operations.
17
17
  - Do not make architectural decisions—surface constraints that guide decisions.
18
18
 
19
19
  **Steps**
@@ -24,7 +24,7 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
24
24
  mcp__ace-tool__enhance_prompt({
25
25
  prompt: "$ARGUMENTS",
26
26
  conversation_history: "<recent conversation>",
27
- project_root_path: "$PWD"
27
+ project_root_path: "{{WORKDIR}}"
28
28
  })
29
29
  ```
30
30
  - Wait for enhanced prompt result.
@@ -39,7 +39,7 @@ description: '需求 → 约束集(并行探索 + OPSX 提案)'
39
39
  - If change already exists, use `/opsx:list` to find it and continue.
40
40
 
41
41
  2. **Initial Codebase Assessment**
42
- - Use `mcp__ace-tool__search_context` to scan codebase.
42
+ - Use `{{MCP_SEARCH_TOOL}}` to scan codebase.
43
43
  - Determine project scale: single vs multi-directory structure.
44
44
  - **Decision**: If multi-directory → enable parallel Explore subagents.
45
45
 
@@ -33,7 +33,7 @@ description: '双模型交叉审查(独立工具,随时可用)'
33
33
  **FIRST Bash call (Codex)**:
34
34
  ```
35
35
  Bash({
36
- command: "~/.claude/bin/codeagent-wrapper --backend codex - \"$PWD\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## Codex Review Dimensions\n1. **Spec Compliance**: Verify ALL constraints from spec are satisfied\n2. **PBT Properties**: Check invariants, idempotency, bounds are correctly implemented\n3. **Logic Correctness**: Edge cases, error handling, algorithm correctness\n4. **Backend Security**: Injection vulnerabilities, auth checks, input validation\n5. **Regression Risk**: Interface compatibility, type safety, breaking changes\n\n## Output Format (JSON)\n{\n \"findings\": [\n {\n \"severity\": \"Critical|Warning|Info\",\n \"dimension\": \"spec_compliance|pbt|logic|security|regression\",\n \"file\": \"path/to/file.ts\",\n \"line\": 42,\n \"description\": \"What is wrong\",\n \"constraint_violated\": \"Constraint ID from spec (if applicable)\",\n \"fix_suggestion\": \"How to fix\"\n }\n ],\n \"passed_checks\": [\"List of verified constraints/properties\"],\n \"summary\": \"Overall assessment\"\n}\nEOF",
36
+ command: "~/.claude/bin/codeagent-wrapper --backend codex - \"{{WORKDIR}}\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## Codex Review Dimensions\n1. **Spec Compliance**: Verify ALL constraints from spec are satisfied\n2. **PBT Properties**: Check invariants, idempotency, bounds are correctly implemented\n3. **Logic Correctness**: Edge cases, error handling, algorithm correctness\n4. **Backend Security**: Injection vulnerabilities, auth checks, input validation\n5. **Regression Risk**: Interface compatibility, type safety, breaking changes\n\n## Output Format (JSON)\n{\n \"findings\": [\n {\n \"severity\": \"Critical|Warning|Info\",\n \"dimension\": \"spec_compliance|pbt|logic|security|regression\",\n \"file\": \"path/to/file.ts\",\n \"line\": 42,\n \"description\": \"What is wrong\",\n \"constraint_violated\": \"Constraint ID from spec (if applicable)\",\n \"fix_suggestion\": \"How to fix\"\n }\n ],\n \"passed_checks\": [\"List of verified constraints/properties\"],\n \"summary\": \"Overall assessment\"\n}\nEOF",
37
37
  run_in_background: true,
38
38
  timeout: 300000,
39
39
  description: "Codex: backend/logic review"
@@ -43,7 +43,7 @@ description: '双模型交叉审查(独立工具,随时可用)'
43
43
  **SECOND Bash call (Gemini) - IN THE SAME MESSAGE**:
44
44
  ```
45
45
  Bash({
46
- command: "~/.claude/bin/codeagent-wrapper --backend gemini - \"$PWD\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## Gemini Review Dimensions\n1. **Pattern Consistency**: Naming conventions, code style, project patterns\n2. **Maintainability**: Readability, complexity, documentation adequacy\n3. **Integration Risk**: Dependency changes, cross-module impacts\n4. **Frontend Security**: XSS, CSRF, sensitive data exposure\n5. **Spec Alignment**: Implementation matches spec intent (not just letter)\n\n## Output Format (JSON)\n{\n \"findings\": [\n {\n \"severity\": \"Critical|Warning|Info\",\n \"dimension\": \"patterns|maintainability|integration|security|alignment\",\n \"file\": \"path/to/file.ts\",\n \"line\": 42,\n \"description\": \"What is wrong\",\n \"spec_reference\": \"Spec section (if applicable)\",\n \"fix_suggestion\": \"How to fix\"\n }\n ],\n \"passed_checks\": [\"List of verified aspects\"],\n \"summary\": \"Overall assessment\"\n}\nEOF",
46
+ command: "~/.claude/bin/codeagent-wrapper --backend gemini {{GEMINI_MODEL_FLAG}}- \"{{WORKDIR}}\" <<'EOF'\nReview proposal <proposal_id> implementation:\n\n## Gemini Review Dimensions\n1. **Pattern Consistency**: Naming conventions, code style, project patterns\n2. **Maintainability**: Readability, complexity, documentation adequacy\n3. **Integration Risk**: Dependency changes, cross-module impacts\n4. **Frontend Security**: XSS, CSRF, sensitive data exposure\n5. **Spec Alignment**: Implementation matches spec intent (not just letter)\n\n## Output Format (JSON)\n{\n \"findings\": [\n {\n \"severity\": \"Critical|Warning|Info\",\n \"dimension\": \"patterns|maintainability|integration|security|alignment\",\n \"file\": \"path/to/file.ts\",\n \"line\": 42,\n \"description\": \"What is wrong\",\n \"spec_reference\": \"Spec section (if applicable)\",\n \"fix_suggestion\": \"How to fix\"\n }\n ],\n \"passed_checks\": [\"List of verified aspects\"],\n \"summary\": \"Overall assessment\"\n}\nEOF",
47
47
  run_in_background: true,
48
48
  timeout: 300000,
49
49
  description: "Gemini: patterns/integration review"
@@ -33,7 +33,7 @@ description: 'ROS2 多模型测试生成:智能路由 Codex 单元测试 / Gem
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
  需求:为以下代码生成测试
@@ -66,6 +66,15 @@ EOF",
66
66
  | 上层应用(Launch/Python) | Gemini (launch_testing) |
67
67
  | 全栈 | 并行执行两者 |
68
68
 
69
+ **工作目录**:
70
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
71
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
72
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
73
+ - 默认使用当前工作目录
74
+
75
+ **模型参数说明**:
76
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
77
+
69
78
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
70
79
 
71
80
  **等待后台任务**(使用最大超时 600000ms = 10 分钟):
@@ -39,7 +39,7 @@ description: 'ROS2 多模型协作开发工作流(研究→构思→计划→
39
39
  ```
40
40
  # 新会话调用
41
41
  Bash({
42
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"$PWD\" <<'EOF'
42
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> - \"{{WORKDIR}}\" <<'EOF'
43
43
  ROLE_FILE: <角色提示词路径>
44
44
  <TASK>
45
45
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -54,7 +54,7 @@ EOF",
54
54
 
55
55
  # 复用会话调用
56
56
  Bash({
57
- command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"$PWD\" <<'EOF'
57
+ command: "~/.claude/bin/codeagent-wrapper {{LITE_MODE_FLAG}}--backend <codex|gemini> resume <SESSION_ID> - \"{{WORKDIR}}\" <<'EOF'
58
58
  ROLE_FILE: <角色提示词路径>
59
59
  <TASK>
60
60
  需求:<增强后的需求(如未增强则用 $ARGUMENTS)>
@@ -76,6 +76,15 @@ EOF",
76
76
  | 规划 | `~/.claude/.ccg/prompts/codex/architect.md` | `~/.claude/.ccg/prompts/gemini/architect.md` |
77
77
  | 审查 | `~/.claude/.ccg/prompts/codex/reviewer.md` | `~/.claude/.ccg/prompts/gemini/reviewer.md` |
78
78
 
79
+ **工作目录**:
80
+ - `{{WORKDIR}}`:替换为目标工作目录的**绝对路径**
81
+ - 如果用户通过 `/add-dir` 添加了多个工作区,先用 Glob/Grep 确定任务相关的工作区
82
+ - 如果无法确定,用 `AskUserQuestion` 询问用户选择目标工作区
83
+ - 默认使用当前工作目录
84
+
85
+ **模型参数说明**:
86
+ - `{{GEMINI_MODEL_FLAG}}`:当使用 `--backend gemini` 时,替换为 `--gemini-model gemini-3.1-pro-preview `(注意末尾空格);使用 codex 时替换为空字符串
87
+
79
88
  **会话复用**:每次调用返回 `SESSION_ID: xxx`,后续阶段用 `resume xxx` 子命令复用上下文(注意:是 `resume`,不是 `--resume`)。
80
89
 
81
90
  **并行调用**:使用 `run_in_background: true` 启动,用 `TaskOutput` 等待结果。**必须等所有模型返回后才能进入下一阶段**。
@@ -112,7 +121,7 @@ TaskOutput({ task_id: "<task_id>", block: true, timeout: 600000 })
112
121
  `[模式:研究]` - 理解需求并收集上下文:
113
122
 
114
123
  1. **Prompt 增强**:调用 `mcp__ace-tool__enhance_prompt`,**用增强结果替代原始 $ARGUMENTS,后续调用 Codex/Gemini 时传入增强后的需求**
115
- 2. **上下文检索**:调用 `mcp__ace-tool__search_context`
124
+ 2. **上下文检索**:调用 `{{MCP_SEARCH_TOOL}}`
116
125
  3. **需求完整性评分**(0-10 分):
117
126
  - 目标明确性(0-3)、预期结果(0-3)、边界范围(0-2)、约束条件(0-2)
118
127
  - ≥7 分:继续 | <7 分:⛔ 停止,提出补充问题