Every skill is a self-contained directory. The structure is deliberately minimal: one required file, one recommended file, and three optional subdirectories. This simplicity is intentional — a skill should contain only what an AI agent needs to do the job, nothing more. Understanding the layout helps you write skills that are lean, discoverable, and effective.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openai/skills/llms.txt
Use this file to discover all available pages before exploring further.
Canonical Directory Layout
SKILL.md (required)
The only file every skill must have. It consists of two parts:
- YAML frontmatter — Contains
nameanddescription. These are the fields Codex reads to determine when a skill should activate. The frontmatter is always present in context. - Markdown body — Instructions and guidance for using the skill. Only loaded after the skill triggers.
agents/openai.yaml (recommended)
UI-facing metadata for skill lists and chips inside Codex. This file is read by the Codex harness, not by the agent itself. It defines how the skill appears in the UI and can declare tool dependencies (e.g., MCP servers).
scripts/ (optional)
Executable code — Python scripts, Bash scripts, or any other executable — for operations that benefit from deterministic reliability. Scripts can be executed by Codex without being loaded into the context window, making them highly token-efficient for repetitive operations.
Include a scripts/ directory when the same code would otherwise be rewritten from scratch on every run.
references/ (optional)
Documentation and reference material intended to be loaded into context on demand. Reference files inform Codex’s process and thinking for a specific task — database schemas, API documentation, domain-specific policies, detailed workflow guides.
Reference files are not loaded automatically; Codex reads them when it determines they are needed. This keeps the default context window footprint small.
assets/ (optional)
Files used in the output Codex produces — not loaded into context. Assets include templates, boilerplate code directories, images, icons, font files, and sample documents that get copied or modified as part of the skill’s workflow.
Naming Rules
Skill names follow strict conventions to ensure consistent triggering and discoverability:- Characters: Lowercase letters (
a-z), digits (0-9), and hyphens (-) only. - Length: Maximum 64 characters.
- Format: No leading or trailing hyphens; no consecutive hyphens (
--). - Style: Prefer short, verb-led phrases:
rotate-pdf,address-comments,deploy-app. - Namespacing: Prefix with the tool name when it improves clarity:
gh-address-comments,linear-address-issue,vercel-deploy. - Folder name: The skill directory must be named exactly after the skill’s
namefield in SKILL.md.
gh-address-comments, vercel-deploy, pdf-editor, big-query-helper
Invalid names: GH_Address_Comments, vercel deploy, my--skill, -leading-hyphen
Real Example: gh-address-comments
The gh-address-comments curated skill demonstrates a complete, minimal structure:
SKILL.md file: