GeekCoding101 make your way to geek

Agent Skills: One SKILL.md Folder for Claude Code, Codex, Gemini CLI

Agent skills are folders with a SKILL.md file that teach a coding agent a task. See the spec, each tool's directory, and how to share one folder.

9 min read
Terminal screenshot showing the dir-report skill folder layout under .agents/skills, the SKILL.md contents, and the output of report.py counting files by extension
On this pageWhat is an agent skill?

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, files

The SKILL.md starts with YAML frontmatter, followed by Markdown instructions. The fields:

FieldRequiredRules
nameYes1-64 chars; lowercase a-z, digits and hyphens; no leading, trailing or consecutive hyphens; must match the parent directory name
descriptionYes1-1024 chars; say what it does and when to use it
licenseNoLicense name or reference
compatibilityNoMax 500 chars; environment requirements
metadataNoExtra key-value data
allowed-toolsNoExperimental

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.

ToolProject directoryUser directoryListInvoke
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/skillsgemini skills list, /skills listModel 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/skills in 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 full SKILL.md only when it selects the skill.
  • Gemini CLI treats .agents/skills as an alias for .gemini/skills. Within the same tier, .agents/skills wins.
  • Claude Code’s docs list .claude/skills and ~/.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:

Terminal window
mkdir skills-demo && cd skills-demo
git init
mkdir -p .agents/skills/dir-report/scripts

Create .agents/skills/dir-report/SKILL.md:

---
name: dir-report
description: 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:
```bash
python3 .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:

report.py
import os
from 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:

Terminal window
python3 --version
find .agents -type f
cat .agents/skills/dir-report/SKILL.md
python3 .agents/skills/dir-report/scripts/report.py
Terminal output listing the two files in the dir-report skill, the SKILL.md contents, and report.py counting one .md and one .py file

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.

Claude Code scans .claude/skills, so point that location at the shared folder with a relative symlink:

Terminal window
mkdir -p .claude/skills
ln -s ../../.agents/skills/dir-report .claude/skills/dir-report
ls -l .claude/skills

The 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:

Terminal window
codex --version
codex debug prompt-input | awk '{gsub(/\\n/,"\n")} 1' | grep -E 'r1|dir-report'
Terminal output showing codex-cli 0.171.0, the r1 skill root pointing at .agents/skills, and the dir-report entry with its description

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:

Terminal window
npx -y @google/gemini-cli@0.72.0 --version
npx -y @google/gemini-cli@0.72.0 skills list

In 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:

Terminal window
GEMINI_CLI_TRUST_WORKSPACE=true npx -y @google/gemini-cli@0.72.0 skills list
Terminal output from Gemini CLI 0.72.0 showing no skills discovered in an untrusted folder, then dir-report listed as enabled after trusting the workspace

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:

Terminal window
claude --version
claude -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.

Terminal output showing Claude Code 2.1.332 running /dir-report and reporting one .md file and one .py file

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-tools is marked experimental in the spec, so don’t rely on it behaving the same everywhere.
  • Invocation syntax. /dir-report in Claude Code, $dir-report in 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/skills over .gemini/skills within 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 python3 fails wherever it’s missing. Use the compatibility field 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.

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.

Keep reading

All posts