# codex-monorepo - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 codex-monorepo 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md` 等 Claim：`clm_0004` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md`, `docs/install.md` Claim：`clm_0002` supported 0.86

## 怎么开始

- `npm install -g @openai/codex` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `git clone https://github.com/openai/codex.git` 证据：`docs/install.md` Claim：`clm_0006` supported 0.86
- `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y` 证据：`docs/install.md` Claim：`clm_0007` supported 0.86

## 继续前判断卡

- **当前建议**：先做权限沙盒试用
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：先做权限沙盒试用
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md` 等 Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md`, `docs/install.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0005` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md`, `.codex/skills/code-review-context/SKILL.md` 等
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`, `docs/install.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md`, `.codex/skills/code-review-context/SKILL.md` 等
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`, `docs/install.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0008` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md`, `docs/install.md` Claim：`clm_0009` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.codex/skills/babysit-pr/SKILL.md`, `.codex/skills/code-review/SKILL.md`, `.codex/skills/code-review-breaking-changes/SKILL.md`, `.codex/skills/code-review-change-size/SKILL.md` 等 Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md`, `docs/install.md` Claim：`clm_0002` supported 0.86

### 上下文规模

- 文件总数：3948
- 重要文件覆盖：40/3948
- 证据索引条目：80
- 角色 / Skill 条目：16

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 codex-monorepo 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 codex-monorepo 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 codex-monorepo 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```


## 角色 / Skill 索引

- 共索引 16 个角色 / Skill / 项目文档条目。

- **babysit-pr**（skill）：Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep watching open PRs so fresh review feedback is surfaced promptly. Use when the user asks Codex to monitor… 激活提示：当用户任务与“babysit-pr”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/babysit-pr/SKILL.md`
- **code-breaking-changes**（skill）：Breaking changes 激活提示：当用户任务与“code-breaking-changes”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/code-review-breaking-changes/SKILL.md`
- **code-review-change-size**（skill）：Change size guidance 800 lines 激活提示：当用户任务与“code-review-change-size”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/code-review-change-size/SKILL.md`
- **code-review-context**（skill）：Model visible context 激活提示：当用户任务与“code-review-context”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/code-review-context/SKILL.md`
- **code-review-testing**（skill）：Test authoring guidance 激活提示：当用户任务与“code-review-testing”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/code-review-testing/SKILL.md`
- **code-review**（skill）：Run a final code review on a pull request 激活提示：当用户任务与“code-review”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/code-review/SKILL.md`
- **codex-bug**（skill）：Diagnose GitHub bug reports in openai/codex. Use when given a GitHub issue URL from openai/codex and asked to decide next steps such as verifying against the repo, requesting more info, or explaining why it is not a bug; follow any additional user-provided instructions. 激活提示：当用户任务与“codex-bug”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/codex-bug/SKILL.md`
- **codex-issue-digest**（skill）：Run a GitHub issue digest for openai/codex by feature-area labels, all areas, and configurable time windows. Use when asked to summarize recent Codex bug reports or enhancement requests, especially for owner-specific labels such as tui, exec, app, or similar areas. 激活提示：当用户任务与“codex-issue-digest”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/codex-issue-digest/SKILL.md`
- **codex-pr-body**（skill）：Update the title and body of one or more pull requests. 激活提示：当用户任务与“codex-pr-body”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/codex-pr-body/SKILL.md`
- **remote-tests**（skill）：How to run tests using remote executor. 激活提示：当用户任务与“remote-tests”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/remote-tests/SKILL.md`
- **test-tui**（skill）：Guide for testing Codex TUI interactively 激活提示：当用户任务与“test-tui”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.codex/skills/test-tui/SKILL.md`
- **imagegen**（skill）：Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handl… 激活提示：当用户任务与“imagegen”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`codex-rs/skills/src/assets/samples/imagegen/SKILL.md`
- **openai-docs**（skill）：Use when the user asks how to build with OpenAI products or APIs and needs up-to-date official documentation with citations, help choosing the latest model for a use case, or model upgrade and prompt-upgrade guidance; prioritize OpenAI docs MCP tools, use bundled references only as helper context, and restrict any fallback browsing to official OpenAI domains. 激活提示：当用户任务与“openai-docs”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`codex-rs/skills/src/assets/samples/openai-docs/SKILL.md`
- **plugin-creator**（skill）：Create and scaffold plugin directories for Codex with a required .codex-plugin/plugin.json , optional plugin folders/files, and baseline placeholders you can edit before publishing or testing. Use when Codex needs to create a new personal plugin, add optional plugin structure, or generate or update personal or repo-root .agents/plugins/marketplace.json entries for plugin ordering and availability metadata. 激活提示：当用户任务与“plugin-creator”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`codex-rs/skills/src/assets/samples/plugin-creator/SKILL.md`
- **skill-creator**（skill）：Guide for creating effective skills. This skill should be used when users want to create a new skill or update an existing skill that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations. 激活提示：当用户任务与“skill-creator”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`codex-rs/skills/src/assets/samples/skill-creator/SKILL.md`
- **skill-installer**（skill）：Install Codex skills into $CODEX HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo including private repos . 激活提示：当用户任务与“skill-installer”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`codex-rs/skills/src/assets/samples/skill-installer/SKILL.md`

## 证据索引

- 共索引 80 条证据。

- **Contributing**（documentation）：External contributions are by invitation only 证据：`docs/contributing.md`
- **Installing & building**（documentation）：Requirement Details --------------------------- --------------------------------------------------------------- Operating systems macOS 12+, Ubuntu 20.04+/Debian 10+, or Windows 11 via WSL2 Git optional, recommended 2.23+ for built-in PR helpers RAM 4-GB minimum 8-GB recommended 证据：`docs/install.md`
- **Containerized Development**（documentation）：- devcontainer.json keeps the existing Codex contributor setup for working on this repository. - devcontainer.secure.json adds a customer-oriented profile with stricter outbound network controls. 证据：`.devcontainer/README.md`
- **Rust/codex-rs**（documentation）：In the codex-rs folder where the rust code lives: 证据：`AGENTS.md`
- **Quickstart**（documentation）：npm i -g @openai/codex or brew install --cask codex Codex CLI is a coding agent from OpenAI that runs locally on your computer. If you want Codex in your code editor VS Code, Cursor, Windsurf , install in your IDE. If you want the desktop app experience, run codex app or visit the Codex App page . If you are looking for the cloud-based agent from OpenAI, Codex Web , go to chatgpt.com/codex . 证据：`README.md`
- **Codex CLI Rust Implementation**（documentation）：We provide Codex CLI as a standalone executable to ensure a zero-dependency install. 证据：`codex-rs/README.md`
- **Workflow Strategy**（documentation）：The workflows in this directory are split so that pull requests get fast, review-friendly signal while main still gets the full cross-platform verification pass. 证据：`.github/workflows/README.md`
- **npm releases**（documentation）：Use the staging helper in the repo root to generate npm tarballs for a release. For example, to stage the CLI, responses proxy, and SDK packages for version 0.6.0 : 证据：`codex-cli/scripts/README.md`
- **oai-codex-ansi-escape**（documentation）：Small helper functions that wrap functionality from : 证据：`codex-rs/ansi-escape/README.md`
- **codex-app-server-client**（documentation）：Shared in-process app-server client used by conversational CLI surfaces: 证据：`codex-rs/app-server-client/README.md`
- **codex-app-server-daemon**（documentation）：codex-app-server-daemon is experimental and its lifecycle contract may change while the remote-management flow is still being developed. 证据：`codex-rs/app-server-daemon/README.md`
- **App Server Test Client**（documentation）：App Server Test Client Quickstart for running and hitting codex app-server . 证据：`codex-rs/app-server-test-client/README.md`
- **codex-app-server**（documentation）：codex app-server is the interface Codex uses to power rich interfaces such as the Codex VS Code extension https://marketplace.visualstudio.com/items?itemName=openai.chatgpt . 证据：`codex-rs/app-server/README.md`
- **ChatGPT**（documentation）：This crate pertains to first party ChatGPT APIs and products such as Codex agent. 证据：`codex-rs/chatgpt/README.md`
- **codex-api**（documentation）：Typed clients for Codex/OpenAI APIs built on top of the generic transport in codex-client . 证据：`codex-rs/codex-api/README.md`
- **codex-client**（documentation）：Generic transport layer that wraps HTTP requests, retries, and streaming primitives without any Codex/OpenAI awareness. 证据：`codex-rs/codex-client/README.md`
- **codex-config loader**（documentation）：This module is the canonical place to load and describe Codex configuration layers user config, CLI/session overrides, managed config, and MDM-managed preferences and to produce: 证据：`codex-rs/config/src/loader/README.md`
- **codex-core**（documentation）：This crate implements the business logic for Codex. It is designed to be used by the various Codex UIs written in Rust. 证据：`codex-rs/core/README.md`
- **codex-debug-client**（documentation）：WARNING: this code is mainly generated by Codex and should not be used in production 证据：`codex-rs/debug-client/README.md`
- **codex-exec-server**（documentation）：codex-exec-server is the library backing codex exec-server , a small JSON-RPC server for spawning and controlling subprocesses through codex-utils-pty . 证据：`codex-rs/exec-server/README.md`
- **codex-execpolicy-legacy**（documentation）：This crate hosts the original execpolicy implementation. The newer prefix-rule engine lives in codex-execpolicy . 证据：`codex-rs/execpolicy-legacy/README.md`
- **codex-execpolicy**（documentation）：- Policy engine and CLI built around prefix rule pattern= ... , decision?, justification?, match?, not match? plus host executable name=..., paths= ... . - This release covers the prefix-rule subset of the execpolicy language plus host executable metadata; a richer language will follow. - Tokens are matched in order; any pattern element may be a list to denote alternatives. decision defaults to allow ; valid values: allow , prompt , forbidden . - justification is an optional human-readable rationale for why a rule exists. It can be provided for any decision and may be surfaced in different contexts for example, in approval prompts or rejection messages . When decision = "forbidden" is used,… 证据：`codex-rs/execpolicy/README.md`
- **codex file search**（documentation）：Fast fuzzy file search tool for Codex. 证据：`codex-rs/file-search/README.md`
- **codex-git-utils**（documentation）：Helpers for interacting with git, including patch application. The crate also exposes a lightweight baseline API for internal directories that use git only as a resettable diff mechanism: ensure git baseline repository preserves a usable root/.git baseline or creates one when it is missing or unusable, reset git repository replaces root/.git with a fresh one-commit baseline, and diff since latest init returns structured file changes plus a unified diff from that baseline to the current directory contents. 证据：`codex-rs/git-utils/README.md`
- **codex-linux-sandbox**（documentation）：This crate is responsible for producing: 证据：`codex-rs/linux-sandbox/README.md`
- **Memories**（documentation）：This directory owns reusable memory crates and the memory pipeline documentation. 证据：`codex-rs/memories/README.md`
- **codex-network-proxy**（documentation）：codex-network-proxy is Codex's local network policy enforcement proxy. It runs: 证据：`codex-rs/network-proxy/README.md`
- **codex-otel**（documentation）：codex-otel is the OpenTelemetry integration crate for Codex. It provides: 证据：`codex-rs/otel/README.md`
- **codex-process-hardening**（documentation）：This crate provides pre main hardening , which is designed to be called pre- main using ctor::ctor to perform various process hardening steps, such as 证据：`codex-rs/process-hardening/README.md`
- **codex-protocol**（documentation）：This crate defines the "types" for the protocol used by Codex CLI, which includes both "internal types" for communication between codex-core and codex-tui , as well as "external types" used with codex app-server . 证据：`codex-rs/protocol/README.md`
- **codex-responses-api-proxy**（documentation）：Launch the proxy, dump request/response pairs to /tmp/proxy cd path/to/codex/codex-rs cargo build echo $OPENAI API KEY ./target/debug/codex-responses-api-proxy \ --port 60001 \ --dump-dir /tmp/proxy 证据：`codex-rs/responses-api-proxy/README.md`
- **@openai/codex-responses-api-proxy**（documentation）：npm i -g @openai/codex-responses-api-proxy to install codex-responses-api-proxy 证据：`codex-rs/responses-api-proxy/npm/README.md`
- **Rollout Trace**（documentation）：Privacy: Rollout tracing is not telemetry. Codex does not upload or report these traces; it writes local bundles only when CODEX ROLLOUT TRACE ROOT is set. Those local bundles can contain prompts, responses, tool inputs/outputs, terminal output, and paths, so treat them as sensitive. 证据：`codex-rs/rollout-trace/README.md`
- **codex-shell-escalation**（documentation）：This crate contains the Unix shell-escalation protocol implementation and the codex-execve-wrapper executable. 证据：`codex-rs/shell-escalation/README.md`
- **codex-stdio-to-uds**（documentation）：Traditionally, there are two transport mechanisms for an MCP server: stdio and HTTP. 证据：`codex-rs/stdio-to-uds/README.md`
- **ThreadManager Sample**（documentation）：Small one-shot binary that starts a Codex thread with ThreadManager from codex-core-api , submits a single user turn, and prints the final assistant message. 证据：`codex-rs/thread-manager-sample/README.md`
- **Thread Store**（documentation）：codex-thread-store is the storage boundary for Codex threads. It defines the ThreadStore trait plus local and in-memory implementations. Other storage implementations may live outside this repository. 证据：`codex-rs/thread-store/README.md`
- **codex-tool-api**（documentation）：codex-tool-api is the minimal extension-facing contract for contributed function tools that can be injected into Codex without making codex-core depend on the tool owner's crate. 证据：`codex-rs/tool-api/README.md`
- **codex-tools**（documentation）：codex-tools is the host-side support crate for building, adapting, and planning tool sets outside codex-core . 证据：`codex-rs/tools/README.md`
- **TUI bottom pane state machines**（documentation）：When changing the paste-burst or chat-composer state machines in this folder, keep the docs in sync: 证据：`codex-rs/tui/src/bottom_pane/AGENTS.md`
- **codex-utils-cargo-bin runfiles strategy**（documentation）：codex-utils-cargo-bin runfiles strategy 证据：`codex-rs/utils/cargo-bin/README.md`
- **codex-utils-pty**（documentation）：Lightweight helpers for spawning interactive processes either under a PTY pseudo terminal or regular pipes. The public API is minimal and mirrors both backends so callers can switch based on their needs e.g., enabling or disabling TTY . 证据：`codex-rs/utils/pty/README.md`
- **codex-utils-stream-parser**（documentation）：Small, dependency-free utilities for parsing streamed text incrementally. 证据：`codex-rs/utils/stream-parser/README.md`
- **codex-utils-template**（documentation）：Small, strict string templating for prompt and text assets. 证据：`codex-rs/utils/template/README.md`
- **Readme**（documentation）：Many container runtime tools like systemd-nspawn , docker , etc. focus on providing infrastructure for system administrators and orchestration tools e.g. Kubernetes to run containers. 证据：`codex-rs/vendor/bubblewrap/README.md`
- **Codex CLI Runtime for Python SDK**（documentation）：Platform-specific runtime package consumed by the published openai-codex . 证据：`sdk/python-runtime/README.md`
- **OpenAI Codex Python SDK Experimental**（documentation）：OpenAI Codex Python SDK Experimental 证据：`sdk/python/README.md`
- **Python SDK Examples**（documentation）：Each example folder contains runnable versions: 证据：`sdk/python/examples/README.md`
- **Codex SDK**（documentation）：Embed the Codex agent in your workflows and apps. 证据：`sdk/typescript/README.md`
- **rusty v8 Consumer Artifacts**（documentation）：This directory wires the v8 crate to exact-version Bazel inputs. Bazel consumer builds use: 证据：`third_party/v8/README.md`
- **argument-comment-lint**（documentation）：Isolated Dylint https://github.com/trailofbits/dylint library for enforcing Rust argument comments in the exact / param / shape. 证据：`tools/argument-comment-lint/README.md`
- **Package**（package_manifest）：{ "name": "@openai/codex", "version": "0.0.0-dev", "license": "Apache-2.0", "bin": { "codex": "bin/codex.js" }, "type": "module", "engines": { "node": " =16" }, "files": "bin", "vendor" , "repository": { "type": "git", "url": "git+https://github.com/openai/codex.git", "directory": "codex-cli" }, "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319" } 证据：`codex-cli/package.json`
- **Package**（package_manifest）：{ "name": "codex-monorepo", "private": true, "description": "Tools for repo-wide maintenance.", "scripts": { "format": "prettier --check .json .md docs/ .md .github/workflows/ .yml / .js", "format:fix": "prettier --write .json .md docs/ .md .github/workflows/ .yml / .js", "write-hooks-schema": "cargo run --manifest-path ./codex-rs/Cargo.toml -p codex-hooks --bin write hooks schema fixtures" }, "devDependencies": { "prettier": "^3.5.3" }, "resolutions": { "@modelcontextprotocol/sdk": "1.26.0", "braces": "^3.0.3", "flatted": "3.4.2", "glob@10.4.5": "10.5.0", "handlebars": "4.7.9", "micromatch": "^4.0.8", "minimatch@3.1.2": "3.1.4", "minimatch@9.0.5": "9.0.7", "path-to-regexp": "8.4.0", "picom… 证据：`package.json`
- **Package**（package_manifest）：{ "name": "codex-devcontainer-install", "private": true, "description": "Locked Codex CLI install boundary for the secure devcontainer.", "dependencies": { "@openai/codex": "0.121.0" }, "engines": { "node": " =22", "pnpm": " =10.33.0" }, "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319" } 证据：`.devcontainer/codex-install/package.json`
- **Package**（package_manifest）：{ "name": "@openai/codex-responses-api-proxy", "version": "0.0.0-dev", "license": "Apache-2.0", "bin": { "codex-responses-api-proxy": "bin/codex-responses-api-proxy.js" }, "type": "module", "engines": { "node": " =16" }, "files": "bin", "vendor" , "repository": { "type": "git", "url": "git+https://github.com/openai/codex.git", "directory": "codex-rs/responses-api-proxy/npm" }, "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319" } 证据：`codex-rs/responses-api-proxy/npm/package.json`
- **Package**（package_manifest）：{ "name": "@openai/codex-sdk", "version": "0.0.0-dev", "description": "TypeScript SDK for Codex APIs.", "repository": { "type": "git", "url": "git+https://github.com/openai/codex.git", "directory": "sdk/typescript" }, "keywords": "openai", "codex", "sdk", "typescript", "api" , "license": "Apache-2.0", "type": "module", "engines": { "node": " =18" }, "module": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, "files": "dist" , "sideEffects": false, "scripts": { "clean": "rm -rf dist", "build": "tsup", "build:watch": "tsup --watch", "lint": "pnpm eslint \"src/ / .ts\" \"tests/ / .ts\"", "lint:fix": "pnpm eslint… 证据：`sdk/typescript/package.json`
- **PR Babysitter**（skill_instruction）：Objective Babysit a PR persistently until one of these terminal outcomes occurs: 证据：`.codex/skills/babysit-pr/SKILL.md`
- **Skill**（skill_instruction）：Search for breaking changes in external integration surfaces: - app-server APIs - CLI parameters - configuration loading - resuming sessions from existing rollouts 证据：`.codex/skills/code-review-breaking-changes/SKILL.md`
- **Skill**（skill_instruction）：Unless the change is mechanical the total number of changed lines should not exceed 800 lines. For complex logic changes the size should be under 500 lines. 证据：`.codex/skills/code-review-change-size/SKILL.md`
- **Skill**（skill_instruction）：Codex maintains a context history of messages that is sent to the model in inference requests. 证据：`.codex/skills/code-review-context/SKILL.md`
- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`docs/contributing.md`, `docs/install.md`, `.devcontainer/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`docs/contributing.md`, `docs/install.md`, `.devcontainer/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **项目概述**：importance `high`
  - source_paths: README.md, AGENTS.md
- **系统架构**：importance `high`
  - source_paths: codex-rs/app-server-protocol/src/lib.rs, codex-rs/app-server/src/lib.rs, codex-rs/app-server-transport/src/lib.rs
- **协议层详解**：importance `high`
  - source_paths: codex-rs/app-server-protocol/src/protocol/mod.rs, codex-rs/app-server-protocol/src/protocol/v1.rs, codex-rs/app-server-protocol/src/protocol/v2/mod.rs, codex-rs/app-server-protocol/schema/json
- **核心Agent模块**：importance `high`
  - source_paths: codex-rs/core/src/lib.rs, codex-rs/core/src/agent/mod.rs, codex-rs/core/src/client.rs, codex-rs/core/src/session/mod.rs, codex-rs/core/src/tools/mod.rs
- **执行系统**：importance `high`
  - source_paths: codex-rs/exec-server/src/lib.rs, codex-rs/core/src/unified_exec/mod.rs, codex-rs/core/src/exec.rs, codex-rs/shell-command/src/lib.rs
- **终端用户界面**：importance `high`
  - source_paths: codex-rs/tui/src/lib.rs, codex-rs/tui/src/chatwidget.rs, codex-rs/tui/src/bottom_pane/mod.rs, codex-rs/tui/src/app.rs
- **技能系统**：importance `medium`
  - source_paths: codex-rs/core-skills/src/lib.rs, codex-rs/core-skills/src/manager.rs, codex-rs/core-skills/src/loader.rs, .codex/skills/code-review/SKILL.md, .codex/skills/codex-bug/SKILL.md
- **插件系统**：importance `medium`
  - source_paths: codex-rs/core-plugins/src/lib.rs, codex-rs/core-plugins/src/manager.rs, codex-rs/core-plugins/src/marketplace.rs, codex-rs/ext/extension-api/src/lib.rs

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `9c5dfa7b1a8ee8672e1313859ca0d11b3817b932`
- inspected_files: `pnpm-lock.yaml`, `package.json`, `README.md`, `docs/example-config.md`, `docs/execpolicy.md`, `docs/exec.md`, `docs/contributing.md`, `docs/authentication.md`, `docs/skills.md`, `docs/getting-started.md`, `docs/sandbox.md`, `docs/install.md`, `docs/slash_commands.md`, `docs/agents_md.md`, `docs/open-source-fund.md`, `docs/CLA.md`, `docs/config.md`, `docs/license.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：Selected model is at capacity. Please try a different model. The same error everyday

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Selected model is at capacity. Please try a different model. The same error everyday
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | cevd_2839c851344f4b669bd1c21b29e7bd08 | https://github.com/openai/codex/issues/22456 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Extensive UI flickering when codex is working

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：Extensive UI flickering when codex is working
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_47a11c3a9f3943168527e0a086872c1f | https://github.com/openai/codex/issues/11901 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Codex Desktop voice transcription blocked by Cloudflare challenge on /backend-api/transcribe after resolved incident

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Codex Desktop voice transcription blocked by Cloudflare challenge on /backend-api/transcribe after resolved incident
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | cevd_dcdaacada441496491e68dd4db3d802b | https://github.com/openai/codex/issues/21985 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：Codex IDE extension fails GitHub MCP startup with "connection closed: initialize response" in PyCharm AI Chat

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Codex IDE extension fails GitHub MCP startup with "connection closed: initialize response" in PyCharm AI Chat
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_45286dbe57a44800be79bc6a5819956f | https://github.com/openai/codex/issues/22461 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 来源证据：Iranian phone numbers are not supported for Codex login

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Iranian phone numbers are not supported for Codex login
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | cevd_d651d7b5cf594cafa27dfffa45890baa | https://github.com/openai/codex/issues/21918 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 来源证据：Codex Desktop falsely reports @chrome plugin unavailable when bundled Chrome plugin is installed

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Codex Desktop falsely reports @chrome plugin unavailable when bundled Chrome plugin is installed
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_a0eee5b5c5fb447ebe2c2d3bdf74aa33 | https://github.com/openai/codex/issues/22463 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 来源证据：Windows Chrome plugin hangs in setupAtlasRuntime despite extension/native host checks passing

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Windows Chrome plugin hangs in setupAtlasRuntime despite extension/native host checks passing
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_4d667016a4ab4f9aa5416a3b08e71d55 | https://github.com/openai/codex/issues/22462 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | github_repo:965415649 | https://github.com/openai/codex | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：/goal-first sessions are missing from resume lists

- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：/goal-first sessions are missing from resume lists
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_e65f6682c39b409a8c96267f4bdc1d3e | https://github.com/openai/codex/issues/20792 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 来源证据：I have to set up the workspace every time I start a new session. My Codex usage quota is decreasing automatically even…

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：I have to set up the workspace every time I start a new session. My Codex usage quota is decreasing automatically even though I haven’t used it at all.
- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | cevd_f8afe7124b3e44cfacbc62a9e001179c | https://github.com/openai/codex/issues/22457 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
