pub struct Skill {
pub name: String,
pub description: String,
pub instructions: String,
pub resources: HashMap<String, String>,
pub scripts: Vec<SkillScript>,
pub path: Option<PathBuf>,
pub license: Option<String>,
pub compatibility: Option<String>,
pub allowed_tools: Option<String>,
pub metadata: BTreeMap<String, String>,
}Expand description
A named, progressive-disclosure capability package.
descriptionis short and always visible to the model (viaSkillsProvider’s catalog), so the model can judge relevance without paying for the full detail.instructionsis the full guidance for actually using the skill; revealed only after the model callsload_skill(or if the skill was already loaded on a previous turn of the sameSkillsProvider).resourcesare additional named text blobs (reference docs, examples, schemas, …) revealed individually viaread_skill_resource, so a skill can carry more detail than is worth inlining intoinstructionsup front.
Fields§
§name: String§description: String§instructions: String§resources: HashMap<String, String>§scripts: Vec<SkillScript>Scripts the model can run with run_skill_script.
path: Option<PathBuf>The directory a file-based skill was loaded from.
license: Option<String>A license name or reference (frontmatter license).
compatibility: Option<String>Compatibility notes (frontmatter compatibility).
allowed_tools: Option<String>Space-delimited pre-approved tool names (frontmatter allowed-tools).
metadata: BTreeMap<String, String>Free-form string metadata (frontmatter metadata).
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Skill
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Skill
A new skill with an empty instructions body and no resources.
Sourcepub fn with_script(self, script: SkillScript) -> Skill
pub fn with_script(self, script: SkillScript) -> Skill
Builder: attach a script (replacing one with the same name, case-insensitively).
Sourcepub fn script(&self, name: &str) -> Option<&SkillScript>
pub fn script(&self, name: &str) -> Option<&SkillScript>
The script named name, matched case-insensitively.
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Skill
pub fn with_instructions(self, instructions: impl Into<String>) -> Skill
Builder: set the skill’s full instructions (revealed on load_skill).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Skill
impl !UnwindSafe for Skill
impl Freeze for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin 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