platforms/claude/skills/cc-codex-review/SKILL.md
CC-Codex 协作讨论。自由话题驱动的 CC-Codex 协作工具,Battle Loop 辩论机制。关键词: 审查, review, 让codex看看, codex审查, 帮我审查, 讨论, discuss, battle, 让codex检查, 发给codex, 话题, topic, 代码审查, 架构讨论, 技术决策
npx skillsauth add codingsamss/ai-dotfiles cc-codex-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
通过 CodexMCP 实现 Claude Code 与 Codex 的话题驱动协作讨论工具。支持自由话题、Battle Loop 辩论机制和跨会话连续性。
本 Skill 为薄触发层,负责命令路由、初始化和上下文收集。Battle Loop 执行逻辑委托给 codex-battle-agent。
/cc-codex-review <topic> - 启动新话题讨论/cc-codex-review 继续 - 继续当前话题/cc-codex-review 结束 - 结束话题并输出制品/cc-codex-review 状态 - 查看状态/cc-codex-review 重置 - 重置 session_id(保留 summary,需用户确认)codex)codex 工具,支持 prompt、SESSION_ID、sandbox、return_all_messages 参数session_id 字段存储;调用 Codex MCP 续接时由 Agent 映射为 SESSION_IDTOPIC_MANAGER=~/.claude/skills/cc-codex-review/scripts/topic-manager.py
DATA_DIR=.cc-codex
MAX_ROUNDS_LIGHT=1
MAX_ROUNDS_DEEP=5
| 模式 | MAX_ROUNDS | 触发条件 | |------|-----------|---------| | 轻量审查(默认) | 1 | 默认模式,或用户说"审查/review/看看/检查" | | 深度讨论 | 5 | 用户明确表达深度意图(见下方关键词) |
用户消息中包含以下任一关键词/模式时,使用深度讨论模式:
--deep 或 --rounds N--rounds N 参数用户可通过 --rounds N 手动指定轮次(1-10),覆盖默认值。例如:
/cc-codex-review 审查这个方案 --rounds 3 -> max_rounds=3不匹配以上任何条件时,一律使用轻量审查(max_rounds=1)。
| 话题类型 | 说明 | 制品文件名 | |----------|------|-----------| | code-implementation | 代码实现方案讨论 | changes.md | | architecture-design | 架构设计讨论 | plan.md | | bug-analysis | Bug 分析讨论 | analysis.md | | technical-decision | 技术决策讨论 | decision.md | | open-discussion | 开放讨论 | memo.md |
Claude Code 根据用户话题内容自动分类:
code-implementationarchitecture-designbug-analysistechnical-decisionopen-discussion不确定时询问用户确认。 用户可通过参数手动指定类型:/cc-codex-review <topic> --type architecture-design
/cc-codex-review <topic> -> 执行「讨论启动流程」/cc-codex-review 继续 -> 执行「继续讨论流程」/cc-codex-review 结束 -> 执行「结束讨论流程」/cc-codex-review 状态 -> 执行 python3 "$TOPIC_MANAGER" status "$PWD" 并格式化展示/cc-codex-review 重置 -> 需用户确认后,将 session_id 设为 null(保留 summary.md)每次 Claude Code 新会话启动、用户触发 /cc-codex-review 相关命令时,先执行初始化:
1. auto-cleanup: python3 "$TOPIC_MANAGER" auto-cleanup "$PWD" 120
2. 检测活跃话题: python3 "$TOPIC_MANAGER" topic-read "$PWD"
3. 如果有活跃话题:
- 告知用户:"检测到未完成的话题: [标题](第 N/5 轮)"
- 提示用户选择:继续讨论 / 结束话题 / 放弃并开始新话题
4. 如果无活跃话题: 正常进入命令处理
/cc-codex-review <topic>)# Claude Code 自动分类话题类型(或用户指定)
python3 "$TOPIC_MANAGER" topic-create "$PWD" "<话题标题>" "<类型>"
从返回的 JSON 中提取 topic_id。
$PWD/CLAUDE.md,再查 $PWD/.claude/CLAUDE.mdcode-implementation: git diff、相关源码architecture-design: 现有架构描述、相关文档bug-analysis: 错误日志、相关代码technical-decision: 备选方案描述open-discussion: 用户提供的素材将收集到的所有上下文写入一个文件,供 Agent 读取:
路径:$PWD/.cc-codex/topics/<topic_id>/context-bundle.md
# Context Bundle
## 话题
<话题标题和描述>
## 项目背景
<从 CLAUDE.md 提取的信息摘要>
## 讨论素材
<收集到的上下文内容>
根据审查模式确定 max_rounds:
max_rounds = MAX_ROUNDS_LIGHT (1)max_rounds = MAX_ROUNDS_DEEP (5),或用户通过 --rounds N 指定的值调用 Task tool:
subagent_type: codex-battle-agent
description: "CC-Codex Battle Loop"
mode: bypassPermissions
prompt: |
执行 CC-Codex Battle Loop。配置如下:
```json
{
"mode": "NEW",
"topic_id": "<topic_id>",
"topic_title": "<话题标题>",
"topic_type": "<话题类型>",
"session_id": null,
"workdir": "<$PWD>",
"max_rounds": <根据审查模式确定: 1 或 5 或用户指定值>,
"current_round": 1,
"context_bundle_path": ".cc-codex/topics/<topic_id>/context-bundle.md",
"artifact_type": "<根据话题类型映射的制品文件名>",
"debug": false
}
```
context-bundle 路径: .cc-codex/topics/<topic_id>/context-bundle.md
python3 "$TOPIC_MANAGER" topic-complete "$PWD"session_id 给 Agent;Agent 调用 MCP 时必须使用 SESSION_ID/cc-codex-review 继续)python3 "$TOPIC_MANAGER" topic-read "$PWD"
如果无活跃话题,提示用户先创建。
session_id -> 模式为 CONTINUEsession_id(或之前标记为失效) -> 模式为 REBUILD调用 Task tool:
subagent_type: codex-battle-agent
description: "CC-Codex Battle Loop"
mode: bypassPermissions
prompt: |
执行 CC-Codex Battle Loop。配置如下:
```json
{
"mode": "CONTINUE 或 REBUILD",
"topic_id": "<topic_id>",
"topic_title": "<话题标题>",
"topic_type": "<话题类型>",
"session_id": "<session_id 或 null>",
"workdir": "<$PWD>",
"max_rounds": <根据审查模式确定: 沿用原话题的模式>,
"current_round": <当前轮次>,
"context_bundle_path": ".cc-codex/topics/<topic_id>/context-bundle.md",
"artifact_type": "<制品文件名>",
"debug": false
}
```
context-bundle 路径: .cc-codex/topics/<topic_id>/context-bundle.md
同「讨论启动流程 Step 5」。
/cc-codex-review 结束)$PWD/.cc-codex/topics/<topic_id>/artifacts/<制品文件>python3 "$TOPIC_MANAGER" topic-complete "$PWD"Agent 返回结果后,向用户展示:
## CC-Codex 讨论结论
**话题**: <话题标题>
**类型**: <话题类型>
**轮次**: <final_round>/<max_rounds>
**结论**: <conclusion>
### 达成共识
- <consensus_items 列表>
### 待处理项(如有)
- <pending_items 列表>
### 制品
- 路径: <artifact_path>
如果 status 为 error,展示错误信息并提示用户可选操作。
Battle 过程的中间产物(summary.md 更新等)不主动展示给用户,除非用户主动查询。
用户说 "debug 模式" / "查看交互过程" / "显示完整对话" 时,在 spawn Agent 的 JSON 参数中将 debug 设为 true。Agent 会将 Codex 调用的 return_all_messages 设为 true,返回完整对话历史。
/cc-codex-review 结束 基于已有 summary 生成制品两步发布策略:
先写入内部目录(单一真源):
$PWD/.cc-codex/topics/<topic_id>/artifacts/<制品文件>
(topic_id 从 topic-read 返回值获取,制品文件名由话题类型决定,见映射表)
用户指定目录时,成功后发布到外部:
output_dirtopic-update 保存: python3 "$TOPIC_MANAGER" topic-update "$PWD" output_dir "<路径>"如果 codex 工具不可用,所有命令将报错并提示安装:
claude mcp add codex -s user --transport stdio -- uvx --from git+https://github.com/GuDaStudio/codexmcp.git codexmcp
error: "budget_exhausted" 时python3 "$TOPIC_MANAGER" topic-complete "$PWD"/cc-codex-review 继续 恢复首次运行时,检查项目 .gitignore 是否包含 .cc-codex/,如果没有则提示用户添加:
# CC-Codex 协作讨论运行时数据
.cc-codex/
development
Query Midea MX / 美信 local message cache through the MX local HTTP query service from Codex. Use when the user asks to read MX sessions, search chat history, search messages globally or inside a group/session, list recent messages, or page message history. This is read-only and does not require send authorization. Never fall back to reading SQLite or app cache files directly.
development
Safely search MX users or groups and send Midea MX / 美信 IM messages from Codex. Use when the user asks to notify someone, send a message to a person or group, use a configured group alias, @ users, @ all, or send MX file/image messages. Read lookups need no extra authorization; every live send needs explicit user authorization for that exact target and message.
tools
MX channel output rules. Always active in MX conversations.
tools
Use the company WorkSpace `ws` CLI reliably as a delegated coding agent from Codex. Trigger when the user wants Codex to command `ws`, WorkSpace CLI, or the company opencode-derived coding tool to generate code, inspect a repo, run a bounded implementation task, or use a requested WorkSpace model while Codex reviews the output.