pub struct SkillFile {
pub frontmatter: SkillFrontmatter,
pub content: String,
pub path: PathBuf,
pub directory: PathBuf,
pub supporting_files: Vec<SupportingFile>,
}Expand description
Parsed skill file with frontmatter and content.
Fields§
§frontmatter: SkillFrontmatterParsed YAML frontmatter.
content: StringMarkdown content (instructions).
path: PathBufPath to the SKILL.md file.
directory: PathBufDirectory containing the skill.
supporting_files: Vec<SupportingFile>Supporting files discovered in the directory.
Implementations§
Source§impl SkillFile
impl SkillFile
Sourcepub fn parse<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn parse<P: AsRef<Path>>(path: P) -> Result<Self>
Parse a SKILL.md file from the given path.
Sourcepub fn parse_content(content: &str, path: &Path) -> Result<Self>
pub fn parse_content(content: &str, path: &Path) -> Result<Self>
Parse SKILL.md content with path context.
Sourcepub fn parse_content_only(content: &str) -> Result<(SkillFrontmatter, String)>
pub fn parse_content_only(content: &str) -> Result<(SkillFrontmatter, String)>
Parse SKILL.md content without path context (for testing).
Sourcepub fn effective_name(&self) -> String
pub fn effective_name(&self) -> String
Get effective name (from frontmatter or directory name).
Sourcepub fn effective_description(&self) -> String
pub fn effective_description(&self) -> String
Get effective description (from frontmatter or first paragraph).
Sourcepub fn is_tool_allowed(&self, tool_name: &str) -> bool
pub fn is_tool_allowed(&self, tool_name: &str) -> bool
Check if a tool is allowed for this skill.
Supports wildcard patterns with * which matches any characters.
Examples:
Bashmatches exactlyBashBash*matchesBash,Bash(python:test.py), etc.Bash(python:*)matchesBash(python:foo),Bash(python:bar), etc.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SkillFile
impl RefUnwindSafe for SkillFile
impl Send for SkillFile
impl Sync for SkillFile
impl Unpin for SkillFile
impl UnwindSafe for SkillFile
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