pub trait SkillSource: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SkillSummary>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Skill>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A pluggable backend that can enumerate and load skills.
Implementations must be cheap to list — the CLI calls list on
every invocation of devboy skills list. load is allowed to be
heavier (opening files, issuing network calls) because it is only
called on explicit install / show.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Short identifier for this source (“embedded”, “marketplace”, …).
Used in error messages and in devboy skills list --source ….
Sourcefn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SkillSummary>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<SkillSummary>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all skills known to this source. Order is source-defined; callers should sort if they need a deterministic display.
Sourcefn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Skill>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Skill>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the full Skill (frontmatter + body) for the named skill.
Returns crate::error::SkillError::NotFound if the source does
not know about name.