From merge-gateway
Convert between Claude SKILL.md files and OpenAI Codex AGENTS.md files (and vice versa). Use this skill whenever the user wants to translate, convert, port, or adapt an AI skill or agent instruction file from one format to the other — e.g. "convert this skill to Codex", "turn this AGENTS.md into a Claude skill", "port my skill file", "make this work with Codex", "translate this for Claude Code". Also triggers when the user asks to make a skill "cross-compatible" or wants to run the same instructions in both systems.
How this skill is triggered — by the user, by Claude, or both
Slash command
/merge-gateway:claude-codex-translatorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Converts AI instruction files between two formats:
Converts AI instruction files between two formats:
SKILL.md files that brief Claude with expert knowledge and workflowsAGENTS.md files that configure autonomous Codex agents with rules, commands, and policiesBefore converting, read references/format-guide.md for a deep reference on both formats and their idioms. The conversion mappings in this file are the core logic; the reference explains the why.
First, determine what you've been given:
It's a Claude SKILL.md if:
description: (and often allowed-tools:) fieldsIt's a Codex AGENTS.md if:
npm test", "Never commit to main")If the format is ambiguous, ask the user which direction they want to convert.
Claude skills are knowledge briefings. Codex agent files are behavioral policies. The translation is a shift from "what Claude should know" to "what the agent should do."
| SKILL.md element | AGENTS.md equivalent |
|---|---|
YAML description | Opening paragraph: when/why this agent config applies |
YAML allowed-tools | No equivalent (drop silently) |
| Instructional prose sections | Imperative rule blocks ("Always...", "Never...", "When X, do Y") |
| Step-by-step workflows | Numbered command sequences with actual shell invocations |
| "Claude should consider..." | "Before making changes, check..." |
| Conditional logic in prose | Explicit if/then blocks in plain English |
| Bundled scripts references | Inline command examples or references to repo paths |
| Edge case callouts | Explicit prohibitions or guardrails section |
Strip the frontmatter — pull description out; derive the H1 header from the skill's directory name or first heading, and use description as an opening orientation paragraph.
Rewrite prose as directives — scan every instructional paragraph and convert it into imperative sentences. "Claude should verify the file exists before proceeding" → "Always verify the file exists before running commands."
Make commands concrete — anywhere the skill references a tool, script, or workflow step, surface the actual shell command. If the skill says "run the linter," write npm run lint or ruff check . depending on context.
Add an Environment section (if the skill implies dependencies) — list setup steps, required tools, or env vars the agent needs available.
Add a Testing section (if applicable) — specify what command(s) to run to verify work is correct.
Add a Prohibitions/Guardrails section — surface any "don't do X" guidance from the skill as an explicit list.
Drop pure-knowledge content — background explanations, conceptual context, and "why" prose that exists to educate Claude don't translate to agent policy. Summarize briefly or omit.
# [Skill Name]
[1–2 sentence orientation: when this config applies and what the agent's job is]
## Environment Setup
[Commands to set up the environment, install deps, configure tools]
## Core Workflow
[Numbered steps with real shell commands]
## Rules
- Always [X]
- Never [Y]
- When [condition], [action]
## Testing
[How to verify the work — what to run and what passing looks like]
## Prohibited Actions
- [Guardrails from the original skill]
Codex agent files are policies for autonomous agents. Claude skill files are briefings for an intelligent assistant. The translation is a shift from "rules to follow" to "knowledge to apply."
| AGENTS.md element | SKILL.md equivalent |
|---|---|
| H1 heading | Skill directory name (kebab-case) |
| Opening orientation paragraph | YAML description (with trigger language added) |
| Imperative rules ("Always X") | Contextual guidance ("When doing X, make sure to...") |
| Shell command sequences | Workflow steps with explanation of why each step |
| Environment setup section | Dependencies/prerequisites callout |
| Testing commands | Verification section — what to check and why |
| Prohibited actions | "Avoid..." or "Watch out for..." guidance |
| Directory-scoped overrides | Noted as context-specific variants in the skill body |
Create frontmatter — write description as a trigger-optimized summary: what Claude should do and the specific phrases/contexts that should load this skill. Add allowed-tools listing the tools the skill needs. Derive the skill name from the H1 or file context and use it as the directory name (kebab-case). Make the description "pushy" — lean toward over-triggering rather than under.
Rewrite directives as guidance — convert imperative rules into contextual wisdom. "Never commit to main" → "Always work on a feature branch; committing directly to main bypasses review gates and should be avoided." Add the why where you can infer it.
Wrap commands in context — don't just list shell commands; explain when to run them, what they verify, and how to interpret results. Commands become examples inside explanatory prose.
Expand terse rules into principles — agent files are often very terse. Claude skills benefit from richer explanation. A one-line rule may become a short paragraph.
Add a "When to use this skill" orientation — Claude benefits from knowing the shape of problems this skill addresses. Add a short section orienting Claude to the kinds of tasks it will encounter.
Preserve domain conventions — language-specific patterns, repo conventions, and tool names should be kept as concrete as possible.
---
description: [What this skill does + when to trigger it. Include specific phrases, contexts, file types, or task patterns. Be pushy about triggering.]
allowed-tools: Read, Grep, Glob, Edit, Write, Bash
---
# [Skill Name]
[Orientation: what kinds of tasks this skill addresses and what good outcomes look like]
## Context & Prerequisites
[What Claude should know about the environment, stack, or project before acting]
## Workflow
[Step-by-step guidance with commands as examples, not just directives]
## Key Principles
[The "always/never" rules, rewritten as reasoned guidance with explanations]
## Common Pitfalls
[Guardrails from the original agent file, explained with context]
## Verification
[How to check that work is correct — what to run and what to look for]
After generating the output, verify:
For SKILL.md outputs:
description and allowed-toolsFor AGENTS.md outputs:
Some content doesn't translate cleanly — flag these to the user rather than silently dropping them:
Always tell the user what was dropped or approximated, and offer to restore it in a different form.
references/format-guide.md — Deep reference on both formats: idioms, conventions, full examples, edge casesCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub merge-api/merge-gateway-skills --plugin merge-gateway