pub struct Skill {
pub name: String,
pub metadata: SkillMetadata,
pub body: String,
pub source: PathBuf,
}Expand description
A loaded skill definition.
Skills are markdown files with YAML frontmatter. The body is a
prompt template supporting {{arg}} substitution. Invoke via
/skill-name in the REPL or programmatically via the Skill tool.
Fields§
§name: StringSkill name (derived from filename without extension).
metadata: SkillMetadataMetadata from frontmatter.
body: StringThe prompt template body.
source: PathBufSource file path.
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn expand(&self, args: Option<&str>) -> String
pub fn expand(&self, args: Option<&str>) -> String
Expand the skill body with argument substitution.
Sourcepub fn expand_safe(&self, args: Option<&str>, disable_shell: bool) -> String
pub fn expand_safe(&self, args: Option<&str>, disable_shell: bool) -> String
Expand the skill body, stripping fenced shell blocks if disabled.
When disable_shell is true, any fenced code block with a shell
language tag (sh, bash, shell, zsh) is replaced with
a notice that shell execution is disabled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skill
impl UnwindSafe for Skill
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