Skip to main content

SkillRegistry

Struct SkillRegistry 

Source
pub struct SkillRegistry { /* private fields */ }
Expand description

Registry that discovers skills from multiple search paths.

Implementations§

Source§

impl SkillRegistry

Source

pub fn new() -> Self

Source

pub fn with_defaults() -> Self

Create a registry pre-populated with the default search paths.

Source

pub fn add_default_paths(&mut self)

Add the standard search paths (project-local + user-global).

Source

pub fn add_search_path(&mut self, path: PathBuf)

Add an extra search path for skills.

Source

pub fn discover(&mut self)

Scan all search paths and discover skills (reads only frontmatter).

Source

pub fn discovered(&self) -> &[SkillMeta]

Return all discovered skill metadata.

Source

pub fn load(&mut self, name: &str) -> Option<&Skill>

Load (activate) a skill by name — reads the full SKILL.md body.

Source

pub fn load_all(&mut self)

Load all discovered skills.

Source

pub fn loaded(&self) -> &[Skill]

Get all loaded (activated) skills.

Source

pub fn skills_summary_prompt(&self) -> String

Generate a system prompt fragment listing discovered skills.

Only name + description are included (the full instructions are injected when a skill is activated).

Source

pub fn loaded_skills_prompt(&self) -> String

Generate a prompt fragment with the full instructions of all loaded skills.

Trait Implementations§

Source§

impl Default for SkillRegistry

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> Same for T

Source§

type Output = T

Should always be Self
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.