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 Forget for Skill
impl Freeze for Skillwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<(String, Value)>: Freeze,
PhantomData<String>: Freeze,
*const SkillNetworkPolicy is !null: Freeze,
PhantomData<SkillNetworkPolicy>: Freeze,
*const SkillPermissionProfile is !null: Freeze,
PhantomData<SkillPermissionProfile>: Freeze,
PhantomData<(String, SkillResource)>: Freeze,
impl Move for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skillwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<(String, Value)>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const SkillNetworkPolicy is !null: UnsafeUnpin,
PhantomData<SkillNetworkPolicy>: UnsafeUnpin,
*const SkillPermissionProfile is !null: UnsafeUnpin,
PhantomData<SkillPermissionProfile>: UnsafeUnpin,
PhantomData<(String, SkillResource)>: UnsafeUnpin,
impl UnwindSafe for Skillwhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
NonNull<u8>: UnwindSafe,
BoxRaw<SkillNetworkPolicy>: UnwindSafe,
BoxRaw<SkillPermissionProfile>: UnwindSafe,
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