pub struct Skill {
pub name: String,
pub description: String,
pub allowed_tools: Option<String>,
pub disable_model_invocation: bool,
pub kind: SkillKind,
pub content: String,
pub tags: Vec<String>,
pub version: Option<String>,
}Expand description
Skill definition (Claude Code compatible)
Represents a skill loaded from a Markdown file with YAML frontmatter.
Fields§
§name: StringSkill name (from frontmatter or filename)
description: StringSkill description
allowed_tools: Option<String>Allowed tools (Claude Code format: “Bash(pattern:), read()”)
disable_model_invocation: boolWhether to disable model invocation
kind: SkillKindSkill kind (instruction, tool, or agent)
content: StringSkill content (markdown instructions)
Optional tags for categorization
version: Option<String>Optional version
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn parse(content: &str) -> Option<Self>
pub fn parse(content: &str) -> Option<Self>
Parse a skill from markdown content
Expected format:
---
name: skill-name
description: What it does
allowed-tools: "read(*), grep(*)"
---
# Instructions
...Sourcepub fn parse_allowed_tools(&self) -> HashSet<ToolPermission>
pub fn parse_allowed_tools(&self) -> HashSet<ToolPermission>
Parse allowed tools into a set of tool permissions
Claude Code format: “Bash(gh issue view:), Bash(gh search:)” Returns patterns like: [“Bash:gh issue view:”, “Bash:gh search:”]
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 by this skill
Sourcepub fn to_system_prompt(&self) -> String
pub fn to_system_prompt(&self) -> String
Get the skill content formatted for injection into system prompt
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Skill
impl<'de> Deserialize<'de> for Skill
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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