Integration approaches
The two main approaches to integrating skills are: Filesystem-based agents operate within a computer environment (bash/unix) and represent the most capable option. Skills are activated when models issue shell commands likecat /path/to/my-skill/SKILL.md. Bundled resources are accessed through shell commands.
Tool-based agents function without a dedicated computer environment. Instead, they implement tools allowing models to trigger skills and access bundled assets. The specific tool implementation is up to the developer.
Overview
A skills-compatible agent needs to:- Discover skills in configured directories
- Load metadata (name and description) at startup
- Match user tasks to relevant skills
- Activate skills by loading full instructions
- Execute scripts and access resources as needed
Skill discovery
Skills are folders containing aSKILL.md file. Your agent should scan configured directories for valid skills.
Loading metadata
At startup, parse only the frontmatter of eachSKILL.md file. This keeps initial context usage low.
Parsing frontmatter
Injecting into context
Include skill metadata in the system prompt so the model knows what skills are available. Follow your platform’s guidance for system prompt updates. For example, for Claude models, the recommended format uses XML:location field with the absolute path to the SKILL.md file. For tool-based agents, the location can be omitted.
Keep metadata concise. Each skill should add roughly 50-100 tokens to the context.
Security considerations
Script execution introduces security risks. Consider:- Sandboxing: Run scripts in isolated environments
- Allowlisting: Only execute scripts from trusted skills
- Confirmation: Ask users before running potentially dangerous operations
- Logging: Record all script executions for auditing
Reference implementation
The skills-ref library provides Python utilities and a CLI for working with skills. For example: Validate a skill directory:<available_skills> XML for agent prompts: