克劳德法典
用于协作人工智能开发的Claude Code设置:Claude与Opus、Codex实施或审查、Sonnet实施或审查一起制定计划。五种技能(及其等效命令)驱动一个结构化的计划→ 实施→ 审查循环。
技能(推荐)
技能是主要的界面。它们通过技能创建者支持基于eval的测试,并且比命令更容易迭代。
| 技能 | 触发器 | 描述 |
|---|---|---|
plan-codex | /plan-codex | Claude与Opus、Codex一起计划正确性/完整性/安全性审计,直至获得批准 |
claude-codex | /claude-codex | 克劳德实施,食典审查,批准/警告/阻止裁决 |
execute-codex | /execute-codex | 基于大小的智能路由:Claude(小)或Codex(大)实现,代码审查员审查 |
tdd-claude-codex | /tdd-claude-codex | TDD:Claude编写测试,Codex审核测试,Claude实施,Codex审查实施 |
tdd-execute-codex | /tdd-execute-codex | TDD:Claude编写测试、Codex审计测试、实现的智能路由、代码审查员审查 |
命令(commands/)为了向后兼容性而保留——它们支持模型固定和显式 allowed-tools 技能无法强制执行的限制。
运作原理
/plan-codex
Claude Opus + Plan agent → creates structured plan
Codex audits the plan → flags issues (max 3 rounds)
Plan saved to .claude/plan/.md
/execute-codex
Small change (≤2 files, ≤30 lines) → Claude implements directly
Large change → Codex implements
feature-dev code-reviewer agent → reviews diff (max 3 rounds)
/claude-codex
Claude implements (any model) → Edit/Write + self-verify
Codex reviews uncommitted changes → returns structured verdict (APPROVED/WARNING/BLOCKED)
Claude fixes CRITICAL/HIGH issues → re-reviews (max 3 rounds)
MEDIUM/LOW issues → user decides before delivery依赖项
1.克劳德密码
从以下位置安装 claude.ai/code.
2.OpenAI Codex命令行界面
npm install -g @openai/codex使用您的OpenAI API密钥进行身份验证:
export OPENAI_API_KEY=your-key-here3.功能开发插件
此设置使用 code-reviewer 代理来自 claude插件官方.
在Claude Code中安装插件:
claude plugin add claude-plugins-official/feature-dev安装
1.克隆和复制文件
git clone https://github.com//claude-codex
cd claude-codex
cp -r skills/* ~/.claude/skills/
cp -r prompts/* ~/.claude/prompts/
cp -r commands/* ~/.claude/commands/ # optional: for model pinning / tool restrictions2.配置Codex
通过添加以下内容来抑制推理标记 ~/.codex/config.toml:
hide_agent_reasoning = true3.将Codex添加为MCP服务器
claude mcp add codex -s user -- codex -c model=gpt-5.3-codex -c model_reasoning_effort=high mcp-server调整 model 和 model_reasoning_effort (low/medium/high/xhigh)根据您的喜好。
4.重新启动克劳德代码
/exit
claude验证MCP服务器是否已连接:
/mcp用法
规划
/plan-codex Add JWT authentication to the APIClaude Opus使用内置 Plan agent研究你的代码库并制定一个结构化的计划。食品法典委员会对其正确性、安全性和完整性进行审计。已批准的计划已保存到 .claude/plan/.md.
执行(Codex实施,Sonnet审查)
/execute-codex .claude/plan/jwt-auth.md或者跳过直接任务的计划步骤:
/execute-codex Fix the null pointer in user.service.ts克劳德自动路由:
- 零钱 (≤2个文件,≤30行,无新逻辑)--Claude直接实现,Sonnet评论
- 最大变化 --Codex实施、Sonnet审查和反馈(最多3轮)
执行(克劳德实施,食典审查)
/claude-codex .claude/plan/jwt-auth.md或者对于直接任务:
/claude-codex Add input validation to the registration endpointClaude使用活动模型实现(默认:Sonnet;用覆盖 /model opus 对于较重的任务)。食典委通过MCP审查未提交的差异,返回结构化裁决(批准/警告/阻止):
- 已屏蔽 (关键问题)-克劳德修复,食典重新审查(最多3轮)
- 警告 (高问题)-克劳德修复,食品法典委员会重新审查(最多3轮)
- 中/低问题 --呈现给用户;用户决定是否在交付前修复
模型覆盖
命令有默认值(plan-codex → Opus, execute-codex → 十四行诗)。每个会话覆盖:
/model opus
/execute-codex .claude/plan/complex-feature.md文件结构
~/.claude/
├── skills/
│ ├── codex-mcp/
│ │ ├── SKILL.md # Auto-loaded Codex MCP usage knowledge
│ │ └── reference.md # Detailed patterns and examples
│ ├── plan-codex/
│ │ ├── SKILL.md # /plan-codex skill
│ │ ├── codex-analyzer-role.md # Bundled Codex role for plan auditing
│ │ └── evals/evals.json # Eval scenarios for skill-creator
│ ├── claude-codex/
│ │ ├── SKILL.md # /claude-codex skill
│ │ └── evals/evals.json
│ ├── execute-codex/
│ │ ├── SKILL.md # /execute-codex skill
│ │ ├── codex-architect-role.md # Bundled Codex role for implementation
│ │ └── evals/evals.json
│ ├── tdd-claude-codex/
│ │ ├── SKILL.md # /tdd-claude-codex skill
│ │ ├── codex-analyzer-role.md # Bundled Codex role for test auditing
│ │ ├── tdd-specialist-role.md # Bundled TDD specialist role for test writing
│ │ └── evals/evals.json
│ └── tdd-execute-codex/
│ ├── SKILL.md # /tdd-execute-codex skill
│ ├── codex-architect-role.md # Bundled Codex role for implementation
│ ├── tdd-specialist-role.md # Bundled TDD specialist role for test writing
│ └── evals/evals.json
├── commands/ # Deprecated — retained for backward compatibility
│ ├── plan-codex.md
│ ├── execute-codex.md
│ ├── claude-codex.md
│ ├── tdd-claude-codex.md
│ └── tdd-execute-codex.md
└── prompts/
└── codex/
├── analyzer.md # Codex role: plan auditor (source for skill bundles)
├── architect.md # Codex role: implementer (source for skill bundles)
└── reviewer.md # Codex role: code reviewer这 prompts/codex/ 文件被注入 developer-instructions 在每次Codex MCP呼吁中,塑造其每个阶段的行为。
学分
prompts/codex/角色提示(analyzer.md,architect.md,reviewer.md)来源于 ccg工作流程 冯绍1227,麻省理工学院授权。
备注
- 计划保存到
.claude/plan/在项目目录中--添加到.gitignore如果你不想让他们屈服 - 所有循环最多迭代3次,以保持令牌使用的可预测性
- 这
codex-mcp当Codex MCP工具相关时,技能会自动加载,为Claude提供会话管理模式和最佳实践 /claude-codex使用Codex MCP服务器进行审查——Codex运行git diff HEAD它本身只返回结构化的判决,最大限度地减少了令牌的使用
