Workflow recipe
Port one Agent Skill across Claude Code, Codex and Cursor
Strip non-portable fields, make scripts path-safe and install one source folder for every agent.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
To use one Agent Skill in Claude Code, Codex and Cursor, cut the frontmatter to the fields in the open specification, replace agent-specific variables such as ${CLAUDE_SKILL_DIR} with relative paths and make the scripts safe anywhere. Keep one source folder, install it for each agent, test all three with one prompt and validate for the strictest surface.
The Agent Skills format is an open standard, but each agent adds its own extras and looks in its own folders. A skill written in Claude Code often uses fields such as disable-model-invocation or context: fork, refers to ${CLAUDE_SKILL_DIR}, and lives in .claude/skills/. Codex will not see it there, and claude.ai will refuse the extra fields on upload.
This recipe takes one such skill and makes it portable: spec-only frontmatter, relative paths, and one source folder installed for every agent.
EditorAbout 5 min
1. List what is not in the spec
The open spec defines six frontmatter fields: name, description, license, compatibility, metadata and allowed-tools (the last one is experimental and its support varies). Anything else is a client extension.
Open your SKILL.md and list every other key. Here is a typical Claude Code skill before porting:
---
name: release-check
description: Checks a release branch is ready to ship. Use before tagging a release.
disable-model-invocation: true
context: fork
allowed-tools: Bash(git:*) Bash(npm test:*)
argument-hint: "[version]"
---
Run ${CLAUDE_SKILL_DIR}/scripts/check.sh $ARGUMENTS and report the result.Non-portable here: disable-model-invocation, context, argument-hint, plus the ${CLAUDE_SKILL_DIR} and $ARGUMENTS substitutions in the body.
EditorAbout 8 min
2. Rewrite the frontmatter and body for the spec
Decide what each extension was for, then either drop it or say the same thing in plain instructions that every agent can follow.
---
name: release-check
description: Checks that a release branch is ready to ship, running the release script and summarising failures. Use only when the user explicitly asks to check a release or before tagging a version.
compatibility: Needs git, bash and Node.js with npm on the PATH.
metadata:
owner: platform-team
---
# Release check
1. Ask for the version number if the user did not give one.
2. From the repository root, run `bash scripts/check.sh <version>` using the script in this skill's folder (`scripts/check.sh`).
3. Report each failed check with the command that failed and the last 20 lines of its output. Do not try to fix failures unless asked.What changed and why:
disable-model-invocationstopped the model loading the skill on its own. Without it, the description now says “use only when the user explicitly asks”, which works as guidance in every agent.context: forkran the skill in a subagent, which only Claude Code supports. Dropping it means the skill runs in the main conversation elsewhere; keep the output short to compensate.$ARGUMENTSbecame “ask for the version number”.${CLAUDE_SKILL_DIR}became a path relative to the skill folder. The spec recommends relative paths with forward slashes.allowed-toolswas removed. It pre-approves tools in some agents, and support varies, so do not rely on it for behaviour.
EditorAbout 4 min
3. Make scripts safe to run anywhere
Agents cannot answer interactive prompts, and their shells differ. Check each bundled script:
#!/usr/bin/env bash
# scripts/check.sh: non-interactive, fails loudly, prints a summary
set -euo pipefail
version="${1:?usage: check.sh <version>}"
git diff --quiet || { echo "FAIL: working tree has uncommitted changes"; exit 1; }
git rev-parse "v${version}" >/dev/null 2>&1 && { echo "FAIL: tag v${version} already exists"; exit 1; }
npm test --silent || { echo "FAIL: tests"; exit 1; }
echo "OK: release ${version} is ready to tag"No read prompts, a usage message when arguments are missing, distinct failure lines and a non-zero exit code. Make it executable with chmod +x scripts/check.sh, but call it with bash in SKILL.md so it also works where the executable bit is lost (for example after a ZIP upload).
TerminalAbout 5 min
4. Keep one source folder and install it for each agent
Move the skill out of .claude/ into a neutral skills/ folder in your repository (or a separate skills repository). Then let the skills CLI place it where each agent looks:
npx skills add ./skills --skill release-check -a claude-code -a codex -a cursorBy default the CLI keeps one canonical copy under .agents/skills/release-check and creates symlinks for agents that use other folders, so Claude Code gets .claude/skills/release-check. Add --copy if your platform or tooling does not handle symlinks.
Where each agent looks in a project, for reference:
| Agent | Project folder | Also reads |
|---|---|---|
| Claude Code | .claude/skills/ |
(does not read .agents/skills/) |
| Codex | .agents/skills/ |
user folder ~/.agents/skills/ |
| Cursor | .agents/skills/, .cursor/skills/ |
.claude/skills/, .codex/skills/ |
Each agentAbout 6 min
5. Test in all three agents with the same prompt
Open a fresh session in each agent from the same repository and run:
You can also invoke the skill by name: /release-check in Claude Code and Cursor, $release-check in Codex. Note for each agent whether it loaded the skill, whether the script ran from the right directory, and whether the output was the short summary you asked for.
BrowserAbout 2 min
6. Validate for the strictest surface
The strictest consumers are claude.ai uploads and the Claude API: they refuse any frontmatter key outside the six spec fields, and names containing “claude” or “anthropic”. If your skill passes there, it will load anywhere.
Paste the new SKILL.md into the skill builder and fix any errors or portability warnings it reports.
Check it worked
Verification checklist
0 of 6 done
When it goes wrong
If Claude Code does not see the skill, check that .claude/skills/release-check exists (as a folder or symlink). Claude Code’s documentation lists only .claude/skills/ locations, so a skill installed only to .agents/skills/ is invisible to it.
If Codex does not list it, restart Codex. New skill folders are picked up at session start. Also check that Codex is running inside the repository, since it scans .agents/skills/ from the working directory up to the repository root.
If the script cannot be found, the agent probably ran it from the repository root with the wrong relative path. Spell out the path from the skill folder in SKILL.md, or have the instructions cd into the skill folder first.
If the skill now triggers too often in Claude Code, that is the cost of dropping disable-model-invocation. You can keep a Claude Code-only variant with that field in .claude/skills/ and the portable one in .agents/skills/, at the price of maintaining two copies.
Variations
To share the ported skill with other teams, push the skills/ folder to a repository and follow the build and share recipe from step 5.
GitHub Copilot also reads .agents/skills/ and .claude/skills/ in a project, so the same install usually covers it; add -a github-copilot to the npx skills add command if you want the CLI to set it up explicitly.
Before porting your own skill, check whether a portable one already exists: the find-skills skill searches with the npx skills CLI and checks quality before offering to install. To restructure a skill while you port it, the skill-creator skill helps with the description and folder layout.
Related Agent Skills guides
Each agent’s folders and extras are covered in Agent Skills in Claude Code, Agent Skills in Codex and Agent Skills in Cursor. The SKILL.md format reference lists the spec-only fields used in step 2, and migrating rules and commands to skills helps if the instructions started life elsewhere. More recipes are in the AI workflow examples hub.
Outcome and tools
- Outcome
- One skill folder that loads in all three agents, with non-portable fields removed.
- For
- Developers
- Variants for
- Claude Code, Codex, Cursor
- Agent Skills
Related
- Ship a team Agent Skill end to end: build, test, share
An Agent Skill example project from idea to install: write SKILL.md, validate it against the spec, test when it fires and share it with one install command.
- What are Agent Skills (Claude skills)?
Claude skills, or Agent Skills, are folders with a SKILL.md file that agents load on demand. What goes in one, how loading works and when a skill fits.
- Agent Skill
A folder with a SKILL.md file, plus optional scripts and references, that gives an agent instructions for a task and is loaded only when needed.