Skills
ox-core discovers SKILL.md skill files from ordered search roots and exposes them through progressive disclosure, deterministic auto-loading, and agent role metadata.
Search Roots
Section titled “Search Roots”SkillRegistry::default_roots scans directories in precedence order, so project-local skills override global skills on name collision:
<cwd>/.agents/skills<cwd>/.ox/skills$XDG_CONFIG_HOME/ox/skills~/.config/ox/skills
SkillRegistry::discover_with_defaults appends any caller-supplied extra roots after the default roots, including <package_root>/skills directories from configured package_roots (see Package Roots). Missing roots, unreadable directories, and malformed SKILL.md files are skipped without aborting discovery.
Skill File Format
Section titled “Skill File Format”Each skill lives in <root>/<dir>/SKILL.md and begins with a --- YAML frontmatter block defining name, description, and optional activation, matcher, and role fields:
---name: rust-reviewdescription: Check Rust changes for idioms, error handling, and test coverage.activation: on_demandon_files: *.rs, Cargo.tomlon_tools: edit, writemodel: claude-sonnet-5-5tools: read, grep, glob---
# Rust Review
Run `cargo clippy --all-targets -- -D warnings` before approving changes.| Field | Type | Default | Description |
|---|---|---|---|
name |
string |
Required | Unique skill identifier (single-line, quoted / unquoted) |
description |
string |
Required | Short summary rendered in the system prompt index |
activation |
string |
on_demand |
on_demand or always (auto-injected into the system prompt at start) |
on_files |
string |
None | Comma-separated file globs matched against path / file_path tool arg |
on_tools |
string |
None | Comma-separated tool name globs matched before tool execution |
model |
string |
None | Optional model / profile hint for agent roles |
tools |
string |
None | Optional comma-separated tool allowlist for agent roles |
user_invocable |
boolean |
true for on_demand, else false |
Whether the TUI exposes the skill as a /<name> slash command |
Unknown frontmatter keys and # comment lines are ignored. Invalid activation or user_invocable values fail parsing.
Progressive Disclosure and Auto-Loading
Section titled “Progressive Disclosure and Auto-Loading”- Prompt index:
SkillRegistry::prompt_indexreturnsNonewhen no skills are registered, or a deterministic- <name>: <description>list for system prompt injection without embedding full skill bodies. - On-demand loading:
LoadSkillToolimplementsToolunder the nameload_skillwith schema{ "name": string }. Calling it reads the matchingSKILL.mdfile from disk, strips its frontmatter, and returns the Markdown body. Unknown skill names return a tool error. - Session-start injection: When a
SkillRegistryis attached viaAgent::with_skills, all skills withactivation: alwaysare injected into the system prompt at session start and marked loaded. - Matcher-driven injection: Before each tool executes,
Agentevaluateson_filesagainst the tool call’spath/file_pathargument andon_toolsagainst the tool name. Matching skills not yet loaded are injected into the tool context and marked loaded so each skill is injected at most once per session. - User-invocable slash commands: Calling
CommandRegistry::register_skillsorApp::with_skillsinox-tuiregisters every skill withuser_invocable: trueas/<name>with its frontmatter description, skipping names that collide with existing commands or aliases. Dispatching/<name> [args]loads the skill body, wraps it in<skill name="...">...</skill>with any trailing user arguments, and returnsCommandEffect::SubmitPrompt.