SKILL.md file with metadata and instructions, plus optional companion files (reference docs, templates, checklists).
The agent sees skill descriptions in its tool definitions and decides when to load one. This keeps the system prompt lean while giving the agent access to detailed, task-specific instructions when needed.
Creating a skill
A skill is a directory with aSKILL.md file:
SKILL.md format
| Field | Purpose |
|---|---|
name | Skill identifier (used by the agent to load it) |
description | One-line summary (shown to the agent so it knows when to use it) |
Adding skills to an agent
Passskills_dir to builtin_tools():
load_skill tool alongside the standard builtin tools (bash, file, search, todo). The tool’s description lists all available skills so the agent knows what’s available.
Without skills_dir, no skill tool is added — the other builtin tools work as usual.
How it works
Discovery
At init,
builtin_tools() scans all subdirectories of skills_dir for SKILL.md files. Each skill’s name and description are collected into the load_skill tool description.Invocation
When the agent receives a request that matches a skill, it calls
load_skill(skill_name). The tool returns the full instructions plus the skill directory path.Writing effective skills
Keep descriptions specific. The agent uses the description to decide when to load a skill."Deploy agents" is better than "Deployment stuff".
Structure instructions clearly. Use numbered steps, checklists, and headers. The agent follows these as directives.
Use companion files for reference material. Keep the main SKILL.md focused on workflow and put detailed reference tables, API docs, or checklists in separate files. The agent reads them only when needed.
One skill per task type. A deploy skill and a rollback skill are better than a single deployment skill that covers both. Smaller, focused skills are easier for the agent to match and follow.
Example
See examples/skills/ for a working demo withresearch and code_review skills.

