talos_skill/lib.rs
1//! SKILL.md parser and loader for Talos agent skills.
2//!
3//! This crate discovers and parses `SKILL.md` files from configured search paths.
4//! Each skill consists of YAML frontmatter (between `---` delimiters) followed by
5//! a Markdown body containing instructions.
6//!
7//! # Discovery Paths
8//!
9//! Skills are discovered from three locations (in priority order):
10//! 1. `.talos/skills/` — project-local skills
11//! 2. `~/.talos/skills/` — user-global skills
12//! 3. Parent directories up to git root — inherited skills
13//!
14//! Directory-link following is controlled by `SkillDiscoveryPolicy`.
15//! By default links are not followed; external targets are denied.
16//! Discovery is bounded by the configured maximum depth and entry budget.
17//!
18//! # SKILL.md Format
19//!
20//! ```markdown
21//! ---
22//! name: my-skill
23//! description: A skill that does something useful
24//! triggers:
25//! - keyword1
26//! - keyword2
27//! ---
28//!
29//! # Instructions
30//!
31//! Detailed markdown instructions go here...
32//! ```
33
34mod error;
35mod loader;
36mod manager;
37mod parser;
38mod token;
39mod types;
40
41pub use error::{Result, SkillError};
42pub use loader::{
43 ExternalTargetPolicy, SkillDiscoveryPolicy, SkillDiscoveryWarning, SkillDiscoveryWarningKind,
44 SkillLoader,
45};
46pub use manager::SkillManager;
47pub use token::estimate_tokens;
48pub use types::{Skill, SkillDisclosure, SkillFrontmatter, SkillIndex, SkillSource};
49
50#[cfg(test)]
51#[allow(warnings)]
52mod tests;