Harness Skill Porting
Overview
Use this skill to convert workflows from another AI coding harness into a Codex-native skill without losing behavior that came from harness-specific features. The goal is not a literal file translation; it is operational parity: Codex should know when to trigger the skill, what context to inspect, which tools to use, what outputs to produce, and how to compensate for features Codex does not share with the source harness.
Start by identifying the source harness and reading the source artifacts. If the user pasted a source skill or workflow in the conversation, treat that as the source of truth; otherwise search the provided path or repo for files like SKILL.md, CLAUDE.md, .claude/commands/*, .claude/agents/*, hooks, rules, MCP configs, and bundled scripts.
Porting Workflow
1. Inventory the source behavior
Create a concise source inventory before writing the Codex skill:
- Trigger surface: how the source workflow is invoked, including skill descriptions, slash commands, prompt phrases, file types, and repo contexts.
- Required inputs: files, URLs, user answers, environment variables, credentials, local services, or MCP servers.
- Behavioral steps: the actual workflow, decision points, validations, retries, review loops, and expected stopping conditions.
- Harness features: agents, hooks, slash commands, memories, plan modes, approval modes, MCP tools, browser tools, sandboxes, or background tasks.
- Bundled resources: scripts, templates, assets, examples, reference docs, tests, and generated artifacts.
- Output contract: final response shape, files to create, metadata to preserve, package format, and verification evidence.
If the source mixes reusable behavior with one project's local policy, separate them. Put general reusable behavior in the skill and keep project-specific rules in the target repository's AGENTS.md or existing docs.
When a source artifact references other commands, agents, skills, hooks, or rules, trace the dependency closure before deciding scope. Classify each reference as:
- Required runtime dependency: the source workflow cannot run without it. Convert or embed it.
- Follow-on workflow dependency: the source tells users to use it next. Convert it as a separate skill when the user asked for full workflow parity.
- Optional alternative: the source mentions it as a deeper or adjacent path. Convert only if full parity would otherwise leave a broken reference.
- Project-local policy: keep in
AGENTS.md or existing project docs rather than a reusable skill.
For a deeper dependency tracing checklist, read references/dependency-closure.md.
For ambient behavior from source harnesses, such as Cursor alwaysApply rules or Claude project guidance, note that a Codex skill is trigger-based. Preserve the behavior with strong trigger phrasing and, when true always-on behavior is required, recommend placing a compact version in the target repo's AGENTS.md.
When ambient behavior is required for parity, do one of these:
- Add or update a repo-level
AGENTS.md section when the user has asked you to install the behavior into a specific repository.
- Otherwise, include an exact
AGENTS.md snippet in the final response and mark the ledger row as Emulated with the note manual repo-level install required.
For examples of converting always-on source behavior, read references/ambient-behavior.md.
2. Build a parity ledger
Use a parity ledger to avoid silently dropping source-harness behavior:
| Source feature/dependency | Target surface/file | Status | Risk | Note |
| --- | --- | --- | --- | --- |
| Claude slash command `/foo` | `SKILL.md` description and input contract | Direct | Low | Slash invocation becomes trigger wording plus normal user prompt handling. |
| Claude hook before commit | `SKILL.md` verification checklist or bundled script | Emulated | Medium | Codex cannot enforce the hook automatically; run the check before commit. |
For common feature mappings, read references/parity-matrix.md. Load only the relevant sections for the source harness and features you found.
Classify each row:
- Direct: Codex has an equivalent surface, such as a skill body,
agents/openai.yaml, bundled resources, project AGENTS.md, or MCP tool.
- Emulated: Codex lacks the exact feature, but the behavior can be reproduced through explicit instructions, scripts, evals, or a review checklist.
- Out of scope: the behavior depends on unavailable runtime capabilities, credentials, private services, or host-specific automation. Preserve the requirement in a limitation note and ask before omitting it.
3. Design the Codex-native shape
Choose the smallest set of Codex surfaces that preserves behavior:
SKILL.md: trigger description, workflow, decision rules, verification, and output contract.
agents/openai.yaml: display metadata only; do not put trigger logic here.
references/: longer conversion notes, source-specific mappings, examples, schemas, or policies loaded on demand.
scripts/: deterministic checks, converters, package builders, or repeated mechanical steps that should not be reimplemented by the model every run.
assets/: templates, images, boilerplate, fixtures, or other files to copy into outputs.
evals/: realistic prompts that prove the converted skill triggers and preserves source behavior.
Do not create commands/ shims unless the target project explicitly needs compatibility with a command surface. Codex skills should be the canonical workflow surface.
When a source command delegates to an agent, prefer embedding the agent's reusable behavior into the target skill unless the agent has enough standalone value to become its own skill. Do not leave a Codex skill depending on a source-harness agent file that will not exist for the user.
4. Rewrite for Codex behavior
When drafting the target SKILL.md:
- Put all trigger guidance in the frontmatter
description; Codex decides whether to load a skill from name plus description.
- Write instructions for a Codex coding agent that shares a filesystem with the user. Avoid source-harness terms unless they are part of the input being converted.
- Replace source-only control flow with Codex-operable steps. For example, turn a hook into a verification step, a slash command into trigger phrasing and an input contract, and a source subagent into either inline review guidance or a Codex multi-agent note only when the runtime permits delegation.
- Preserve why each step exists. Parity is more reliable when the model understands the failure mode a step prevents.
- Keep the body under about 500 lines. Move large compatibility tables, examples, schemas, and source-specific details into references.
- Include explicit fallback behavior for headless environments, missing tools, unavailable MCP servers, and absent source files.
Avoid promising automatic enforcement for capabilities Codex cannot enforce. Say "run this check before committing" or "verify this condition" rather than implying an unavailable hook will block the action.
5. Preserve resources and tests
Port bundled resources deliberately:
- Copy deterministic scripts when they still apply; patch paths and assumptions for the Codex skill directory.
- Convert source-specific config examples into references unless Codex will execute them directly.
- Keep templates and assets intact when licensing allows it.
- Add or adapt eval prompts that represent the source workflow's core promises. Include at least one eval for a harness-specific feature that required emulation.
For each converted skill, create evals/evals.json with realistic prompts and expected outputs. If the source had tests, map them to Codex-friendly checks rather than dropping them.
6. Validate and report parity
Before handing off a converted skill:
- Run the skill validator if available, usually:
python3 <skill-creator>/scripts/quick_validate.py <converted-skill-path>
- Inspect the final diff and confirm no source secrets or private credentials were copied.
- Check that every parity-ledger row is direct, emulated, or explicitly documented as a limitation.
- Report the created or changed files, verification commands, and any remaining parity gaps.
Output Format
When the user asks you to port a skill, finish with:
Converted `<source-name>` to `<target-skill-name>`.
Changed files:
- <path>
Parity ledger:
| Source feature/dependency | Target surface/file | Status | Risk | Note |
| --- | --- | --- | --- | --- |
| <source behavior> | <target path or Codex surface> | Direct/Emulated/Out of scope | Low/Medium/High | <note> |
Verification:
- <command>: <result>
If you cannot verify full parity, say exactly which source feature is not covered and what would be needed to cover it.
Review Checklist
Use this checklist before finalizing:
- The target skill's
description names the source contexts and real user phrases that should trigger it.
- The skill body explains the workflow and fallback behavior without relying on unsupported source harness mechanics.
- Every source command, agent, hook, memory, tool, resource, and output expectation has a parity-ledger decision.
- Ambient or always-on source behavior has either a repo-level
AGENTS.md update or an exact snippet marked as requiring manual repo-level install.
- Scripts and assets are copied only when needed and safe to redistribute.
- Tests or eval prompts cover the core workflow and at least one emulated feature.
- Validation passes, or failures are explained with next steps.
1---2name: harness-skill-porting3description: Use this skill only when the user wants to convert, migrate, port, translate, adapt, or get parity for a skill, prompt, command, agent, hook, rule, MCP config, or workflow from another agent harness into a Codex skill. This applies to Claude Code skills and slash commands, Cursor/Cline/Roo/Aider rules, prompt packs, and AGENTS/CLAUDE instructions. Trigger for phrases like "make this work in Codex", "full parity", "convert this skill", or "bring over this Claude workflow". Do not use for native Codex planning, PRP, TDD, build-fix, code review, PR, commit, E2E, packaging, or docs tasks unless the user is porting them from another harness.4---56# Harness Skill Porting78## Overview910Use this skill to convert workflows from another AI coding harness into a Codex-native skill without losing behavior that came from harness-specific features. The goal is not a literal file translation; it is operational parity: Codex should know when to trigger the skill, what context to inspect, which tools to use, what outputs to produce, and how to compensate for features Codex does not share with the source harness.1112Start by identifying the source harness and reading the source artifacts. If the user pasted a source skill or workflow in the conversation, treat that as the source of truth; otherwise search the provided path or repo for files like `SKILL.md`, `CLAUDE.md`, `.claude/commands/*`, `.claude/agents/*`, hooks, rules, MCP configs, and bundled scripts.1314## Porting Workflow1516### 1. Inventory the source behavior1718Create a concise source inventory before writing the Codex skill:1920- **Trigger surface:** how the source workflow is invoked, including skill descriptions, slash commands, prompt phrases, file types, and repo contexts.21- **Required inputs:** files, URLs, user answers, environment variables, credentials, local services, or MCP servers.22- **Behavioral steps:** the actual workflow, decision points, validations, retries, review loops, and expected stopping conditions.23- **Harness features:** agents, hooks, slash commands, memories, plan modes, approval modes, MCP tools, browser tools, sandboxes, or background tasks.24- **Bundled resources:** scripts, templates, assets, examples, reference docs, tests, and generated artifacts.25- **Output contract:** final response shape, files to create, metadata to preserve, package format, and verification evidence.2627If the source mixes reusable behavior with one project's local policy, separate them. Put general reusable behavior in the skill and keep project-specific rules in the target repository's `AGENTS.md` or existing docs.2829When a source artifact references other commands, agents, skills, hooks, or rules, trace the dependency closure before deciding scope. Classify each reference as:3031- **Required runtime dependency:** the source workflow cannot run without it. Convert or embed it.32- **Follow-on workflow dependency:** the source tells users to use it next. Convert it as a separate skill when the user asked for full workflow parity.33- **Optional alternative:** the source mentions it as a deeper or adjacent path. Convert only if full parity would otherwise leave a broken reference.34- **Project-local policy:** keep in `AGENTS.md` or existing project docs rather than a reusable skill.3536For a deeper dependency tracing checklist, read `references/dependency-closure.md`.3738For ambient behavior from source harnesses, such as Cursor `alwaysApply` rules or Claude project guidance, note that a Codex skill is trigger-based. Preserve the behavior with strong trigger phrasing and, when true always-on behavior is required, recommend placing a compact version in the target repo's `AGENTS.md`.3940When ambient behavior is required for parity, do one of these:4142- Add or update a repo-level `AGENTS.md` section when the user has asked you to install the behavior into a specific repository.43- Otherwise, include an exact `AGENTS.md` snippet in the final response and mark the ledger row as `Emulated` with the note `manual repo-level install required`.4445For examples of converting always-on source behavior, read `references/ambient-behavior.md`.4647### 2. Build a parity ledger4849Use a parity ledger to avoid silently dropping source-harness behavior:5051```markdown52| Source feature/dependency | Target surface/file | Status | Risk | Note |53| --- | --- | --- | --- | --- |54| Claude slash command `/foo` | `SKILL.md` description and input contract | Direct | Low | Slash invocation becomes trigger wording plus normal user prompt handling. |55| Claude hook before commit | `SKILL.md` verification checklist or bundled script | Emulated | Medium | Codex cannot enforce the hook automatically; run the check before commit. |56```5758For common feature mappings, read `references/parity-matrix.md`. Load only the relevant sections for the source harness and features you found.5960Classify each row:6162- **Direct:** Codex has an equivalent surface, such as a skill body, `agents/openai.yaml`, bundled resources, project `AGENTS.md`, or MCP tool.63- **Emulated:** Codex lacks the exact feature, but the behavior can be reproduced through explicit instructions, scripts, evals, or a review checklist.64- **Out of scope:** the behavior depends on unavailable runtime capabilities, credentials, private services, or host-specific automation. Preserve the requirement in a limitation note and ask before omitting it.6566### 3. Design the Codex-native shape6768Choose the smallest set of Codex surfaces that preserves behavior:6970- `SKILL.md`: trigger description, workflow, decision rules, verification, and output contract.71- `agents/openai.yaml`: display metadata only; do not put trigger logic here.72- `references/`: longer conversion notes, source-specific mappings, examples, schemas, or policies loaded on demand.73- `scripts/`: deterministic checks, converters, package builders, or repeated mechanical steps that should not be reimplemented by the model every run.74- `assets/`: templates, images, boilerplate, fixtures, or other files to copy into outputs.75- `evals/`: realistic prompts that prove the converted skill triggers and preserves source behavior.7677Do not create `commands/` shims unless the target project explicitly needs compatibility with a command surface. Codex skills should be the canonical workflow surface.7879When a source command delegates to an agent, prefer embedding the agent's reusable behavior into the target skill unless the agent has enough standalone value to become its own skill. Do not leave a Codex skill depending on a source-harness agent file that will not exist for the user.8081### 4. Rewrite for Codex behavior8283When drafting the target `SKILL.md`:8485- Put all trigger guidance in the frontmatter `description`; Codex decides whether to load a skill from name plus description.86- Write instructions for a Codex coding agent that shares a filesystem with the user. Avoid source-harness terms unless they are part of the input being converted.87- Replace source-only control flow with Codex-operable steps. For example, turn a hook into a verification step, a slash command into trigger phrasing and an input contract, and a source subagent into either inline review guidance or a Codex multi-agent note only when the runtime permits delegation.88- Preserve why each step exists. Parity is more reliable when the model understands the failure mode a step prevents.89- Keep the body under about 500 lines. Move large compatibility tables, examples, schemas, and source-specific details into references.90- Include explicit fallback behavior for headless environments, missing tools, unavailable MCP servers, and absent source files.9192Avoid promising automatic enforcement for capabilities Codex cannot enforce. Say "run this check before committing" or "verify this condition" rather than implying an unavailable hook will block the action.9394### 5. Preserve resources and tests9596Port bundled resources deliberately:9798- Copy deterministic scripts when they still apply; patch paths and assumptions for the Codex skill directory.99- Convert source-specific config examples into references unless Codex will execute them directly.100- Keep templates and assets intact when licensing allows it.101- Add or adapt eval prompts that represent the source workflow's core promises. Include at least one eval for a harness-specific feature that required emulation.102103For each converted skill, create `evals/evals.json` with realistic prompts and expected outputs. If the source had tests, map them to Codex-friendly checks rather than dropping them.104105### 6. Validate and report parity106107Before handing off a converted skill:1081091. Run the skill validator if available, usually:110 ```bash111 python3 <skill-creator>/scripts/quick_validate.py <converted-skill-path>112 ```1132. Inspect the final diff and confirm no source secrets or private credentials were copied.1143. Check that every parity-ledger row is direct, emulated, or explicitly documented as a limitation.1154. Report the created or changed files, verification commands, and any remaining parity gaps.116117## Output Format118119When the user asks you to port a skill, finish with:120121```markdown122Converted `<source-name>` to `<target-skill-name>`.123124Changed files:125- <path>126127Parity ledger:128| Source feature/dependency | Target surface/file | Status | Risk | Note |129| --- | --- | --- | --- | --- |130| <source behavior> | <target path or Codex surface> | Direct/Emulated/Out of scope | Low/Medium/High | <note> |131132Verification:133- <command>: <result>134```135136If you cannot verify full parity, say exactly which source feature is not covered and what would be needed to cover it.137138## Review Checklist139140Use this checklist before finalizing:141142- The target skill's `description` names the source contexts and real user phrases that should trigger it.143- The skill body explains the workflow and fallback behavior without relying on unsupported source harness mechanics.144- Every source command, agent, hook, memory, tool, resource, and output expectation has a parity-ledger decision.145- Ambient or always-on source behavior has either a repo-level `AGENTS.md` update or an exact snippet marked as requiring manual repo-level install.146- Scripts and assets are copied only when needed and safe to redistribute.147- Tests or eval prompts cover the core workflow and at least one emulated feature.148- Validation passes, or failures are explained with next steps.