pub struct Skill {
pub name: String,
pub description: String,
pub template: String,
pub disable_model_invocation: bool,
pub user_invocable: bool,
pub argument_hint: Option<String>,
pub allowed_tools: Vec<String>,
pub skill_dir: PathBuf,
pub source_path: PathBuf,
}Expand description
A loaded skill parsed from a SKILL.md or legacy .md file.
Fields§
§name: StringCommand name without leading slash, e.g. “commit” or “superpowers:brainstorming”.
description: StringHuman-readable description (frontmatter > first paragraph of template).
template: StringRaw template content (everything after the frontmatter block).
disable_model_invocation: boolIf true, hidden from Claude’s context — user must invoke manually via /name.
user_invocable: boolIf false, hidden from the / menu — Claude can still invoke automatically.
argument_hint: Option<String>Autocomplete hint shown next to the skill name, e.g. “[issue-number]”.
allowed_tools: Vec<String>Tools auto-approved when this skill is active.
skill_dir: PathBufDirectory containing the skill file (used for ${CLAUDE_SKILL_DIR} substitution).
source_path: PathBufSource file path, for diagnostics.
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn expand(&self, arguments: &str, session_id: &str) -> String
pub fn expand(&self, arguments: &str, session_id: &str) -> String
Expand the template, applying all substitutions in order:
$ARGUMENTS[N]→ positional argument by 0-based index$N→ shorthand for$ARGUMENTS[N]$ARGUMENTS→ all arguments (appended asARGUMENTS: …if absent)${CLAUDE_SESSION_ID}→ the provided session id${CLAUDE_SKILL_DIR}→ absolute path of the skill’s directory!`command`→ preprocess: run shell command, insert stdout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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