"写的不审,审的不写"多模型代码审查工作流。 Claude 写代码,Codex 审代码,循环修复直到无新问题,再提交。 在完成代码实现后触发此技能。
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-cross-review:cross-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- **写的不审**:Claude 专注写代码,不自我审查边界条件
完成功能开发、Bug 修复或重构后,在 git commit 之前运行此工作流。
检查未提交的改动:git diff --stat
列出变更文件清单,确认审查范围
优先方式 - MCP 工具调用(如果 Codex MCP 服务器已加载):
codex MCP 工具,传入变更文件列表,请求代码审查备用方式 - CLI 调用(如果 MCP 不可用):
git diff HEAD | codex "你是严格的代码审查员,分析以下代码变更。用中文输出问题列表,每个问题说明:文件路径:行号、问题类型(逻辑/类型/并发/资源)、具体描述、风险、修复建议。没有问题则输出 NO_ISSUES。"
将 Codex 输出结构化为问题列表:
问题 #1:[类型] [文件:行号]
描述:...
修复方案:...
问题 #2:...
如果 无问题 → 跳到步骤 6
按问题列表逐一修复:
✅ 已修复 #N 或 ⏭️ 跳过 #N(说明原因)重复步骤 2-3,检查:
如果 有新问题 → 回到步骤 4
如果 无新问题 → 继续步骤 6
# 根据项目类型选择合适的验证命令
# lint / typecheck
# build / compile
# test
全部通过后进入步骤 7。如果验证失败 → 修复后回到步骤 2。
git add <相关文件>
git commit -m "$(cat <<'EOF'
<commit message>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
EOF
)"
Codex 审查时应特别关注以下维度:
| 维度 | 检查项 |
|---|---|
| 边界条件 | 空数组/空字符串、零值、极大/极小值、索引越界 |
| 逻辑漏洞 | 条件判断遗漏、逻辑短路错误、状态机缺失状态 |
| 类型安全 | nil/null 解引用、类型断言失败、接口不匹配 |
| 并发安全 | 数据竞争、死锁、未加锁的共享状态 |
| 错误处理 | 忽略 error 返回值、错误信息丢失、panic 未恢复 |
| 资源管理 | 文件/连接未关闭、内存泄漏、defer 使用错误 |
工作流结束时汇报:
## Cross-Review 完成报告
**审查轮次**:N 轮
**发现问题**:N 个
**已修复**:N 个
**跳过**:N 个(含原因)
**验证结果**:✅ 全部通过 / ❌ 部分失败
已提交:<commit hash> <commit message>
npx claudepluginhub atompilot/claude-code-cross-review --plugin claude-code-cross-reviewRuns cross-model code reviews using the external Codex CLI tool from a Claude session. Catches bugs that single-model self-review would miss by leveraging a different reviewer architecture.
Orchestrates cross-agent code review: Claude implements plans/code, Codex CLI reviews via bash scripts. Activates on 'codex review' or Russian triggers.
Creates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.