On disk
One directory per skill, holding aSKILL.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, andread_skill_resource(skill_name, resource_name); - the tools defined by the skills’ scripts.
system_prompt.
Scripts
Each.py file in a skill’s scripts/ directory can provide tools in one of two ways:
- a module-level
toolslist ofToolinstances, used as is; - otherwise, every public function with a docstring and type annotations, wrapped with
Tool(fn).
scripts/tools.py
tools=skills.get_tools() as well creates no duplicates. A script is imported once per skill, under its own module name.
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: eachspawn_agent call names the skills the sub-agent may load.