Expand description
Skill discovery and loading.
A “skill” is a markdown file with a YAML frontmatter block, or a directory containing skill files. Two formats are supported:
Format 1: Single-file skill (SKILL.md)
skills/
my-skill/
SKILL.md # required, with frontmatter
helper.py # optional support files
templates/... # optional subdirsFormat 2: Multi-file skills (like Claude Code plugins)
skills/
om/
debug.md # each .md file is a separate skill
feature.md
plan.md
...Skills are surfaced to the model in two stages:
- At startup every skill’s name + description is injected into the system prompt so the model knows what’s available.
- The
skilltool loads the full skill body (and lists the skill’s files) when the model decides to use one. This keeps baseline token cost low even with many skills installed.
Structs§
- Skill
- A loaded skill ready to be advertised to the model.
Functions§
- discover_
skills - Walk the given roots and load skills from all supported formats:
- format_
catalogue - Render the skills catalogue body for insertion into a prompt section.
Returns
Noneif there are no skills, so callers can skip injection entirely rather than bolting on an empty section. - list_
skill_ files - List files inside a skill directory (recursive), relative to the
skill root. Used by the
skilltool so the model knows what supporting files it canreadnext. - load_
skill - Load a skill from a directory with SKILL.md (backward compatible).
- load_
skill_ from_ file - Load a skill from a specific .md file.
Public so tests and the
skilltool can reload a specific skill.