pub struct SkillRegistry { /* private fields */ }Expand description
Registry of all available skills for the current loop.
Implementations§
Source§impl SkillRegistry
impl SkillRegistry
Sourcepub fn register_builtin(
&mut self,
fallback_name: &str,
raw_content: &str,
) -> Result<()>
pub fn register_builtin( &mut self, fallback_name: &str, raw_content: &str, ) -> Result<()>
Register a built-in skill from raw content (with frontmatter).
Sourcepub fn scan_directory(&mut self, dir: &Path) -> Result<()>
pub fn scan_directory(&mut self, dir: &Path) -> Result<()>
Scan a directory for skill files and register them.
Discovers two patterns:
dir/*.md— single-file skills (name from filename stem)dir/*/SKILL.md— directory-based skills (name from parent dir)
User skills with the same name as built-in skills replace them.
Sourcepub fn from_config(
config: &SkillsConfig,
workspace_root: &Path,
active_backend: Option<&str>,
) -> Result<Self>
pub fn from_config( config: &SkillsConfig, workspace_root: &Path, active_backend: Option<&str>, ) -> Result<Self>
Construct a fully-populated registry from config.
Sourcepub fn get(&self, name: &str) -> Option<&SkillEntry>
pub fn get(&self, name: &str) -> Option<&SkillEntry>
Get a skill by name.
Sourcepub fn skills_for_hat(&self, hat_id: Option<&str>) -> Vec<&SkillEntry>
pub fn skills_for_hat(&self, hat_id: Option<&str>) -> Vec<&SkillEntry>
Get all skills visible to a specific hat (filtered by hat + backend).
Sourcepub fn auto_inject_skills(&self, hat_id: Option<&str>) -> Vec<&SkillEntry>
pub fn auto_inject_skills(&self, hat_id: Option<&str>) -> Vec<&SkillEntry>
Get all auto-inject skills (filtered by hat + backend).
Sourcepub fn build_index(&self, hat_id: Option<&str>) -> String
pub fn build_index(&self, hat_id: Option<&str>) -> String
Build the compact skill index for prompt injection.
Sourcepub fn load_skill(&self, name: &str) -> Option<String>
pub fn load_skill(&self, name: &str) -> Option<String>
Get skill content wrapped in XML tags for CLI output.
Auto Trait Implementations§
impl Freeze for SkillRegistry
impl RefUnwindSafe for SkillRegistry
impl Send for SkillRegistry
impl Sync for SkillRegistry
impl Unpin for SkillRegistry
impl UnsafeUnpin for SkillRegistry
impl UnwindSafe for SkillRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more