Expand description
Agent Skills support for extended capabilities. Agent Skills support for extended agent capabilities.
This module implements the Agent Skills open format, allowing agents to discover and use skills for extended capabilities.
§Overview
Skills are folders containing a SKILL.md file with YAML frontmatter and
Markdown instructions:
my-skill/
├── SKILL.md # Required: metadata + instructions
├── scripts/ # Optional: executable code
├── references/ # Optional: documentation
└── assets/ # Optional: templates, resources§Usage
ⓘ
use agent_core_runtime::skills::{SkillDiscovery, SkillRegistry};
// Create discovery with default paths
let discovery = SkillDiscovery::new();
// Discover skills
let registry = SkillRegistry::new();
for result in discovery.discover() {
match result {
Ok(skill) => {
println!("Found skill: {}", skill.metadata.name);
registry.register(skill);
}
Err(e) => eprintln!("Error: {}", e),
}
}
// Generate XML for system prompt
let xml = registry.to_prompt_xml();Structs§
- Skill
- A discovered skill with its metadata and file paths.
- Skill
Discovery - Discovers skills from configured directories.
- Skill
Discovery Error - Errors that can occur during skill discovery.
- Skill
Metadata - Metadata parsed from the YAML frontmatter of a SKILL.md file.
- Skill
Registry - Thread-safe registry that stores discovered skills.
- Skill
Reload Result - Result of a skill reload operation.
Functions§
- parse_
skill_ md - Parse a SKILL.md file and extract the metadata from its YAML frontmatter.