Skip to main content

SkillResolver

Trait SkillResolver 

Source
pub trait SkillResolver: Send + Sync {
    // Required methods
    fn resolve(&self, name: &str) -> Option<String>;
    fn list(&self) -> Vec<String>;
    fn metadata(&self) -> Vec<SkillMetadata>;
}
Expand description

Resolves named skills to their Markdown content.

Why: Skill sources vary (project .claude/, user ~/.claude/, bundled config); callers should not care which. #2069 splits skills into cheap, always-cached metadata (name + description) and an on-demand-loaded body so the PM/agents can see the full catalog without paying every skill’s token cost up front — metadata() is the cached catalog, resolve() is the lazy, per-invocation body load. What: resolve(name) returns Some(content) if found. list() returns all discoverable names. metadata() returns the full cached SkillMetadata catalog (name + description), the progressive-disclosure prompt injection uses. Test: crate::skills::tests::fs_skill_resolver_* construct an FsSkillResolver (this trait’s concrete filesystem impl) over a tempdir and assert resolve()/list()/metadata() all agree.

Required Methods§

Source

fn resolve(&self, name: &str) -> Option<String>

Look up a skill by name and return its Markdown content, if found.

Source

fn list(&self) -> Vec<String>

List all discoverable skill names.

Source

fn metadata(&self) -> Vec<SkillMetadata>

Cached metadata (name + description) for every discoverable skill.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§