Creating Cross-Client Compatible AI Agent Skills Using the `.agents/skills/` Convention
AI Agent Skills use a lightweight folder structure with a required SKILL.md file and optional subdirectories to create portable, domain-specific extensions that work across any compliant client.
The agentskills/agentskills repository defines a specification for creating cross-client compatible AI agent skills using the .agents/skills/ convention. This approach enables developers to package domain-specific knowledge and executable resources into portable units that any AI client—whether Claude, GPT, Gemini, or custom implementations—can discover and execute without modification.
Understanding the .agents/skills/ Convention
The .agents/skills/ convention establishes a pure file-system based format for skill distribution. Each skill resides in its own directory named exactly like the skill's name field, containing a mandatory SKILL.md file and optional supporting folders.
This specification ensures progressive disclosure: agents load only minimal metadata (name and description) at startup, then lazily fetch full instructions and auxiliary files when the skill is activated. The format is intentionally language-agnostic, allowing validation logic to be implemented in any programming language while maintaining compatibility across diverse AI clients.
Skill Folder Structure and Components
The SKILL.md File
Every skill requires a SKILL.md file containing YAML front-matter followed by Markdown instructions. The front-matter must include name and description fields, with optional fields for license, compatibility, metadata, and allowed-tools.
In skills-ref/src/skills_ref/parser.py, the parse_frontmatter function uses strictYAML to enforce correct YAML syntax and returns a (metadata, body) tuple. This strict parsing prevents malformed skills from entering the ecosystem.
from pathlib import Path
from skills_ref.parser import read_properties
properties = read_properties(Path("./my-skill"))
print(f"Name: {properties.name}")
print(f"Description: {properties.description}")
print(f"License: {properties.license}")
The read_properties function combines find_skill_md and parse_frontmatter to return a SkillProperties dataclass defined in skills-ref/src/skills_ref/models.py.
Optional Subdirectories
Skills may include additional folders to organize resources:
- scripts/: Executable files referenced by the skill instructions
- references/: Documentation or knowledge bases
- assets/: Images, data files, or other binary resources
When the Markdown body references scripts (e.g., scripts/run.py), agents may invoke them while respecting the optional allowed-tools whitelist specified in the front-matter.
Validation and Cross-Client Compatibility
The skills-ref Validation Library
The repository provides a reference implementation called skills-ref that validates skill compliance before publication. The public CLI entry point resides in skills-ref/src/skills_ref/cli.py, where the validate function walks a skill directory and runs validate_metadata.
Name validation occurs in skills-ref/src/skills_ref/validator.py through the validate_metadata → _validate_name chain, ensuring the folder name matches the front-matter name field and conforms to character set constraints.
Validate skills from the command line:
# Validate a skill located in ./my-skill
skills-ref validate ./my-skill
Programmatic validation in Python:
from pathlib import Path
from skills_ref.validator import validate
skill_path = Path("./my-skill")
errors = validate(skill_path)
if errors:
print("Skill is invalid:")
for e in errors:
print("- ", e)
else:
print("Skill passes all validation checks")
The validate function returns a list of human-readable error messages; an empty list indicates full specification compliance.
Validation Flow
The specification defines a three-phase lifecycle managed by compliant clients:
- Discovery: Agent loads the top-level skill list, reading only each
SKILL.mdfront-matter - Activation: When the description matches a task, the agent reads the full Markdown body
- Execution: If instructions reference scripts, the agent invokes them respecting the
allowed-toolswhitelist
This flow guarantees that discovery never fails due to malformed front-matter, and activation never encounters illegal characters in skill names or descriptions.
Implementing Skills in Practice
Create a compliant skill by establishing a folder with the required metadata and instructions:
---
name: data-cleanup
description: Clean CSV data, remove duplicates, and standardize column names.
license: MIT
metadata:
author: my-org
version: "2.1"
allowed-tools:
- python
- pandas
---
# Instructions
1. Load the CSV with pandas
2. Remove duplicate rows based on the 'id' column
3. Standardize column names to snake_case
Store this as SKILL.md inside a folder named exactly data-cleanup. The metadata map stores unstructured data in the SkillProperties.metadata attribute for client-specific consumption, while allowed-tools explicitly declares which executables the skill may invoke.
Summary
- Agent Skills use a folder-based format with a required
SKILL.mdfile containing YAML front-matter and Markdown instructions. - The skills-ref library provides validation through
validate()invalidator.pyand parsing viaparse_frontmatterinparser.py. - Cross-client compatibility emerges from the language-agnostic, file-system-based specification documented in
docs/specification.mdx. - Progressive disclosure minimizes startup overhead by loading only metadata during discovery, fetching full instructions during activation.
- The
allowed-toolswhitelist ensures secure execution by restricting which scripts and executables a skill may invoke.
Frequently Asked Questions
What makes Agent Skills cross-client compatible?
Agent Skills achieve cross-client compatibility through a pure file-system format and language-agnostic validation logic. Because the specification defines only directory structure and file content standards—rather thanAPI bindings or language-specific SDKs—any client implementing the spec (Claude, GPT, Gemini, or custom agents) can load the same skill folder without modification. The reference validation library in skills-ref/src/skills_ref/validator.py ensures all skills conform to these universal standards.
How does the validation library enforce skill compliance?
The validation library checks three critical constraints: name conformity (folder name matches front-matter name field), required field presence (mandatory name and description), and allowed front-matter keys. The validate_metadata function in validator.py calls _validate_name to verify character sets and length limits, while parse_frontmatter in parser.py uses strictYAML to prevent malformed metadata from passing validation.
Can skills include custom metadata fields?
Yes, skills can include custom metadata through the optional metadata map in the YAML front-matter. These key-value pairs store in the SkillProperties.metadata attribute as unstructured data, allowing organizations to track authorship, versioning, or internal categorization without breaking cross-client compatibility. The validation library preserves this data unchanged while ensuring required fields remain present.
What is the purpose of the allowed-tools field?
The allowed-tools field defines an explicit whitelist of executables and scripts that a skill may invoke during the Execution phase. This security mechanism prevents skills from arbitrarily running system commands by requiring authors to declare necessary tools (such as python, node, or curl) in the front-matter. Compliant clients check this list before invoking any script referenced in the skill's instructions.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →