$npx -y skills add zuharz/ccode-to-codex --skill migrate-to-codexMigrate Claude-era skills into native Codex skill artifacts with a preservation-first workflow. Also migrate project-local Claude slash commands and command hooks in batch mode as review-required Codex artifacts. Classify migration risk, preserve control shape, validate runtime-c
| 1 | <!-- Generated by the ccode-to-codex mirror sync on 2026-04-14 from input revision 9a2403fb. --> |
| 2 | # Migrate to Codex |
| 3 | |
| 4 | Preserve the source workflow first. The goal is not to transliterate Claude |
| 5 | primitives. The goal is to produce the Codex skill artifact that best preserves |
| 6 | the source skill's behavior. |
| 7 | |
| 8 | ## Conversation-First Entry |
| 9 | |
| 10 | Bare or vague requests should not dump raw script flags immediately. Resolve the |
| 11 | request through the shared contract in |
| 12 | `references/conversational-migration-contract.md`. |
| 13 | |
| 14 | Default menu for underspecified requests: |
| 15 | |
| 16 | 1. Assess one skill |
| 17 | 2. Preview one skill |
| 18 | 3. Migrate one skill live |
| 19 | 4. Batch assess pending skills |
| 20 | 5. Review one migrated skill for nativeness |
| 21 | 6. Explain blockers and statuses |
| 22 | |
| 23 | Routing rules: |
| 24 | |
| 25 | - If the user already says `assess <skill>`, `preview <skill>`, or |
| 26 | `migrate <skill>`, or `review <skill>`, route directly. |
| 27 | - In Plan mode, use `request_user_input` for the action choice only. |
| 28 | - Outside Plan mode, render the same choices as a numbered text menu. |
| 29 | - If the action needs a skill name and the user did not provide one, ask for it |
| 30 | in plain text. |
| 31 | - Require explicit confirmation before any live write into `.codex/skills/`. |
| 32 | |
| 33 | ## Advanced CLI |
| 34 | |
| 35 | - Preferred wrappers: |
| 36 | - `python3 .codex/skills/migrate-to-codex/scripts/migration_doctor.py --skill example-skill --json` |
| 37 | - `python3 .codex/skills/migrate-to-codex/scripts/run_migration_workflow.py --preview --skill example-url-validator --json` |
| 38 | - `python3 .codex/skills/migrate-to-codex/scripts/run_migration_workflow.py --skill example-url-validator --json` |
| 39 | - Power-user engine: |
| 40 | - `python3 .codex/skills/migrate-to-codex/scripts/migrate_claude_workflows_to_codex.py --analysis-only --json --skill example-skill` |
| 41 | - `python3 .codex/skills/migrate-to-codex/scripts/migrate_claude_workflows_to_codex.py --skill example-url-validator` |
| 42 | - `python3 .codex/skills/migrate-to-codex/scripts/migrate_claude_workflows_to_codex.py --all` |
| 43 | - `python3 .codex/skills/migrate-to-codex/scripts/migrate_claude_workflows_to_codex.py --all --dry-run --json` |
| 44 | - `python3 .codex/skills/migrate-to-codex/scripts/migrate_claude_workflows_to_codex.py --analysis-only --json` |
| 45 | |
| 46 | ## Explicit Non-Goals |
| 47 | |
| 48 | - Do not attempt to preserve inline Claude `Agent()` / `Task()` semantics mechanically in this skill. |
| 49 | - Do not migrate agents here. Route agent dependencies to `migrate-agents-to-codex` at `.codex/skills/migrate-agents-to-codex/SKILL.md`. |
| 50 | - Do not treat legacy `.codex/agents/*.md` imports as resolved runtime dependencies. Only `.codex/agents/*.toml` counts. |
| 51 | - Do not treat command-derived skills or generated hook config as native/trusted |
| 52 | output. They are compatibility artifacts that require manual review. |
| 53 | |
| 54 | ## Sandbox Policy |
| 55 | |
| 56 | Recommended mode: `workspace-write` |
| 57 | |
| 58 | Rationale: this workflow creates skill files, updates repo-local documentation, |
| 59 | and runs validation scripts. Infrastructure or deployment access is not needed. |
| 60 | |
| 61 | ## Runtime Contract |
| 62 | |
| 63 | 1. Codex callable MCP namespaces use underscore-normalized server names. |
| 64 | 2. Hard MUST / NEVER / ONLY constraints survive verbatim. |
| 65 | 3. Preserve the source workflow's control shape unless Codex lacks a required primitive. |
| 66 | 4. Preserve direct execution when Codex supports it. Only redesign into manager-to-subagent when the source truly depends on task/team semantics. |
| 67 | 5. Do not invent `spawn_agent`, `wait_agent`, `update_plan`, or approval requirements unless the source workflow genuinely needs them. |
| 68 | 6. User interaction is mode-dependent: `request_user_input` exists only in Plan mode; outside Plan mode rely on normal user messages or approval workflow. |
| 69 | 7. File edits use `apply_patch` when the workflow actually edits files. |
| 70 | 8. Explicitly named Claude agents that exist under `.claude/agents/*.md` are hard runtime dependencies. Never substitute, downgrade, drop, or neutralize them during skill migration. If `.codex/agents/<name>.toml` is missing, stop and route to `migrate-agents-to-codex`. |
| 71 | 9. Claude skill references are context-sensitive. Only operational uses are hard migration dependencies. Related-skills tables, troubleshooting notes, provenance/history, and redirected-skill markers are not blockers by themselves. |
| 72 | 10. For ambiguous skill mentions, the Python migrator extracts structured candidates and returns `MANUAL_REVIEW_REQUIRED`. The interactive Codex skill then owns the read-only mini-auditor pass. If the auditor still cannot classify a mention confidently, keep the skill |