pub struct SkillPlugin { /* private fields */ }Expand description
A skill-only plugin that injects custom skills into the session’s skill registry without registering any tools.
This is the primary way to add custom LLM guidance from Python or Node.js without writing Rust. Provide skill YAML/markdown content strings and they will appear in the system prompt automatically.
§Example
ⓘ
let plugin = SkillPlugin::new("my-plugin")
.with_skill(r#"---
name: my-skill
description: Use bash when running shell commands
allowed-tools: "bash(*)"
kind: instruction
---
Always explain what command you're about to run before executing it."#);
let opts = SessionOptions::new().with_plugin(plugin);Implementations§
Source§impl SkillPlugin
impl SkillPlugin
pub fn new(name: impl Into<String>) -> Self
pub fn with_skill(self, content: impl Into<String>) -> Self
pub fn with_skills( self, contents: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Trait Implementations§
Source§impl Plugin for SkillPlugin
impl Plugin for SkillPlugin
Source§fn tool_names(&self) -> &[&str]
fn tool_names(&self) -> &[&str]
Names of all tools this plugin registers. Read more
Source§fn load(
&self,
_registry: &Arc<ToolRegistry>,
_ctx: &PluginContext,
) -> Result<()>
fn load( &self, _registry: &Arc<ToolRegistry>, _ctx: &PluginContext, ) -> Result<()>
Register this plugin’s tools into
registry. Read moreSource§fn unload(&self, registry: &Arc<ToolRegistry>)
fn unload(&self, registry: &Arc<ToolRegistry>)
Remove this plugin’s tools from
registry. Read moreSource§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown in plugin listings.
Auto Trait Implementations§
impl Freeze for SkillPlugin
impl RefUnwindSafe for SkillPlugin
impl Send for SkillPlugin
impl Sync for SkillPlugin
impl Unpin for SkillPlugin
impl UnsafeUnpin for SkillPlugin
impl UnwindSafe for SkillPlugin
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