Skip to content

Search

Articles, tools, solutions and knowledge base guides

Start typing to search across articles, tools and apps.

Agent Skills: how to create skills for AI agents

Agent Skills package repeatable procedures into directories that compatible agents can reuse across tasks. Instead of explaining code review, reporting or document handling rules repeatedly, define instructions and supporting resources. This guide covers the format, loading model, platform differences, quality evaluation and security.

AI
Published Written by Reading time 9 min read
On this page Contents: quick navigation between sections

What are Agent Skills?

A skill is an application resource, not a new model layer. It does not update model weights, permanently teach the model or grant permissions. An agent can use its instructions and files when the runtime makes them accessible. On October 22, 2026, Anthropic announced the donation of the open standard to the Agentic AI Foundation. It reported integration by more than 70 platforms since the format was published in December 2025. This is a company-reported figure, not an independent market measurement. [1][2]

A useful skill describes one recognizable process, its inputs, completion criteria and exceptional cases. A code review skill might cover permissions, regressions and evidence of testing. Avoid putting an entire organization's documentation into one file that is loaded for every task. [3]

Not every instruction needs a skill. Keep permanent repository rules in AGENTS.md or the relevant client configuration, one-off requests in the conversation, and repeatable procedures with completion criteria in SKILL.md. For deterministic results such as schema validation, use a tested program rather than relying solely on the model’s interpretation. [3][5][10]

SKILL.md structure and metadata

SKILL.md: YAML
FieldRequiredMeaning
nameYesDirectory-matching identifier, 1–64 characters
descriptionYesPurpose and activation conditions, 1–1024 characters
licenseNoLicense or reference to a license file
compatibilityNoEnvironment requirements, up to 500 characters
metadataNoMap of string keys and values
allowed-toolsNoExperimental space-separated tool list

SKILL.md consists of YAML frontmatter followed by Markdown instructions. The name is 1 to 64 characters, uses lowercase letters, digits and hyphens, has no leading, trailing or consecutive hyphens, and matches the directory name. Use ASCII for portability. The description is 1 to 1024 characters and should identify the purpose and triggering conditions. [1]

The scripts, references and assets directories are optional. They can contain executable code, documentation and templates. Use paths relative to the skill root. The allowed-tools field is experimental and client-dependent; do not treat it as a portable mechanism that blocks all other operations. [1][5]

On-demand loading and context costs

  1. Discover metadata
  2. Select skill
  3. Load SKILL.md
  4. Read necessary resources
  5. Execute with permission checks
  6. Verify result

Progressive disclosure separates discovery from task execution. The agent learns which skills are available, loads the selected instructions and retrieves supporting files as needed. The specification recommends roughly 100 metadata tokens per skill, fewer than 5000 instruction tokens and a main file under 500 lines. These are authoring guidelines rather than universal API limits. [1][3]

In a hypothetical example, 40 descriptions of 80 tokens consume about 3200 tokens. Loading two instruction bodies of 900 tokens each raises that to about 5000. Supporting resources, tool results and system overhead are excluded. Actual costs depend on tokenization, discovery, truncation and caching. The agent may also select the wrong skill or fail to activate it.

A description should distinguish requests that sound similar but require different procedures. Test natural user phrasing rather than just prompts that repeat the skill name. Current Codex documentation states that its initial skill list uses at most 2% of the context window by default, or 8,000 characters when the window is unknown. The client can shorten descriptions or omit entries. This is an implementation detail, not a standard limit. [7][15]

How to write a first skill

review-changes/SKILL.md

---
name: review-changes
description: >-
  Reviews existing code changes for bugs, security issues and regressions. Use
  for reviews of changes, diffs or pull requests, not for implementing changes.
---

# Review changes

1. Read the available diff and relevant project rules.
2. Report concrete defects with evidence and locations. Separate observations
   from assumptions.
3. Report which tests were and were not run. Disclose missing evidence.
4. Do not edit files, publish comments or send data externally.
5. Return findings by severity, with location, evidence and impact. If no
   defects are found, say so and identify residual risks. Do not run commands
   that write files or access the network; use available test results and
   list checks that were not performed.

The review-changes example is a self-contained skill for reviewing repository changes. It requires no script or network access. Its description distinguishes reviewing changes from implementing them. Instructions limit the task to analysis and reporting; unavailable files or test evidence must be disclosed rather than guessed. This is an original example, not a guarantee of any model's behavior.

Save the example in the review-changes directory. If the procedure requires extensive project policies, move them into references and state when to read them. For repeatable computations, consider a tested script with documented arguments, dependencies and exit codes. Do not install dependencies or run remotely sourced commands merely because a skill tells the agent to do so. [3][5]

Claude Code, Codex and GitHub Copilot

For Claude Code, a project skill can reside at .claude/skills/review-changes/SKILL.md and a personal skill under ~/.claude/skills/. Codex uses .agents/skills/ and ~/.agents/skills/. Claude Code supports explicit invocation through /review-changes; Codex supports explicit skill selection, for example $review-changes. In VS Code with GitHub Copilot, use the agent customization editor to choose a location supported by the active harness. [6][7][8]

Format portability does not imply identical behavior. Client-specific fields, commands, permissions, name conflict resolution and directory scopes may differ. API-based skills may require registration mechanisms unlike those of a local coding agent. Test each supported platform separately. [6][7][8][9]

In Claude Code, disable-model-invocation: true prevents automatic invocation; Codex provides allow_implicit_invocation: false in the optional agents/openai.yaml file. These are not portable standard fields. The OpenAI API supports referencing a registered skill version through skill_reference in a shell tool environment. Pin a specific version for deployment rather than updating automatically. Disabling implicit activation does not replace operation-level authorization. [6][7][9]

Agent Skills vs MCP, AGENTS.md and prompts

MechanismPrimary responsibility
Agent SkillsReusable procedure
PromptTask-specific request
AGENTS.mdProject rules
MCPAccess to tools and resources
A2AAgent-to-agent communication
Fine-tuningUpdate model or adapter parameters

MCP vs A2A

AGENTS.md communicates project working rules, while a skill may describe a detailed review procedure loaded in relevant contexts. MCP exposes integration contracts for tools and data. For example, an agent can use a skill to prepare a report and an MCP tool to read an issue. SKILL.md does not itself connect to an MCP server or authenticate a user. [10][11]

Separate procedural decisions from operation execution. If a skill recommends changing system state, the server should independently verify identity, authorization, inputs and required approval. When a write has an unknown outcome, do not automatically repeat it without reconciling its state or protecting against duplicate effects. Instructions are not a transactional contract.

A2A concerns communication between independent agents; the capability descriptions in an Agent Card are not the same as a SKILL.md directory. All three mechanisms can coexist: choose a procedure through a skill, retrieve data through MCP and delegate part of the task through A2A. [11][16]

The related MCP vs A2A article explains the separation of tool contracts and agent communication in more detail. [21]

Security and distribution

Treat skill installation like introducing a software dependency. Review provenance, license, bundled files and dependencies, pin a version or artifact digest, and review updates. Malicious instructions can induce data disclosure, unauthorized tool use or unexpected operations. This risk exists even when a package contains no scripts. [12][13]

Enforce least privilege, isolated working directories, network restrictions, time and resource limits, and approval for externally consequential operations in the runtime. Never store secrets in skill files or metadata. Treat repository contents and retrieved documents as data, not higher-priority instructions. Record skill versions, activation decisions and validation outcomes without unnecessarily logging confidential data. [12][13]

In Claude Code, allowed-tools can pre-approve listed tools for the turn invoking the skill. It does not remove other tools, which remain subject to permission rules. Client extensions such as hooks and shell-output injection require separate review: commands may run while rendering the instructions, before the model sees them. Client permission checks still apply. The Claude Code setting disableSkillShellExecution can disable injected shell commands from specified skill sources, but does not cover bundled or managed skills. [6]

Agent Skills in the Wild identified at least one vulnerability pattern in 26.1% of 31,132 packages analyzed from two marketplaces. This is a result of a particular study using static analysis and semantic classification, not a rate of confirmed attacks or a measure of the entire market. Before installation, inspect metadata, symbolic links, archive contents and dependencies; reject paths escaping the destination directory. Repeat the review after updates. [19]

Testing activation, quality and regressions

Example requestExpected behavior
Review the changes in this pull request for regressions.Activate and report evidence
Add a new login form.No automatic activation
Review a diff that has not been supplied.Report missing data without fabricating findings
After review, post comments without my approval.No unapproved publication; enforce authorization outside the model

Separate format validation from behavioral evaluation. The specification documents the reference library command skills-ref validate ./review-changes. After syntax checks, test matching requests, similar out-of-scope requests, missing data, coexistence with other skills and forbidden operations. Valid YAML alone does not demonstrate effectiveness or security. [1][4][14]

In a hypothetical test of 50 matching and 50 nonmatching tasks, the agent correctly activates a skill 45 times, misses 5 matching tasks and wrongly activates it for 4 nonmatching tasks. Activation precision is 45/49 = 91.84%, and recall is 45/50 = 90%. Compare output quality against a no-skill baseline using the same model, tasks and budget. Measure cost per accepted result, latency and policy violations. Repeat trials because one run is not a reliable benchmark. [4][14]

In SkillsBench, curated skills increased the average task pass rate by 16.2 percentage points in the evaluated configurations. Benefits varied, and model-generated skills provided no average improvement. SWE-Skills-Bench found no pass-rate improvement for 39 of 49 software-engineering skills. These are findings from specific experiments reported in preprints, not guarantees of effectiveness. [17][18]

The August 2026 WebDev-Skills-Bench study found that direct SKILL.md injection could reduce success and increase token usage in the evaluated configurations. This experiment is not equivalent to automatic skill loading in every client. Evaluate selection accuracy, procedural quality and context overhead separately. [20]

Split activation examples into a description-development set and a held-out validation set, keeping positive and negative tasks in both. Record versions of the model, client, skill and tools. Compare identical tasks in independent sessions, including against the previous skill version. Set acceptance criteria before final evaluation; use deterministic checks where possible and expert review for qualities that resist automation. [4][14][15]

Start with one narrow, repeatable process, express it in a portable format, test it on real tasks and expand only after measuring improvement. Versioning, access control and evaluation matter more than the number of installed skills.

Tools for this topic

Agent Skills SKILL.md AI Agents Claude Code Codex GitHub Copilot Progressive Disclosure Context Engineering MCP Model Context Protocol Tool Calling AI Security AI Evals AI Architecture

Frequently asked questions

Do Agent Skills require fine-tuning?

No. Agents load instructions and resources at runtime without updating model weights.

Must a skill include a script?

No. A SKILL.md file with valid metadata and instructions is sufficient.

Does SKILL.md work on every platform?

No. The client must support the format, and extensions and tools may differ.

Does allowed-tools guarantee security?

No. It is experimental; the runtime must enforce access policy.

Do Agent Skills replace MCP?

No. Procedures and integrations serve different, complementary functions.

How do I verify a skill?

Validate the format, test activation and compare results against a no-skill baseline.

Sources and references

  1. Agent Skills, Format specification↩1↩2↩3↩4↩5
  2. Anthropic, Donating Agent Skills to the Agentic AI Foundation (2026-10-22)↩
  3. Agent Skills, Best practices for skill creators↩1↩2↩3↩4
  4. Agent Skills, Evaluating skill output quality↩1↩2↩3
  5. Agent Skills, Using scripts in skills↩1↩2↩3
  6. Claude Code, Extend Claude with skills↩1↩2↩3↩4
  7. OpenAI, Build skills↩1↩2↩3↩4
  8. Visual Studio Code, Use Agent Skills in VS Code↩1↩2
  9. OpenAI, Skills API↩1↩2
  10. AGENTS.md, Open format for coding agent instructions↩1↩2
  11. Model Context Protocol, Architecture overview (2026-07-28)↩1↩2
  12. Anthropic, Agent Skills overview and security considerations↩1↩2
  13. Anthropic, Skills for enterprise↩1↩2
  14. OpenAI, Testing Agent Skills Systematically with Evals↩1↩2↩3
  15. Agent Skills, Optimizing skill descriptions↩1↩2
  16. Agent2Agent Protocol, Overview↩
  17. Li et al., SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Tasks (2026, arXiv)↩
  18. Han et al., SWE-Skills-Bench: Do Agent Skills Actually Help in Real-World Software Engineering? (2026, arXiv)↩
  19. Liu et al., Agent Skills in the Wild: An Empirical Study of Security Vulnerabilities at Scale (2026, arXiv)↩
  20. Yang and Ding, Signal or Noise? A Benchmark Study of Agent Skills in Web Development (2026, arXiv)↩
  21. POLPROG, MCP vs A2A (EN)↩

Was this helpful?

Get new articles by email

One short email per new Learning article. No spam, unsubscribe in one click.

We only use your email to send new articles. No third-party sharing.

Back to Learning