pub struct Skill {
pub name: String,
pub description: String,
pub system_prompt: String,
pub tools: Vec<String>,
pub allowed_tools: Option<Vec<String>>,
pub denied_tools: Option<Vec<String>>,
pub metadata: HashMap<String, Value>,
}Expand description
A loaded skill definition.
Skills contain:
- A system prompt that defines agent behavior
- Tool configurations (which tools are available/denied)
- Optional metadata for custom extensions
Fields§
§name: StringUnique identifier for the skill.
description: StringHuman-readable description of what the skill does.
system_prompt: StringThe system prompt content (markdown body after frontmatter).
tools: Vec<String>List of tool names that should be enabled for this skill. If empty, all registered tools are available.
allowed_tools: Option<Vec<String>>Optional list of tools explicitly allowed (whitelist). If set, only these tools are available.
denied_tools: Option<Vec<String>>Optional list of tools explicitly denied (blacklist).
These tools will be filtered out even if in tools list.
metadata: HashMap<String, Value>Additional metadata from frontmatter.
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn new(name: impl Into<String>, system_prompt: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, system_prompt: impl Into<String>) -> Self
Create a new skill with the given name and system prompt.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description.
Sourcepub fn with_tools(self, tools: Vec<String>) -> Self
pub fn with_tools(self, tools: Vec<String>) -> Self
Set the list of tools.
Sourcepub fn with_allowed_tools(self, tools: Vec<String>) -> Self
pub fn with_allowed_tools(self, tools: Vec<String>) -> Self
Set the allowed tools whitelist.
Sourcepub fn with_denied_tools(self, tools: Vec<String>) -> Self
pub fn with_denied_tools(self, tools: Vec<String>) -> Self
Set the denied tools blacklist.
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.
Returns true if:
- The tool is not in
denied_tools, AND - Either
allowed_toolsis None, or the tool is inallowed_tools
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 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