pub struct SkillLoader {
pub skills: Vec<Skill>,
pub search_paths: Vec<PathBuf>,
}Expand description
Discovers and loads skills from configured search paths.
§Examples
use talos_skill::SkillLoader;
let mut loader = SkillLoader::new();
let skills = loader.discover().expect("failed to discover skills");
let index = loader.get_index();Fields§
§skills: Vec<Skill>All discovered skills.
search_paths: Vec<PathBuf>Directories to search for SKILL.md files.
Implementations§
Source§impl SkillLoader
impl SkillLoader
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new SkillLoader with default search paths.
Default paths (in priority order):
.talos/skills/relative to the current directory (project-local)~/.talos/skills/(user-global)- Parent directories up to git root, each with
.talos/skills/
Sourcepub fn for_workspace(workspace_root: impl AsRef<Path>) -> Self
pub fn for_workspace(workspace_root: impl AsRef<Path>) -> Self
Creates a new loader with search paths rooted at a specific workspace.
Use this from runtime session startup instead of SkillLoader::new
when the process current directory may differ from the active session
workspace.
Sourcepub fn discover(&mut self) -> Result<&Vec<Skill>>
pub fn discover(&mut self) -> Result<&Vec<Skill>>
Scans all search paths for SKILL.md files and parses them.
Returns a vector of all successfully parsed skills. Files that fail to parse are silently skipped (errors are logged but not propagated).
Sourcepub fn parse(path: &Path) -> Result<Skill>
pub fn parse(path: &Path) -> Result<Skill>
Parses a single SKILL.md file into a Skill.
The file must start with ---, followed by YAML frontmatter, then ---,
then the Markdown body.
§Errors
Returns SkillError::FileNotFound if the path does not exist,
SkillError::YamlParseError if the frontmatter is invalid YAML,
or SkillError::InvalidFrontmatter if required fields are missing.
Sourcepub fn get_index(&self) -> Vec<SkillIndex>
pub fn get_index(&self) -> Vec<SkillIndex>
Returns a lightweight index of all loaded skills.
Use this for Level 0 progressive disclosure — injecting skill names and descriptions into the system prompt without loading full bodies.