Skip to main content

Examples

Agent Skills includes runnable examples demonstrating all framework features.

Simple Examples

The examples/simple/ directory contains a comprehensive example covering:

FeatureDescription
Skill CreationCreate skills programmatically via SkillsManager API
SKILL.md FormatParse and generate Claude Code compatible SKILL.md files
Skill DiscoveryDiscover and search skills from directories
Skill ExecutionExecute skills in sandboxes with arguments
Skill VersioningVersion management for skills
Skills as CodeSimple code file-based skills with SimpleSkillsManager
MCP ServerExpose 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
...
""")
# 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,
)

Further Reading