pub struct SkillDescriptor {
pub name: String,
pub description: String,
pub location: PathBuf,
pub license: Option<String>,
pub compatibility: Option<String>,
pub metadata: HashMap<String, String>,
pub allowed_tools: Vec<String>,
pub shell: Option<String>,
pub paths: Vec<String>,
pub hooks: Option<HooksDefinition>,
}Expand description
Lightweight skill metadata loaded at discovery time (Tier 1).
Aligned with the agentskills.io specification.
Only name and description are required; all other fields are optional.
At session startup the agent builds a catalog from all discovered descriptors and injects it into the system prompt. Each descriptor costs ~50-100 tokens, so even dozens of skills keep the base context small.
Fields§
§name: StringUnique skill name (kebab-case: lowercase, hyphens, 1-64 chars). Must match the parent directory name per spec.
description: StringHuman-readable description (max 1024 chars). Should describe what the skill does and when to use it.
location: PathBufAbsolute path to the SKILL.md file.
license: Option<String>SPDX license identifier or reference to a bundled license file.
compatibility: Option<String>Environment requirements (intended product, system packages, etc.).
metadata: HashMap<String, String>Arbitrary key-value metadata (author, version, tags, etc.).
allowed_tools: Vec<String>Pre-approved tools the skill may use (space-delimited in SKILL.md).
shell: Option<String>Preferred shell for inline commands: "bash" (default) or "powershell".
paths: Vec<String>File path patterns for conditional activation.
When set, the skill is only surfaced/activated when the user touches
a file matching one of these glob patterns (e.g., ["*.py", "tests/**"]).
hooks: Option<HooksDefinition>Hooks for intercepting tool calls.
Implementations§
Source§impl SkillDescriptor
impl SkillDescriptor
Sourcepub fn catalog_line(&self) -> String
pub fn catalog_line(&self) -> String
Generate a single catalog line for system-prompt injection.
Format: - <name>: <description> (with optional path constraints)
Sourcepub fn validate_name(&self) -> Vec<String>
pub fn validate_name(&self) -> Vec<String>
Validate the name according to the agentskills.io spec. Returns a list of warnings (empty = valid).
Sourcepub fn validate_paths(&self) -> Vec<String>
pub fn validate_paths(&self) -> Vec<String>
Validate glob patterns in paths field.
Returns a list of warnings for invalid or suspicious patterns.
Sourcepub fn matches_context_path(&self, context_path: &str) -> bool
pub fn matches_context_path(&self, context_path: &str) -> bool
Check whether a touched file path satisfies this skill’s conditional activation rules.
Skills without paths are always considered a match.
Sourcepub fn permits_tool(&self, tool_name: &str) -> bool
pub fn permits_tool(&self, tool_name: &str) -> bool
Check whether the descriptor permits use of a given tool name.
Empty allowed_tools means unrestricted. Match semantics mirror hook/tool
matching so exact names, globs, and Bash -> Bash(git:*) prefix variants
behave consistently.
Trait Implementations§
Source§impl Clone for SkillDescriptor
impl Clone for SkillDescriptor
Source§fn clone(&self) -> SkillDescriptor
fn clone(&self) -> SkillDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SkillDescriptor
impl Debug for SkillDescriptor
Source§impl<'de> Deserialize<'de> for SkillDescriptor
impl<'de> Deserialize<'de> for SkillDescriptor
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkillDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SkillDescriptor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for SkillDescriptor
impl Serialize for SkillDescriptor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for SkillDescriptor
impl RefUnwindSafe for SkillDescriptor
impl Send for SkillDescriptor
impl Sync for SkillDescriptor
impl Unpin for SkillDescriptor
impl UnsafeUnpin for SkillDescriptor
impl UnwindSafe for SkillDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request