Skip to main content

SkillLoader

Struct SkillLoader 

Source
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

Source

pub fn new() -> Self

Creates a new SkillLoader with default search paths.

Default paths (in priority order):

  1. .talos/skills/ relative to the current directory (project-local)
  2. ~/.talos/skills/ (user-global)
  3. Parent directories up to git root, each with .talos/skills/
Source

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.

Source

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).

Source

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.

Source

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.

Trait Implementations§

Source§

impl Default for SkillLoader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.