codex-collab
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodex 协同开发 Skill
Codex Collaborative Development Skill
核心使命
Core Mission
当用户明确要求与 codex 协同时,你必须思考如何与 codex 进行协作,如何调用 Codex MCP 工具作为客观全面分析的保障。
When the user explicitly requests to collaborate with codex, you must consider how to collaborate with codex and how to call the Codex MCP tool as a guarantee for objective and comprehensive analysis.
协作流程(必须执行的 4 个步骤)
Collaboration Process (4 Mandatory Steps)
1. 需求分析与计划完善
1. Requirement Analysis and Plan Refinement
在你对用户需求形成初步分析后,将用户需求、初始思路告知 codex,并要求其完善需求分析和实施计划。
After forming a preliminary analysis of the user's requirements, inform codex of the user's requirements and initial ideas, and request it to refine the requirement analysis and implementation plan.
2. 代码原型索取
2. Code Prototype Request
在实施具体编码任务前,必须向 codex 索要代码实现原型。
关键约束:
- 要求 codex 仅给出 unified diff patch
- 严禁对代码做任何真实修改(使用 )
sandbox="read-only" - 获取原型后,以此为逻辑参考,重写为企业生产级代码
- 确保可读性极高、可维护性极高后,才能实施具体编程修改
Before implementing specific coding tasks, you must request a code implementation prototype from codex.
Key Constraints:
- Require codex to only provide unified diff patch
- Strictly prohibit any actual code modifications (use )
sandbox="read-only" - After obtaining the prototype, use it as a logical reference to rewrite it into enterprise production-level code
- Only proceed with specific programming modifications after ensuring extremely high readability and maintainability
3. 代码 Review
3. Code Review
无论何时,只要完成切实编码行为后,必须立即使用 codex review 代码改动和对应需求完成程度。
Whenever you complete actual coding actions, you must immediately use codex to review the code changes and the degree of requirement fulfillment.
4. 争辩与完善
4. Debate and Refinement
- codex 只能给出参考,你必须有自己的思考
- 需要对 codex 的回答提出质疑
- 通过不断争辩以找到通向真理的唯一途径
- 最终使命是达成统一、全面、精准的意见
- Codex only provides references; you must think independently
- Need to question codex's responses
- Find the only path to truth through continuous debate
- The ultimate mission is to reach a unified, comprehensive, and precise consensus
Codex MCP 工具调用规范
Codex MCP Tool Calling Specifications
工具参数
Tool Parameters
必选参数:
- (string): 发送给 codex 的任务指令
PROMPT - (Path): codex 执行任务的工作目录根路径
cd
可选参数:
- (string): 沙箱策略
sandbox- (默认): 只读模式,最安全
"read-only" - : 允许在工作区写入
"workspace-write" - : 完全访问权限
"danger-full-access"
- (UUID | null): 用于继续之前的会话以与 codex 进行多轮交互,默认为
SESSION_ID(开启新会话)None - (boolean): 是否允许在非 Git 仓库中运行,默认
skip_git_repo_checkFalse - (boolean): 是否返回所有消息(包括推理、工具调用等),默认
return_all_messagesFalse
返回值:
json
// 成功时
{
"success": true,
"SESSION_ID": "uuid-string",
"agent_messages": "agent回复的文本内容",
"all_messages": []
}
// 失败时
{
"success": false,
"error": "错误信息"
}Mandatory Parameters:
- (string): Task instructions sent to codex
PROMPT - (Path): Root path of the working directory where codex executes tasks
cd
Optional Parameters:
- (string): Sandbox strategy
sandbox- (default): Read-only mode, most secure
"read-only" - : Allow writing to the workspace
"workspace-write" - : Full access permission
"danger-full-access"
- (UUID | null): Used to continue previous sessions for multi-round interactions with codex, default is
SESSION_ID(starts a new session)None - (boolean): Whether to allow running in non-Git repositories, default
skip_git_repo_checkFalse - (boolean): Whether to return all messages (including reasoning, tool calls, etc.), default
return_all_messagesFalse
Return Values:
json
// 成功时
{
"success": true,
"SESSION_ID": "uuid-string",
"agent_messages": "agent回复的文本内容",
"all_messages": []
}
// 失败时
{
"success": false,
"error": "错误信息"
}使用方式
Usage Methods
开启新对话:
- 不传 参数(或传
SESSION_ID)None - 工具会返回新的 用于后续对话
SESSION_ID
继续之前的对话:
- 将之前返回的 作为参数传入
SESSION_ID - 同一会话的上下文会被保留
Start a New Conversation:
- Do not pass the parameter (or pass
SESSION_ID)None - The tool will return a new for subsequent conversations
SESSION_ID
Continue a Previous Conversation:
- Pass the returned from the previous interaction as a parameter
SESSION_ID - The context of the same session will be retained
调用规范
Calling Specifications
必须遵守:
- 每次调用 codex 工具时,必须保存返回的 ,以便后续继续对话
SESSION_ID - 参数必须指向存在的目录,否则工具会静默失败
cd - 严禁 codex 对代码进行实际修改,使用 以避免意外
sandbox="read-only" - 要求 codex 仅给出 unified diff patch
推荐用法:
- 如需详细追踪 codex 的推理过程和工具调用,设置
return_all_messages=True - 对于精准定位、debug、代码原型快速编写等任务,优先使用 codex 工具
Must Comply:
- Save the returned every time you call the codex tool to facilitate subsequent conversations
SESSION_ID - The parameter must point to an existing directory, otherwise the tool will fail silently
cd - Strictly prohibit codex from making actual code modifications; use to avoid accidents
sandbox="read-only" - Require codex to only provide unified diff patch
Recommended Usage:
- Set if you need to track codex's reasoning process and tool calls in detail
return_all_messages=True - Prioritize using the codex tool for tasks such as precise positioning, debugging, and rapid code prototype writing
注意事项
Notes
会话管理
Session Management
- 始终追踪 ,避免会话混乱
SESSION_ID - 多轮对话时必须传递正确的
SESSION_ID
- Always track the to avoid session confusion
SESSION_ID - Must pass the correct during multi-round conversations
SESSION_ID
工作目录
Working Directory
- 确保 参数指向正确且存在的目录
cd - 路径错误会导致工具静默失败
- Ensure the parameter points to the correct and existing directory
cd - Path errors will cause the tool to fail silently
错误处理
Error Handling
- 检查返回值的 字段
success - 处理可能的错误情况
- Check the field in the return value
success - Handle possible error situations
协作原则
Collaboration Principles
- codex 提供参考,你必须独立思考
- 通过争辩达成共识,而非盲从
- 最终目标是统一、全面、精准的解决方案
- Codex provides references; you must think independently
- Reach consensus through debate rather than blind obedience
- The ultimate goal is a unified, comprehensive, and precise solution