Skip to main content

Module skills

Module skills 

Source
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.
SkillDiscovery
Discovers skills from configured directories.
SkillDiscoveryError
Errors that can occur during skill discovery.
SkillMetadata
Metadata parsed from the YAML frontmatter of a SKILL.md file.
SkillRegistry
Thread-safe registry that stores discovered skills.
SkillReloadResult
Result of a skill reload operation.

Functions§

parse_skill_md
Parse a SKILL.md file and extract the metadata from its YAML frontmatter.