Creating a Skill: the complete specification
A Skill is a standardized, portable folder that gives an AI agent a precise capability. This article breaks down the official Agent Skills specification: the structure of the SKILL.md file, progressive disclosure, writing best practices, trigger optimization, and the full creation workflow. Everything you need to build Skills that run on Claude Code, Copilot, Gemini, and dozens of other agents alike.
Andrea DELRE
May 14, 2026 · 17 min read
This article is a reference for understanding and building a Skill in the Agent Skills format. It covers the official specification, best practices, the triggering and evaluation mechanisms, and the concrete implications for a creation UX.
1. What is a Skill, technically?
A Skill is a folder containing at minimum a SKILL.md file. It’s an open format, readable by any compatible agent (Claude Code, VS Code Copilot, OpenAI Codex, Gemini CLI, etc.).
Typical folder structure
skill-name/
├── SKILL.md # Required: metadata + instructions
├── scripts/ # Optional: executable code
├── references/ # Optional: detailed documentation
├── assets/ # Optional: templates, static resources
└── ... # Other free-form files/folders
Why this minimalist format?
- Portable: any editor or agent can load the folder
- Versionable: it lives well in Git
- Composable: a Skill can reference another, an Agent can compose several
- Progressive: only the metadata is loaded permanently, the rest on demand
2. The SKILL.md file: detailed format
SKILL.md has two parts:
- A YAML frontmatter (metadata between
---) - A Markdown body (the instructions for the agent)
2.1 Frontmatter — fields and constraints
| Field | Required | Constraints | Description |
|---|---|---|---|
name | Yes | 1-64 characters, lowercase a-z, digits, hyphens. No leading/trailing hyphen. No --. Must match the folder name. | Unique identifier of the Skill |
description | Yes | 1-1024 characters, non-empty | Describes what the Skill does AND when to use it |
license | No | Short free text | Name of a license or reference to a LICENSE file |
compatibility | No | Max 500 characters | Environment prerequisites (OS, packages, network, target model) |
metadata | No | Key-value map (string → string) | Free-form metadata specific to the client/organization |
allowed-tools | No | Space-separated list | Pre-approved tools for this Skill (experimental) |
Per-product extensions (outside the official spec)
Some clients add non-standard fields, useful for multi-target publishing:
| Field | Product | Role |
|---|---|---|
argument-hint | Copilot, Gemini CLI | Help text shown in the chat input when the Skill is invoked manually |
user-invocable | Copilot, Gemini CLI | Boolean. If false, the Skill doesn’t appear in the / menu (activated only by auto-detection) |
disable-model-invocation | Copilot, Gemini CLI | Boolean. If true, agents cannot trigger this Skill automatically |
These fields are ignored by Claude Code and Claude.ai (which only use the standard fields), so you can include them without breaking portability.
Detailed rules for name
Valid:
pdf-processingdata-analysiscode-review
Invalid:
PDF-Processing(uppercase not allowed)-pdf(cannot start with-)pdf--processing(consecutive hyphens not allowed)
Detailed rules for description
This is the most critical field. It’s what determines whether the agent will use the Skill.
Good example:
description: Extracts text and tables from PDFs, fills out PDF forms, and merges files. Use when the user works with PDF documents or mentions forms or document extraction.
Bad example:
description: Helps with PDFs.
Good descriptions:
- Use the imperative mood (“Use when…”)
- Describe user intent, not internal mechanics
- Are a bit pushy: explicitly list use cases, even implicit ones (“even if the user doesn’t explicitly say ‘CSV’”)
- Stay concise (a few sentences, not a 1000-word paragraph)
When to use compatibility?
Only if the Skill has real environment requirements. Examples:
Designed for Claude Code (or similar products)Requires git, docker, jq, and access to the internetRequires Python 3.14+ and uv
Most Skills don’t need it.
Examples of custom metadata
metadata:
author: "Jane Doe"
version: "1.2"
process-family: "scoping"
maturity: "beta"
2.2 Markdown body — rules
The body contains the instructions the agent will follow when the Skill activates.
Structural rules:
- No imposed format, it’s free-form Markdown
- Loaded entirely into context as soon as the Skill activates
- Recommended: < 500 lines / < 5,000 tokens
- Beyond that, use the referenced-files system (see section 4)
Recommended sections:
- Step-by-step instructions
- Input/output examples
- Common edge cases
- Gotchas (non-obvious pitfalls)
3. The core principle: “progressive disclosure”
This is the mechanic to understand when designing a creation interface.
Three loading levels
| Level | Content | When it’s loaded |
|---|---|---|
| 1. Metadata | name + description | Always (~100 tokens per available Skill) |
| 2. Instructions | Full body of SKILL.md | When the Skill is activated (recommended < 5,000 tokens) |
| 3. Resources | Files in scripts/, references/, assets/ | On demand (when instructed in the body) |
Consequence for creation
- A user can have 100 available Skills without saturating the context — only the descriptions are loaded
- The body of the Skill must be surgical: only what is essential to every run
- All the detail (long references, bulky templates, schemas) goes into separate files referenced conditionally
Example of conditional referencing
In the body of SKILL.md:
## API error handling
For the standard flow, follow steps 1 to 5 below.
If the API returns a non-200 code, first read
[references/api-errors.md](references/api-errors.md) before continuing.
The agent will load references/api-errors.md only when the error occurs. Massive context savings on normal runs.
4. The optional subfolders
4.1 scripts/
Executable code the agent can run.
Best practices:
- Self-contained or explicitly documented dependencies
- Explicit error messages
- No interactive prompts (agents run in a non-interactive shell)
- Documented
--help - Structured output (JSON preferred), with diagnostics on stderr
- Idempotent if possible
- Distinct, documented exit codes
- Pagination or an
--outputflag if the output can be massive
Supported languages (depends on the agent):
- Python with
uv runand PEP 723 (inline dependencies) - TypeScript with Deno or Bun
- Ruby with
bundler/inline - Bash
- Commands via
npx,uvx,pipx,bunx,deno run,go run
Self-contained Python example (PEP 723):
# /// script
# dependencies = [
# "beautifulsoup4",
# ]
# ///
from bs4 import BeautifulSoup
# ...
Run: uv run scripts/extract.py
4.2 references/
Supplementary documentation, loaded on demand.
Common patterns:
REFERENCE.md— detailed technical referenceFORMS.md— form templates or structured formats- Domain-specific files:
finance.md,legal.md,compliance.md
Rules:
- Keep files focused (one topic per file)
- Add a table of contents if the file exceeds 300 lines
- Reference from
SKILL.mdwith an explicit instruction about when to read it
4.3 assets/
Static resources used in output:
- Document templates
- Configuration templates
- Images (diagrams, examples)
- Data files (lookup tables, schemas)
4.4 Organizing by domain
When a Skill covers several variants, organize by variant in references/:
cloud-deploy/
├── SKILL.md (general workflow + selection logic)
└── references/
├── aws.md
├── gcp.md
└── azure.md
The Skill reads SKILL.md first, which decides which of the referenced files to load depending on the context.
5. Writing best practices
5.1 Start from real expertise
The classic trap: asking an LLM to generate a Skill without giving it any specific context. The result: vague procedures (“handle errors appropriately”) instead of concrete API patterns, real edge cases, project conventions.
Two effective approaches:
- Extraction from a real task: do the task with an agent, correct as you go, then extract the reusable pattern. Pay particular attention to:
- The steps that worked
- The corrections you made (“use X instead of Y”)
- The input/output formats observed
- The project context provided (conventions, constraints)
- Synthesis from existing artifacts: incident reports, runbooks, style guides, API specs, schemas, code review comments, git history.
5.2 Spend context wisely
Add what the agent doesn’t know, omit what it already knows.
Bad (too verbose, the agent already knows what a PDF is):
## PDF extraction
PDF (Portable Document Format) files are a common format
containing text, images, etc. To extract text, you'll
need a library...
Good (straight to what the agent doesn’t know):
## PDF extraction
Use pdfplumber for extraction. For scanned documents,
fall back to pdf2image with pytesseract.
5.3 Design coherent units
A Skill should encapsulate a coherent unit of work. Too narrow = several Skills have to load together for one task. Too broad = hard to activate precisely.
Example: “query the DB and format the results” can be a coherent Skill. Adding “DB administration” to it is probably too much.
5.4 Prefer moderation over exhaustiveness
Over-complete Skills hurt more than they help — the agent struggles to extract what’s relevant and may follow instructions that don’t apply.
Prefer: concise guidelines with one example that works. Avoid: documentation that covers every imaginable edge case.
5.5 Calibrate the level of constraint
- Leave room when several approaches are valid: explaining why a constraint exists is more effective than rigid directives.
- Be prescriptive when the operation is fragile or when an exact sequence is required.
Prescriptive example (DB migration):
Run exactly this sequence:
python scripts/migrate.py --verify --backup
Do not modify the command and do not add any flags.
5.6 Give defaults, not menus
Avoid: “You can use pypdf, pdfplumber, PyMuPDF, or pdf2image…”
Prefer: “Use pdfplumber for text. For scanned PDFs that need OCR, use pdf2image with pytesseract.”
5.7 Favor procedures over ready-made answers
A Skill should teach the agent how to approach a class of problems, not what to produce for a specific case.
Bad (too specific):
Join the `orders` table to `customers` on `customer_id`, filter
`region = 'EMEA'`, sum the `amount` column.
Good (reusable method):
1. Read the schema in `references/schema.yaml` to find the relevant tables
2. Join the tables following the `_id` convention for foreign keys
3. Apply the filters from the user's request as WHERE clauses
4. Aggregate the numeric columns and format as a markdown table
6. Effective writing patterns
6.1 The “Gotchas” section
Non-obvious pitfalls are worth gold. Not generic advice, but concrete corrections to mistakes the agent will make unless warned.
## Gotchas
- The `users` table uses soft deletes. Queries must include
`WHERE deleted_at IS NULL`, otherwise deactivated accounts show up.
- The user ID is called `user_id` in the DB, `uid` in the auth service,
and `accountId` in the billing API. It's the same value.
- The `/health` endpoint returns 200 as soon as the web server is up,
even if the DB is down. Use `/ready` for a full check.
Handy trick: when an agent makes a mistake that needs correcting, add it to the gotchas section.
6.2 Templates for the output format
More reliable than a prose description. Agents are good at pattern matching on concrete structures.
## Report structure
Use this template:
# [Title]
## Executive summary
[Paragraph summarizing the findings]
## Key findings
- Finding 1
- Finding 2
## Recommendations
1. Action 1
2. Action 2
6.3 Checklists for multi-step workflows
## Processing workflow
Progress:
- [ ] Step 1: Analyze the form (`scripts/analyze_form.py`)
- [ ] Step 2: Create the mapping (edit `fields.json`)
- [ ] Step 3: Validate (`scripts/validate_fields.py`)
- [ ] Step 4: Fill (`scripts/fill_form.py`)
- [ ] Step 5: Verify (`scripts/verify_output.py`)
6.4 Validation loops
## Editing workflow
1. Make your changes
2. Run validation: `python scripts/validate.py output/`
3. If validation fails:
- Read the error message
- Fix the issues
- Re-run validation
4. Only continue once validation passes
6.5 Plan → Validate → Execute
For destructive or batch operations:
1. Extract the fields: `python scripts/analyze_form.py input.pdf` → `form_fields.json`
2. Create `field_values.json` with the values to fill in
3. Validate: `python scripts/validate_fields.py form_fields.json field_values.json`
4. If it fails, fix `field_values.json` and re-run validation
5. Fill: `python scripts/fill_form.py input.pdf field_values.json output.pdf`
Step 3 is the key: the script validates the plan against a source of truth before execution.
6.6 Bundling reusable scripts
If, watching the agent, you see it reinventing the same script on every run (generating a chart, parsing a format), that’s the signal to write the script once and bundle it in scripts/.
7. Description optimization (triggering)
7.1 The problem
A Skill is useless if it doesn’t trigger at the right moment. The description carries all of the triggering load.
- Too narrow → doesn’t trigger when it should
- Too broad → triggers on off-topic requests
7.2 Principles
- Imperative: “Use this skill when…” (not “This skill does…”)
- Centered on user intent, not internal mechanics
- A bit pushy: list implicit cases (“even if the user doesn’t explicitly mention…”)
- Concise: a few sentences max, hard limit of 1024 characters
Before/after:
# Before
description: Process CSV files.
# After
description: >
Analyze CSV and tabular data files — compute summary statistics,
add derived columns, generate charts, and clean messy data. Use this
skill when the user has a CSV, TSV, or Excel file and wants to
explore, transform, or visualize the data, even if they don't
explicitly mention "CSV" or "analysis."
7.3 Testing the triggering
Build ~20 evaluation queries:
- 8-10 “should-trigger” (must trigger)
- 8-10 “should-not-trigger” (must NOT trigger)
The best “should-not-trigger” queries are near-misses: requests that share keywords but need something else.
Query realism:
- File paths (
~/Downloads/report_final_v2.xlsx) - Personal context (“my manager asked me to…”)
- Specific details (column names, company names)
- Casual language, abbreviations, the occasional typo
7.4 The optimization loop
- Evaluate the current description on train + validation
- Identify the failures on the train set
- Revise the description (generalize, don’t overfit)
- Repeat
- Select the best iteration based on the validation score
Anthropic provides a run_loop.py script that automates this (see the skill-creator).
8. The complete creation workflow (based on Anthropic’s skill-creator)
This is the reference process to reproduce in any creation.
Step 1: Capture the intent
Four questions to ask the user:
- What should this Skill make possible?
- When should it trigger? (user phrasings, contexts)
- What is the expected output format?
- Should test cases be set up? (recommended for outputs that can be verified objectively)
Step 2: Interview and research
Proactive questions about:
- Edge cases
- Input/output formats
- Example files
- Success criteria
- Dependencies
Step 3: Write the SKILL.md
Fill in:
namedescription(using the principles from section 7)compatibility(if needed)- Markdown body
Step 4: Define 2-3 realistic test cases
Typical prompts that real users would write. Saved in evals/evals.json:
{
"skill_name": "example-skill",
"evals": [
{
"id": 1,
"prompt": "User's task prompt",
"expected_output": "Description of expected result",
"files": []
}
]
}
Step 5: Run the tests
Double run per case:
- With the Skill
- Without the Skill (baseline)
Lets you verify that the Skill genuinely adds something.
Step 6: Evaluate
- Qualitative: a human reviewer goes through the outputs
- Quantitative: automated assertions
Anthropic provides an eval-viewer tool that generates an HTML report with:
- “Outputs” tab: prompt + output per test case, with free-form feedback
- “Benchmark” tab: pass rates, timing, tokens, per configuration
Step 7: Iterate
Improve the Skill based on the feedback:
Golden rules:
- Generalize from the feedback — don’t overfit on the test cases
- Keep the prompt lean — remove anything that doesn’t pull its weight
- Explain the why — modern LLMs are capable of good reasoning if you give them the “why”
- Spot repeated work — if the agent reinvents the same logic, bundle it into a script
9. Multi-ecosystem portability
The Agent Skills format is an open standard adopted by nearly all modern AI agents. A well-formed Skill runs without modification on:
| Product | Folder to use |
|---|---|
| Claude Code / Claude.ai | .claude/skills/ or ~/.claude/skills/ |
| GitHub Copilot (VS Code + cloud) | .github/skills/, .claude/skills/, .agents/skills/, ~/.copilot/skills/ |
| Gemini CLI | .gemini/skills/, .agents/skills/, ~/.gemini/skills/, ~/.agents/skills/ |
| Android Studio Gemini | .skills/, .agent/skills/ |
| Google Antigravity | .agent/skills/, ~/.gemini/antigravity/skills/ |
| OpenAI Codex CLI | .agents/skills/ |
| Cursor, Cline, Goose, Amp, Factory, Junie… | .agents/skills/ |
Not supported (MCP or manual copy only): Gemini Code Assist (Google’s IDE), Gemini Gems (Workspace), Google ADK / Vertex AI.
Conventions for publishing a portable Skill
- Strictly follow the agentskills.io spec — don’t rely on proprietary extensions in the required fields.
- Use the
metadatafield for data specific to your organization (author, version, process family) — this field is guaranteed open. - Publish in
.claude/skills/by default (max coverage: Claude + Copilot + all clients that read the standard). - Provide an installer (
install.sh) in the package that, depending on the detected environment, also adds symlinks to.agents/skills/(for Gemini CLI + Codex) or.gemini/skills/specifically. - A compatibility badge displayed on every Skill in the marketplace, updated automatically based on the fields used.
What can break portability
Things to watch on the editor side:
- Using Markdown syntax specific to a particular renderer (GitHub callouts
> [!NOTE], etc.) → prefer standard CommonMark Markdown - References to scripts requiring a non-standard runtime (PowerShell-only, Fish shell…) → document it in
compatibility - Using the Copilot/Gemini fields (
user-invocable,disable-model-invocation) → they are ignored by Claude, so it’s fine as long as they don’t carry critical logic
10. Pre-publication checklist for a Skill
- Valid
name(regex + unique) - Clear, imperative
descriptionthat says what + when -
SKILL.mdbody < 500 lines - Sections: step-by-step instructions, examples, gotchas
- Conditional references correctly linked (with “when to read”)
- Scripts have
--helpand no interactive prompts - At least 2 test cases with verified results
- Optimized description (if the Skill is meant to trigger automatically)
- Technical format validation passed
- Organization metadata filled in (author, family, maturity, version)
11. In conclusion
A Skill = a standardized, portable folder, made of a SKILL.md (metadata + instructions) and optional resources loaded on demand.
Strict conformance to the official Agent Skills format guarantees that any Skill created this way also works in Claude Code, VS Code Copilot, Gemini CLI, Android Studio Gemini, Google Antigravity, OpenAI Codex, Cursor, and dozens of other tools — and conversely, that you can import any Skill from the community. That’s coverage of ~90% of the agentic market with a single format.
Beyond the single Skill
Everything above describes the manufacture of one Skill. The real operational challenge arrives as soon as an organization has ten, then a hundred, then a thousand — spread across multiple teams, business units, subsidiaries. We already know this will be a structuring topic on three counts:
- Governing the library — who produces, who validates, who retires, who owns it, how to avoid divergence or duplication as the number of Skills explodes.
- Guaranteeing provider agnosticism — limiting economic dependence on a model vendor (Anthropic, OpenAI, Google) that would otherwise hold considerable pricing leverage over the company’s entire agentic chain. The open Agent Skills format is precisely the abstraction layer that makes this possible — provided you discipline your conformance to it.
- Homogenizing outputs — without a shared standard for deliverable formats, terminology, editorial style, and naming conventions, AI doesn’t industrialize production: it industrializes the organization’s existing fragmentation. The question “who homogenizes?” must have an explicit answer, articulated with the communications and knowledge management functions.
Sources
- Official specification: agentskills.io/specification
- Creation guide: agentskills.io/skill-creation/quickstart
- Best practices: agentskills.io/skill-creation/best-practices
- Optimizing descriptions: agentskills.io/skill-creation/optimizing-descriptions
- Scripts: agentskills.io/skill-creation/using-scripts
- Anthropic’s skill-creator: github.com/anthropics/skills