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>,
}skills only.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. If non-empty, it acts as a
whitelist: only the listed tools (unioned with allowed_tools, and minus
denied_tools) are available. See Skill::is_tool_allowed.
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.
Resolution order:
- If the tool is in
denied_tools, it is denied (highest precedence). - Otherwise, if any whitelist is configured — either
allowed_toolsor a non-emptytoolslist — the tool must appear in the union of those lists. A non-emptytoolslist therefore restricts access, matching the documented skill-file format (tools: [read, grep]). - If no whitelist is configured at all, the tool is allowed.