Examples
Agent Skills includes runnable examples demonstrating all framework features.
Simple Examples
The examples/simple/ directory contains a comprehensive example covering:
| Feature | Description |
|---|---|
| Skill Creation | Create skills programmatically via SkillsManager API |
| SKILL.md Format | Parse and generate Claude Code compatible SKILL.md files |
| Skill Discovery | Discover and search skills from directories |
| Skill Execution | Execute skills in sandboxes with arguments |
| Skill Versioning | Version management for skills |
| Skills as Code | Simple code file-based skills with SimpleSkillsManager |
| MCP Server | Expose skills via MCP protocol |
Running the Example
cd examples/simple
python skills_example.py
Source: examples/simple/skills_example.py
Code Snippets
Skill Creation
from agent_skills import SkillsManager, SkillContext
manager = SkillsManager("./skills")
skill = manager.create(
name="data_analyzer",
description="Analyze data from a file",
content="# Data Analyzer\n...",
python_code='print("Analyzing...")',
allowed_tools=["filesystem__read_file"],
tags=["data", "analysis"],
context=SkillContext.FORK,
)
SKILL.md Parsing
from agent_skills import Skill
skill = Skill.from_skill_md("""---
name: web_scraper
description: Scrape and extract data
version: 1.0.0
allowed-tools:
- http__fetch
---
# Web Scraper Skill
...
""")
Skill Discovery & Search
# Discover from directory
discovered = manager.discover()
# Search for skills
result = manager.search("data processing", limit=5)
# Filter by tags
data_skills = manager.list(tags=["data"])
Skill Execution
skill = manager.get("data_analyzer")
execution = await manager.execute(
skill,
arguments={"file_path": "/tmp/data.txt"},
timeout=10.0,
)