pub struct Skill {
pub manifest: SkillManifest,
pub path: PathBuf,
pub scope: SkillScope,
pub instructions: String,
pub variety: SkillVariety,
/* private fields */
}Expand description
Complete skill definition with progressive disclosure levels
Fields§
§manifest: SkillManifestLevel 1: Metadata (~100 tokens, always loaded)
path: PathBufAbsolute path to skill directory
scope: SkillScopeSkill scope (user-level or repo-level)
instructions: StringLevel 2: Instructions from SKILL.md body (<5K tokens, loaded when triggered)
variety: SkillVarietySkill variety
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn new(
manifest: SkillManifest,
path: PathBuf,
instructions: String,
) -> Result<Self>
pub fn new( manifest: SkillManifest, path: PathBuf, instructions: String, ) -> Result<Self>
Create a new skill
Sourcepub fn with_scope(
manifest: SkillManifest,
path: PathBuf,
scope: SkillScope,
instructions: String,
) -> Result<Self>
pub fn with_scope( manifest: SkillManifest, path: PathBuf, scope: SkillScope, instructions: String, ) -> Result<Self>
Create a new skill with explicit scope
Sourcepub fn add_resource(&mut self, path: String, resource: SkillResource)
pub fn add_resource(&mut self, path: String, resource: SkillResource)
Add a resource to the skill
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Get skill’s description
Sourcepub fn has_resource(&self, path: &str) -> bool
pub fn has_resource(&self, path: &str) -> bool
Check if skill has a resource
Sourcepub fn get_resource(&self, path: &str) -> Option<&SkillResource>
pub fn get_resource(&self, path: &str) -> Option<&SkillResource>
Get resource by path
Sourcepub fn list_resources(&self) -> Vec<&str>
pub fn list_resources(&self) -> Vec<&str>
List all available resources
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin 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