- The system prompt gets a compact Available skills block: one line per
skill (
- name: description) plus one sentence telling the model to callload_skillbefore doing a task a skill covers. - A
load_skilltool (input{ name }) is registered automatically. It returns the skill’s full content as the tool result. - Skill bodies are not in the prompt until loaded. An agent with twenty long skills pays roughly one line per skill on every request, and the body cost only on the runs that use it.
Skills in code
defineSkill({ name, description, content }) validates its input. name must
match ^[a-z0-9][a-z0-9-_]{0,63}$; description and content must be
non-empty. Errors say what is wrong and how to fix it.
The full executor API takes the same option:
load_skill, passing skills throws:
rename your tool or drop the option.
Skills from disk
loadSkills(dir) reads skill files, so non-developers can edit them without
touching code. Two layouts are supported and can be mixed in one directory:
descriptionis required.nameis optional and defaults to the folder name (SKILL.mdlayout) or the file name without.md.- Folders without a
SKILL.mdare ignored. - Skills come back sorted by name, so prompts are deterministic.
- Errors name the file and the problem: missing description, invalid YAML, invalid name, an unreadable directory, or two skills with the same name (both paths are listed).
Testing skills
UsemockModel to assert the model sees descriptions but not
bodies until it loads one: the first request’s system prompt lists the skills,
and the request after a load_skill call contains the body in the tool result.