skills_ref/lib.rs
1//! # skills-ref-rs
2//!
3//! Rust implementation of the agentskills library for validating, parsing,
4//! and managing Agent Skills - structured markdown documents that describe
5//! capabilities available to AI assistants.
6//!
7//! ## Core Functionality
8//!
9//! 1. **Validate** - Check that a skill directory contains a valid SKILL.md
10//! 2. **Read Properties** - Parse SKILL.md frontmatter and extract metadata as JSON
11//! 3. **To Prompt** - Generate XML blocks for embedding skill information in agent prompts
12//!
13//! ## Example
14//!
15//! ```no_run
16//! use skills_ref::{read_properties, validate, to_prompt};
17//! use std::path::Path;
18//!
19//! // Validate a skill directory
20//! let errors = validate(Path::new("my-skill"));
21//! if errors.is_empty() {
22//! println!("Skill is valid!");
23//! }
24//!
25//! // Read skill properties
26//! let props = read_properties(Path::new("my-skill")).unwrap();
27//! println!("Skill name: {}", props.name);
28//!
29//! // Generate XML prompt
30//! let xml = to_prompt(&[Path::new("my-skill")]).unwrap();
31//! println!("{}", xml);
32//! ```
33
34pub mod error;
35pub mod models;
36pub mod parser;
37pub mod prompt;
38pub mod validator;
39
40// Re-export main types and functions for convenience
41pub use error::{Result, SkillError};
42pub use models::SkillProperties;
43pub use parser::{find_skill_md, parse_frontmatter, read_properties};
44pub use prompt::to_prompt;
45pub use validator::{validate, validate_metadata};