Skip to main content

Skill

Trait Skill 

Source
pub trait Skill: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn version(&self) -> &str;
    fn variables(&self) -> HashMap<String, String>;
    fn allowed_tools(&self) -> Vec<String>;
    fn instructions(&self) -> &str;
    fn is_user_invocable(&self) -> bool;
    fn execute_tool<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        tool_name: &'life1 str,
        params: Value,
        ctx: &'life2 dyn ToolContext,
    ) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A skill is a high-level agent capability composed of tools, instructions, and configuration.

Skills are the primary unit of agent customization. They can be loaded from SKILL.md files, bundled with plugins, or auto-generated. Skills can contribute tools that appear in MCP tools/list and can be invoked via slash commands.

Required Methods§

Source

fn name(&self) -> &str

Skill name (e.g., "code-review", "git-commit").

Source

fn description(&self) -> &str

Human-readable description.

Source

fn version(&self) -> &str

Semantic version string.

Source

fn variables(&self) -> HashMap<String, String>

Template variables the skill accepts (name -> description).

Source

fn allowed_tools(&self) -> Vec<String>

Tool names this skill is allowed to invoke.

Source

fn instructions(&self) -> &str

System instructions injected when the skill is active.

Source

fn is_user_invocable(&self) -> bool

Whether this skill can be invoked directly by users (e.g., via /command).

Source

fn execute_tool<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, tool_name: &'life1 str, params: Value, ctx: &'life2 dyn ToolContext, ) -> Pin<Box<dyn Future<Output = Result<Value, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a tool provided by this skill.

tool_name is the specific tool within this skill to call. params is a JSON object of tool parameters. ctx is the execution context providing key-value store access.

Implementors§