An agent skill is a folder with a SKILL.md file (instructions plus metadata) that a coding agent loads when a task matches. One folder that follows the open Agent Skills spec can serve Claude Code, Codex and Gemini CLI, with a symlink for Claude Code, as long as you stay inside the spec and don’t rely on tool-specific extras.
This guide is about portability: what the agent skills spec requires, which directory each tool scans, and how to make one folder visible to all three. For Claude Code’s own frontmatter options, see Claude Code Skills: a SKILL.md Tutorial.
A scope note on testing: I ran the example below for real with Claude Code 2.1.332 and Codex CLI 0.171.0 (Codex only to the point of showing the skill in its prompt input, with no model call). For Gemini CLI 0.72.0 I only tested discovery, meaning skills list. I did not run a model session in it, so I am not claiming invocation works there from my own testing. Everything else comes from the official docs linked in each section, checked December 2026.
What is an agent skill?
A skill packages a repeatable procedure: a name, a description of when to use it, instructions, and optionally scripts and reference files. The agent reads only the name and description up front. It loads the full SKILL.md when the task matches or when you call the skill directly.
That is the difference from a long system prompt or a giant AGENTS.md. The detail stays on disk until it is needed.
What the agent skills spec requires
The open format is defined at agentskills.io/specification. A skill is a directory containing at minimum a SKILL.md, with three optional subfolders:
skill-name/├── SKILL.md # required├── scripts/ # optional: executable code├── references/ # optional: extra docs└── assets/ # optional: templates, filesThe SKILL.md starts with YAML frontmatter, followed by Markdown instructions. The fields:
| Field | Required | Rules |
|---|---|---|
name | Yes | 1-64 chars; lowercase a-z, digits and hyphens; no leading, trailing or consecutive hyphens; must match the parent directory name |
description | Yes | 1-1024 chars; say what it does and when to use it |
license | No | License name or reference |
compatibility | No | Max 500 chars; environment requirements |
metadata | No | Extra key-value data |
allowed-tools | No | Experimental |
The spec also recommends keeping SKILL.md under 500 lines and moving detail into references/. It names the skills-ref library as the validator, so run your skill through it before you share it.
The name-must-match-directory rule matters for portability. If you symlink or copy a folder under a different name, the skill can break.
Where each tool looks for skills
Each tool scans its own paths, and they overlap on .agents/skills.
| Tool | Project directory | User directory | List | Invoke |
|---|---|---|---|---|
| Claude Code | .claude/skills/<name>/ | ~/.claude/skills/<name>/ | /skills menu | /skill-name or automatic match |
| Codex | .agents/skills/ | ~/.agents/skills | /skills | $skill-name mention, /skills, or automatic match |
| Gemini CLI | .gemini/skills or .agents/skills | ~/.gemini/skills or ~/.agents/skills | gemini skills list, /skills list | Model activates it, with a consent prompt |
Sources: Claude Code docs, Codex docs (now redirecting to learn.chatgpt.com/docs/build-skills), and the Gemini CLI pages on skills and using agent skills.
A few details from those docs:
- Codex scans
.agents/skillsin the current directory and in parent directories up to the repo root. It also reads~/.agents/skills, an admin location at/etc/codex/skills, and bundled system skills. It loads each skill’s name, description and path first, and the fullSKILL.mdonly when it selects the skill. - Gemini CLI treats
.agents/skillsas an alias for.gemini/skills. Within the same tier,.agents/skillswins. - Claude Code’s docs list
.claude/skillsand~/.claude/skills. They do not list.agents/skills, which is why the next section uses a symlink.
A note on Gemini CLI and Antigravity
The Gemini CLI docs state that for unpaid tier and Google One users, Gemini CLI was replaced by Antigravity CLI on June 18th, 2026. If you are on one of those plans, check what your account can run before following the Gemini steps. I make no claims here about how Antigravity handles skills.
Build one skill folder and share it
The shared location is .agents/skills, since Codex and Gemini CLI both read it. Claude Code gets a symlink. Start with a tiny project:
mkdir skills-demo && cd skills-demogit initmkdir -p .agents/skills/dir-report/scriptsCreate .agents/skills/dir-report/SKILL.md:
---name: dir-reportdescription: Counts the files in the current project by extension and prints a short report. Use when the user asks what file types a project contains or wants a quick directory summary.---
# dir-report
Run the bundled script from the project root and show its output to the user:
```bashpython3 .agents/skills/dir-report/scripts/report.py```
Then summarize which extensions dominate. Do not modify any files.Note that name is dir-report and the directory is dir-report, as the spec requires. Now the script, .agents/skills/dir-report/scripts/report.py, using only the standard library:
import osfrom collections import Counter
SKIP = {".git", "node_modules", ".venv"}
counts = Counter()for root, dirs, files in os.walk("."): dirs[:] = [d for d in dirs if d not in SKIP] for name in files: ext = os.path.splitext(name)[1].lower() or "(no extension)" counts[ext] += 1
for ext, n in counts.most_common(): print(f"{ext}: {n}")Check the layout and run the script directly, before any agent is involved:
python3 --versionfind .agents -type fcat .agents/skills/dir-report/SKILL.mdpython3 .agents/skills/dir-report/scripts/report.py
The folder holds two files, and the script counts exactly those two. It skips .git.
If the script works on its own, any failure later is a discovery problem, not a script problem.
Make it visible to Claude Code with a symlink
Claude Code scans .claude/skills, so point that location at the shared folder with a relative symlink:
mkdir -p .claude/skillsln -s ../../.agents/skills/dir-report .claude/skills/dir-reportls -l .claude/skillsThe link is relative, so it keeps working when the repo is cloned elsewhere. Git stores symlinks, so it can be committed. Windows checkouts need symlink support enabled, so verify that if your team uses it.
Check it in Codex
Codex reads .agents/skills directly, so no extra step is needed. To confirm discovery without spending a model call, print the prompt input Codex would build. It comes out as JSON with the whole skill list inside one string, so split the escaped newlines before filtering:
codex --versioncodex debug prompt-input | awk '{gsub(/\\n/,"\n")} 1' | grep -E 'r1|dir-report'
Codex writes paths in short form: r1 is the project’s .agents/skills directory, so r1/dir-report/SKILL.md is the shared file. I ran this with an empty temporary HOME and CODEX_HOME, so no personal skills were mixed in. debug commands can change between releases.
In a session, type /skills to browse, or mention the skill with $dir-report. Codex can also select it implicitly when your request matches the description.
Check it in Gemini CLI
Gemini CLI also reads .agents/skills. This command lists what it discovers, pinned here to a specific version so the result is reproducible:
npx -y @google/gemini-cli@0.72.0 --versionnpx -y @google/gemini-cli@0.72.0 skills listIn my run, with an empty temporary HOME, the first attempt printed No skills discovered. because the folder was not trusted. The trusted folders docs describe an environment variable that trusts the current workspace for one session. Use it only on a project whose contents you have read:
GEMINI_CLI_TRUST_WORKSPACE=true npx -y @google/gemini-cli@0.72.0 skills list
With the folder trusted, dir-report shows up as enabled, loaded from .agents/skills. If your list is empty, check folder trust before you debug the skill.
Inside a session, /skills list shows the same thing and /skills reload rescans after you edit a skill. According to the docs, activation asks for your consent before the skill’s content is loaded. As noted above, I only verified listing, not a full session.
Check it in Claude Code
Claude Code follows the symlink. Run the skill non-interactively from the project root:
claude --versionclaude -p "/dir-report" --setting-sources project \ --allowedTools "Bash(python3 .agents/skills/dir-report/scripts/report.py)"--setting-sources project leaves user-level settings out of the run, and --allowedTools lets this one script command execute without a permission prompt. Both flags are in the CLI reference.
Claude Code found the skill through the symlink, ran the script, and reported one .md and one .py file with neither dominating. The wording of the summary will vary from run to run.
Typing /dir-report calls it by name. Claude Code can also pick it up automatically when your request matches the description. Frontmatter options specific to Claude Code are covered in the SKILL.md tutorial.
What does not carry over
Sharing the folder shares the spec, not the whole feature set. Plan for these gaps:
- Tool-specific frontmatter. Don’t assume other tools understand anything beyond the spec fields.
allowed-toolsis marked experimental in the spec, so don’t rely on it behaving the same everywhere. - Invocation syntax.
/dir-reportin Claude Code,$dir-reportin Codex, and model-driven activation with a consent prompt in Gemini CLI. Write descriptions that work for automatic matching, because that is the one path all three share. - Directory precedence. Gemini CLI prefers
.agents/skillsover.gemini/skillswithin a tier. If you keep two copies, you may not get the one you expect, so keep one source of truth. - Environment assumptions. A script that needs
python3fails wherever it’s missing. Use thecompatibilityfield to say what the skill needs. - Permissions and sandboxing. Each tool has its own rules for running scripts and asking for approval. Check each tool’s docs rather than assuming they match.
Agent skills vs MCP
Skills and MCP solve different problems. A skill is instructions and files the agent reads, so it teaches a procedure. An MCP server exposes tools and data over a protocol, so it gives the agent something to call. A skill can tell the agent how to use an MCP tool, and the two are often used together.
For background, see What Is an MCP Server? and MCP vs API. If you want to distribute skills through a server instead of copying folders, see Skills over MCP.
FAQ
Do I need a separate skill folder for each tool?
No, not for a spec-compliant skill. Keep the real folder in .agents/skills/<name>, which Codex and Gemini CLI read, and symlink it into .claude/skills/<name> for Claude Code. Keep a single source of truth.
What is the minimum a SKILL.md needs?
Frontmatter with name and description, followed by instructions. The name must be 1-64 characters of lowercase letters, digits and hyphens, and must match the folder name. The description can be up to 1024 characters.
How do I validate a skill against the spec?
The spec names the skills-ref library as the validator. Run it on the folder before sharing, and fix naming or length problems it reports.
Is SKILL.md the same as AGENTS.md?
No. AGENTS.md-style files hold always-on project guidance. A SKILL.md is loaded on demand, when a task matches its description or you invoke it, which keeps your context small.