Source Code:
src/gaia/skills/ ·
Runnable example: examples/skill_references_example.pySKILL.md in it. SkillManager finds skills and
parses them; Agent.load_skill puts one into an agent. For the format and the
discovery rules, see the Agent Skills spec; for ready-made
skills to try, see Starter Skills.
Find and load a skill
SkillManager searches ~/.gaia/skills (moved by
GAIA_CONFIG_DIR) and the read-only ./.claude/skills and ~/.claude/skills.
Pass user_skills_root= to search another folder instead of ~/.gaia/skills,
agent_skill_dirs= to add higher-precedence folders, and
include_claude_roots=False to skip the Claude Code folders.
Reference files and scripts
A skill can ship more than itsSKILL.md: reference documents, scripts,
templates. Long material belongs in those files rather than in the body, because
the body joins the agent’s prompt when the skill is used and the extra files
don’t — the agent opens one only when the instructions send it there.
Folder layout
references/ and scripts/ are the Agent Skills
standard’s conventional names. GAIA does not treat them specially, so any folder
name works — reference/, docs/, templates/ — as long as the body uses the
same path.
Point at a file from the body
Write the path relative to the skill folder, and say when to read it:How the agent loads them
- Listed. Every installed skill’s name and description is in the prompt.
- Activated. Loading the skill adds its body to the prompt and registers any
tools it provides. Nothing in
references/orscripts/is read at this point. - Opened on demand. When the instructions point at a file, the agent reads it
with its file tools. The
load_skilltool tells the model the skill’s folder and that the paths in the instructions are relative to it.
~/.gaia/skills is not in an Agent UI session’s scope otherwise. It is
read-only: the agent still cannot write there, a path that uses .. to leave
the folder is refused, files that look like secrets (.env, keys) stay blocked,
and unload_skill takes the access back.
Read a reference file from Python
skill.directory is the folder the body’s paths are relative to. This excerpt is
from the runnable example, which builds the query-helper skill above in a
temporary folder so your own skills are untouched:
resource_path instead of joining it yourself. It refuses a path
that leaves the skill folder and names the missing file when there is none:
Use a skill inside your own agent
Callself.load_skill(name) in _register_tools. The body goes into the system
prompt, any tools the skill provides register under <skill-name>/<tool>, and
the skill’s folder becomes readable by the agent’s file tools. SKILL_DIRS adds
folders to search ahead of ~/.gaia/skills:
self.load_skill() puts the body in the prompt but not the folder’s location,
so the model sees references/query-syntax.md without knowing where that is.
When the model activates a skill itself — through the load_skill tool from the
skills tool mixin, which the flagship gaia agent has — the tool’s result
carries the folder. For a skill your code loads, either give the agent that mixin
or have your prompt say where the skill lives (skill.directory, returned by
load_skill).Related
- Agent Skills spec — discovery roots, precedence, permissions, tiers
- Starter Skills — ready-made skills to install and fork
- Composing Skills — bundle skills with an agent and pick a set at runtime
- CLI Reference → Skills —
gaia skill list|info|create|import|export