A skill is a bundle of domain-specific instructions, with optional Python scripts and resource files: how to fill a PDF form, the house style for a report, the steps of a support procedure. The agent sees only the list of its skills, with their descriptions, and loads a skill’s full instructions when a task calls for it. Dozens of skills cost a few lines of prompt until they are used.

On disk

One directory per skill, holding a SKILL.md file:
SKILL.md
The body is the instructions, as long as they need to be.

Giving skills to an agent

SkillsDirectory loads every sub-directory that has a SKILL.md and skips the others. The agent then gets:
  • a compact list of the skills (name and description) in its system prompt;
  • three tools: list_skills, load_skill(skill_name) which returns the full instructions with the lists of resources and scripts, and read_skill_resource(skill_name, resource_name);
  • the tools defined by the skills’ scripts.
The skills block is not rendered when the agent has a fixed system_prompt.

Scripts

Each .py file in a skill’s scripts/ directory can provide tools in one of two ways:
  • a module-level tools list of Tool instances, used as is;
  • otherwise, every public function with a docstring and type annotations, wrapped with Tool(fn).
scripts/tools.py
The tools are registered on the agent automatically, once each: passing tools=skills.get_tools() as well creates no duplicates. A script is imported once per skill, under its own module name.
Script files are imported and executed as Python. Only load skills from directories you trust.

Skills in code

A skill does not need a directory:
Skill.from_directory(path), Skill.from_yaml(file) and Skill.from_dict(data) load one skill.

With sub-agents

An orchestrator with sub-agents can hand its skills down: each spawn_agent call names the skills the sub-agent may load.