Codex Skills: How to Create an OpenAI Codex SKILL.md
OpenAI Codex skills are folders with one SKILL.md file that teach Codex a repeatable workflow, so it runs the same way every time. This guide covers the format, where Codex looks for skills, four ways to create one, and what to do when one doesn't trigger.
What are OpenAI Codex skills?
Every team has workflows that live in someone's head: how release notes get written, which checks run before a migration, what a good PR review covers. A Codex skill writes that knowledge down once, as a runbook Codex picks up whenever the task comes around.
Concretely, a skill is a folder with a SKILL.md file: a short frontmatter saying what the skill does and when to use it, followed by the instructions. It can also carry resources and optional scripts, so Codex follows the workflow reliably instead of improvising it.
SKILL.md → Codex → new capability.Codex skills use the same open Agent Skills SKILL.md format as Claude, so a well-written skill is largely portable between agents. New to the idea? Read what agent skills are first.
Where do Codex skills work?
Standalone skills work in Codex CLI, the IDE extension, and Codex in the ChatGPT desktop app. Skills bundled in a plugin also reach ChatGPT on the web, desktop, and mobile.
How Codex decides to use a skill
Codex doesn't read every skill on every task. Up front it loads only each skill's name, description, and file path; the full SKILL.md is read only once Codex selects that skill. That's progressive disclosure, and it's why you can install many skills without slowing Codex down.
Level 1 · Always loaded
name + description — the “book spine”
Level 2 · Loaded when relevant
the full SKILL.md body — your instructions
Level 3 · Opened only if needed
extra files: reference.md, templates, scripts…
A skill gets selected in one of two ways:
| How it happens | What controls it | |
|---|---|---|
| Implicit | Codex matches your request against each skill's description | The wording of the description |
| Explicit | You type $ and the skill's name, or pick it from /skills | Nothing to configure — an explicit call always works |
So the description decides whether Codex ever finds your skill on its own. Keep it concise and clearly scoped: say when the skill should trigger, and when it shouldn't.
Codex Skills vs AGENTS.md, plugins, and Claude Skills
These overlap just enough to be confusing, so here is what each one is for:
| What it is | When Codex uses it | Best for | |
|---|---|---|---|
Skill (SKILL.md) | Task-specific instructions, plus optional resources and scripts | When the task matches, or when you call it with $ | Repeatable workflows |
| AGENTS.md | A guidance file checked into the repo | Always, for work in that project | Project conventions: build commands, code style, review rules |
| Plugin | A package of skills, MCP servers, hooks, and more | After you install it and start a new session | Distributing skills beyond one repo |
| Claude skill | The same open SKILL.md standard | In Claude Code | Sharing one skill across agents |
Rule of thumb: AGENTS.md says how this repo works; a skill says how a job gets done.
Where Codex skills live: ~/.agents/skills vs .agents/skills
Codex looks for skills in two main places — and the folder is .agents, not .codex:
- Personal skills live in
~/.agents/skills/, in your home directory. They follow you into every repo on this machine. - Repository skills live in
.agents/skills/inside a repo. Codex checks every folder from where you started it up to the repo root, so a package in a monorepo can carry its own skills. Commit them and your team gets them too.
Two more locations exist that you'll rarely touch: admin skills in /etc/codex/skills, and system skills that ship bundled with Codex.
Personal — follows you
✓ works in all your repos
✗ only on your machine
Repository — follows the repo
✓ shared with the team via git
✗ only inside this repo
AGENTS.md and skills side by side — they do different jobs. New to ~ and dot-folders?
~is your home directory:/Users/youon macOS,/home/youon Linux,C:\Users\youon Windows.- A leading dot hides the folder. Use
ls -ain a terminal,Cmd+Shift+.in Finder, or turn on hidden items in the View menu of Windows File Explorer. .agents/skills/probably doesn't exist yet. You'll create it in the hands-on section below.
Following an older tutorial?
Older guides use ~/.codex/skills. Codex still reads that folder for backward compatibility, but ~/.agents/skills is the documented location — and the one other agents following the open standard read too.
Personal or repository?
Personal · ~/.agents/skills/ | Repository · .agents/skills/ | |
|---|---|---|
| Who benefits? | Just you | Everyone who clones the repo |
| Scope | Every repo on your machine | This repo, or one package of it |
| In version control? | No | Yes — review skill changes like code |
| Good for | Your own habits: release notes, review checklists | Team procedures: migrations, deploy runbooks, API conventions |
The Codex SKILL.md format: anatomy of a skill
Codex requires two frontmatter fields, name and description; everything below the closing --- is the instructions. Here's a complete skill you can copy:
---
name: release-notes
description: Drafts release notes from pull requests merged since the last git tag. Use when the user asks for release notes, a changelog, or a summary of what shipped. Do not use for commit messages.
---
# Release notes
1. Find the latest tag with `git describe --tags --abbrev=0`.
2. List the pull requests merged since that tag.
3. Group them under Features, Fixes, and Chores.
4. Write one user-facing bullet per change and link its PR.
5. Output Markdown ready to paste into a GitHub release.What each field does
name— the skill's ID, and what you type after$. Use lowercase letters, numbers, and hyphens (the open standard caps it at 64 characters) and match the folder name:release-notes/↔name: release-notes.description— how Codex decides to use the skill. Say what it does, when to use it, and when not to. The example rules out commit messages, so it never competes with a commit skill.
Optional: agents/openai.yaml
Put an agents/openai.yaml file inside the skill folder to give it a display name, icon, and default prompt in the app — or to make it explicit-only:
interface:
display_name: "Release notes"
short_description: "Draft notes from merged PRs"
policy:
allow_implicit_invocation: falseWith allow_implicit_invocation: false, Codex never picks the skill on its own, but $release-notes still works.
Common mistakes
- The path is
.agents/skills/<name>/SKILL.md—.agentswith an s, and every skill in its own folder. - Name the file exactly
SKILL.md. - Don't skip either field: Codex requires both
nameanddescription. - One skill, one job. A skill that "handles releases, migrations, and reviews" has a description too vague to trigger reliably.
Four ways to create a Codex skill
| Way | Best when | How it works |
|---|---|---|
$skill-creator | You can describe the workflow | Built into Codex: it asks what the skill does, when it should trigger, and whether it needs scripts — instructions only by default |
| Record & Replay | It's easier to show than to describe | Demonstrate the workflow once; the recorder drafts a reusable skill from the steps |
| Manual | You want full control | Create the folder and write SKILL.md yourself — the next section walks through it |
| Skill Builder | You'd rather not write YAML at all | ProfessorGPT's free wizard generates a standard SKILL.md that works in Codex, Claude, and Gemini CLI |
Step by step: writing your first Codex SKILL.md
We'll build the release-notes skill as a personal skill, so it's available in every repo you open with Codex.
1. Create the folder
mkdir -p ~/.agents/skills/release-notesmkdir -Force ~\.agents\skills\release-notesBoth commands create any missing parent folders and are safe to run twice.
2. Write SKILL.md
Save the example from the anatomy section as ~/.agents/skills/release-notes/SKILL.md. Rather talk it through? Type $skill-creator in Codex and answer its questions instead.
3. Let Codex pick it up
Codex detects new and changed skills automatically, so there's usually nothing to do. If the skill doesn't show up, restart Codex.
4. Use it
Ask naturally — "draft the release notes for v2.4.0" — and Codex can select the skill from its description. To run it by name, mention it with $:
› $release-notes draft the notes for v2.4.0
## v2.4.0
### Features
- Bulk CSV export for reports (#412)
### Fixes
- Sessions no longer loop on expired tokens (#409)
›
$ mention runs the skill by name. Simplified — the exact output varies by Codex version.5. Check the list
Run /skills in Codex CLI or the IDE extension to see the skills Codex loaded and pick one. If release-notes is there, you've shipped your first Codex skill. 🎓
Codex skill not triggering? Troubleshooting
| Symptom | Likely cause and fix |
|---|---|
Missing from /skills | Wrong path. It must be ~/.agents/skills/<name>/SKILL.md, or .agents/skills/<name>/SKILL.md in the repo. .agent/ (no s) won't match, and a SKILL.md dropped straight into skills/ without its own folder isn't found. |
| Still missing after you fix the path | Not picked up yet. Codex usually notices new skills on its own; if it doesn't, restart Codex. Skills from a newly installed plugin need a new session. |
$release-notes works, but Codex never picks it on its own | Implicit use is off, or never matches. Check allow_implicit_invocation in agents/openai.yaml, then rewrite the description with the words people actually type. |
| Fires on the wrong tasks | Description too broad. Add when not to use it, or make the skill explicit-only. |
| Two entries with the same name | Duplicate names. Codex shows both instead of merging them — rename one. |
| You want it off for a while | Disable it in config. Add a [[skills.config]] entry with the skill's path and enabled = false to ~/.codex/config.toml, then restart Codex. |
Debug like a pro
Test the trigger the way the Codex docs suggest: write a few prompts that should use the skill and a few that shouldn't, and check which ones it fires on. If the results surprise you, the description is the thing to fix.
How to install a ready-made Codex skill
You don't have to write every skill yourself. Four ways to add an existing one:
1. Plugins (the official route). In Codex CLI, open the plugin browser, install a plugin from a marketplace, then start a new session to use its skills:
/pluginsChatGPT and Codex share one plugin directory, so a plugin's skills can reach both.
2. $skill-installer. Built into Codex: it installs curated skills, and it can fetch one from another GitHub repo too:
$skill-installer install https://github.com/owner/repo/tree/main/skills/<skill-name>3. The skills CLI (community tool). Installs into .agents/skills/; add -g to install into ~/.agents/skills/ instead:
npx skills add owner/repo --skill <skill-name> -a codexThis is the third-party skills.sh CLI, not an OpenAI command.
4. Manual. Copy any skill folder — the one containing SKILL.md — into ~/.agents/skills/ or your repo's .agents/skills/.
Or find one in the ProfessorGPT catalog and install it in one command.
Build a Codex skill without the setup
Skip the boilerplate: the Skill Builder turns a few answers into a standard SKILL.md that works in Codex, Claude, and Gemini CLI — download it or install it straight away. You can also browse ready-made skills and adapt one.
Level up your Codex skills
You have the loop now: folder → SKILL.md → trigger → refine. From here, skills grow in a few directions:
- Bundle resources. Put reference docs in
references/and templates inassets/, and point to them fromSKILL.md— Codex opens them only when needed (Level 3 in Fig. 2). - Add scripts sparingly. A
scripts/helper earns its place for deterministic steps or external tools; everything else reads better as instructions. - Declare what it needs.
dependencies.toolsinagents/openai.yamlcan list the tools a skill relies on, such as an MCP server. - Share it wider. A repo's
.agents/skills/covers one team; a plugin — even a skills-only one — is how you distribute beyond a single repo. Or publish it to the ProfessorGPT catalog.
The SKILL.md template adds the optional frontmatter fields, and the SKILL.md examples show finished skills to adapt.
Before you ship a Codex skill
- Path is
…/.agents/skills/<skill-name>/SKILL.md—.agents, its own folder, exact filename nameis lowercase-with-hyphens and matches the folderdescriptionsays what, when, and when not — in words people actually type- The skill does one job
- Tested twice: once with a natural request, once with a
$skill-namemention