大模型应用
将 Claude Code 指令、技能、代理、hooks…
当你需要把受支持的 Claude Code instruction files、skills、agents、hooks、MCP config 迁移为 Codex 项目级或全局级文件时使用。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 60/100 ×0.15
适用场景
将 Claude Code 指令、技能、特定
解决思路
- 持续执行直到选定迁移完全完成:运行 migrator,检查报告,修复迁移后的 Codex instructions/skills/agents/MCP config,并重新运行检查,不要停下来请求确认下一步。
- 如果用户已选择目标,在创建、编辑、替换或删除该目标中的生成 Codex artifacts 前不要询问,包括 `AGENTS.md`、`.codex/`、`.agents/` 或 `~/.codex/`。
- 保留 `.codex/config.toml` 或 `~/.codex/config.toml` 中不相关的现有 Codex 配置项,例如 `notify`、`projects`、`marketplaces` 或不相关 MCP servers;除非它们验证失败或与迁移直接冲突,否则不要询问。
- 不要编辑源 Claude Code 文件(`.claude/`、`~/.claude/`、`.mcp.json` 或 `.claude.json`)、无关项目代码、secrets 或另一个 repository。
- 对每个选定的 global 或 project source,按迁移顺序运行迁移。
- 开始迁移时使用 Codex 内置 TODO/task list tool。
- 不要创建 `MIGRATION_TODOS.md` 或任何 TODO 文件,除非用户明确要求。
- TODO list 输入使用 `plan` 数组,其中每项有 `step` 和 `status`;使用状态 `pending`、`in_progress` 和 `completed`。
- 让 TODO 特定于选定的 artifacts。
- 完成前更新 TODO list,使每个已完成步骤标记为 `completed`,且没有步骤停留在 `in_progress`。
- 使用字面 source → Codex target 标签,例如 `Inspect .claude/commands → Codex skills/prompts`。
- 使用标签 `Inspect .claude/agents → .codex/agents`。
- 使用标签 `Inspect .mcp.json → .codex/config.toml MCP servers`。
- 使用标签 `Inspect .claude/settings.json hooks → .codex/hooks.json`。
- 使用标签 `Migrate safe selected artifacts → Codex files`。
- 使用标签 `Validate generated .codex/config.toml`。
- 使用标签 `Validate generated .codex/agents`。
- 使用标签 `Report migrated artifacts and manual-review items`。
- 读取 `references/differences.md`;如果其 `Docs last checked` 日期过旧,刷新 Codex docs。
- 写入前用 `--scan-only` 扫描并列出活动和非活动 source surfaces。
- 写入前用 `--plan` 打印 staged Codex artifact 路径和 report rows。
- 写入前用 `--doctor` 总结 readiness、manual-review 工作和 validation 风险。
- 按 CLI 使用的相同顺序转换 surfaces:instructions 将 `CLAUDE.md` / `AGENTS.md` 转为 `AGENTS.md`。
- 按 CLI 顺序转换 plugins:将 Claude plugin trees 和 marketplaces 报告为 manual migration work。
- 按 CLI 顺序转换 hooks:将受支持的 Claude hooks 重写到 `.codex/hooks.json`,并启用 `[features].codex_hooks = true`。
- 按 CLI 顺序转换 skills 和 commands:在 `.agents/skills/` 下写入 Codex skills。
- 按 CLI 顺序转换 config:从 Claude model/sandbox settings 和 MCP servers 写入 `.codex/config.toml`,生成 config 时包含 `personality = "friendly"`。
- 按 CLI 顺序转换 subagents:在 `.codex/agents/` 下写入 Codex custom agents。
- 先 dry-run,然后写入选定目标。
- 仅当应删除 orphan generated skills 或 agents 时使用 `--replace`。
- 真实运行后检查 terminal 输出和 `.codex/migrate-to-codex-report.txt`。
- 按以下顺序审查生成 artifacts:`AGENTS.md`、`.agents/skills/`、`.codex/config.toml`、`.codex/hooks.json`、`.codex/agents/`,然后 report-only plugin items。
- 编辑后对每个 target 运行 `--validate-target`。
- 编辑后重新运行检查和 `--dry-run`。
- 返回最终迁移报告:每个有行的 scope 一个 markdown table。
- 报告表只覆盖你执行的非原生后续迁移工作,例如从 slash commands 创建的 skills、subagents、MCP servers、hooks、unsupported/local plugin notes、manual-review caveats。
- 仅当你在本次后续运行中亲自迁移了 config、instructions、skills 或 supported plugins 的 programmatic native import rows 时,才包含这些 native import rows。
- 如果只有一个 scope 有行,只渲染该表且不加 heading。
- 如果有多个 scope 有行,在每个表前渲染一个 heading。
- User-scope rows 使用 `**User Config**` 作为 heading。
- Project-scope rows 使用实际 project folder name 作为 heading,例如 `**northstar-support-portal**`;不要使用 `Current Project` 作为 heading。
- 不要在表输出前后添加 prose。
- 报告表使用精确列 `| Status | Item | Notes |`。
- `Status` 必须是 `Added`、`Check before using` 或 `Not Added`。
- 当创建或更改了面向 Codex 的 artifact 且无需特别审查时,使用 `Added`。
- 当创建或更改了面向 Codex 的 artifact 但迁移改变了语义、推断了行为、将 tool rules 保留为 guidance 或丢弃了不支持的行为时,使用 `Check before using`。
- 当检测到源 artifact 但没有创建面向 Codex 的 artifact 时,使用 `Not Added`。
- `Item` 在一个单元格中组合 artifact type 和具体 item name。
- Artifact type 必须是单数:`Skill`、`Slash command`、`Subagent`、`MCP`、`Hook` 或 `Plugin`。
- 将 artifact type 包裹在 inline code 中;item name 写在后面纯文本。
- `Notes` 始终必填,绝不留空。
- 保持 notes 简短、平实、字面。
- 避免内部实现术语,例如 runtime expansion。
- 优先使用短语如 `Converted into a Codex skill`、`Added as a Codex subagent`、`Added to Codex config`、`Converted into a Codex hook`、`Converted, but some Claude hook behavior differs in Codex`、`Codex does not have an equivalent notification hook`、`Plugin needs manual setup`、`Plugin marketplace needs manual setup`。
- 自愈循环中持续循环直到选定迁移完成。
- 自愈循环:运行 `--plan` 或 `--doctor`。
- 自愈循环:用 `--dry-run` 运行迁移。
- 自愈循环:真实运行迁移。
- 自愈循环:修复每个生成的 `## MANUAL MIGRATION REQUIRED` block 和每个可在 Codex artifacts 内解决的 `manual_fix_required` 或 `skipped` report row。
- 自愈循环:运行 `--validate-target`。
- 自愈循环:重新运行 migrator 和 validator,直到 report 和 validator 没有可操作的 generated-artifact fixes。
- 自愈循环中不要编辑源 Claude Code 文件、无关项目代码、secrets 或另一个 repository。
- 如果 report row 需要 source-provider changes 或 product judgment,保留生成的 Codex artifact 并附清晰 manual guidance,而不是修改 source。
- 设置 migrator 命令:`MIGRATE_TO_CODEX='python3 .codex/skills/migrate-to-codex/scripts/migrate-to-codex.py'`。
- 写入前检查迁移:运行 `$MIGRATE_TO_CODEX --source ~/.claude/ --scan-only`。
- 写入前检查迁移:运行 `$MIGRATE_TO_CODEX --source ~/.claude/ --target ~/.codex/ --plan`。
- 写入前检查迁移:运行 `$MIGRATE_TO_CODEX --source ~/.claude/ --target ~/.codex/ --doctor`。
- 对 global 先 dry-run:运行 `$MIGRATE_TO_CODEX --source ~/.claude/ --target ~/.codex/ --dry-run`。
- 对 global 真实运行:运行 `$MIGRATE_TO_CODEX --source ~/.claude/ --target ~/.codex/`。
- 对 project 先 dry-run:运行 `$MIGRATE_TO_CODEX --source ./.claude/ --target ./.codex/ --dry-run`。
- 对 project 真实运行:运行 `$MIGRATE_TO_CODEX --source ./.claude/ --target ./.codex/`。
- 编辑后对 global target 运行 post-migration validator:`$MIGRATE_TO_CODEX --validate-target ~/.codex/`。
- 编辑后对 project target 运行 post-migration validator:`$MIGRATE_TO_CODEX --validate-target ./.codex/`。
- 运行 `$MIGRATE_TO_CODEX --help` 查看 flags(`--scan-only`、`--plan`、`--doctor`、`--validate-target`、defaults 等)。
- 深度表和更多链接在 `references/differences.md`。
适用边界 · 注意事项
- 需要修改源 Claude Code 文件、`.mcp.json`、`.claude.json`、无关项目代码、secrets 或另一个 repository 时不要用此流程;这些只能保留 manual guidance。
- Codex 没有等价能力或需要人工设置/产品判断的项(如不支持的 hooks、plugins、plugin marketplaces)不要强行迁移;应标为 `Not Added` 或 `Check before using`/manual migration。
- 没有选定 global/project target,或没有可用的 Codex 环境与 migrator 脚本时,不要自动创建、编辑、替换或删除 Codex artifacts。