Skip to main content

adk_skill/
lib.rs

1//! `adk-skill` is the engine for specification-driven agent skills in the Zenith ecosystem.
2//!
3//! It implements the `agentskills.io` standard, allowing developers to define agent personalities,
4//! capabilities, and tool permissions in structured Markdown files.
5//!
6//! # Key Features
7//! - **Discovery**: Recursively scans the workspace for `.skill.md` and `skill.md` files.
8//! - **Specification First**: Parses frontmatter for metadata, tool permissions, and external references.
9//! - **Dynamic Tooling**: Provides the metadata needed for agents to configure their own toolsets at runtime.
10//! - **Versioning & Hashing**: Content-based unique identifiers for reliable persona selection.
11//!
12//! # Example
13//! Skills are defined in Markdown with YAML frontmatter:
14//! ```markdown
15//! ---
16//! name: search-expert
17//! description: Expert in semantic and keyword search.
18//! allowed-tools:
19//!   - knowledge
20//!   - web_search
21//! ---
22//! Use tools to find information...
23//! ```
24
25#![doc = include_str!("../README.md")]
26
27mod coordinator;
28mod discovery;
29mod error;
30mod index;
31mod injector;
32mod model;
33mod parser;
34mod select;
35
36pub use coordinator::{
37    ContextCoordinator, CoordinatorConfig, ResolutionStrategy, SkillContext, ToolRegistry,
38    ValidationMode,
39};
40pub use discovery::{
41    discover_instruction_files, discover_instruction_files_with_extras, discover_skill_files,
42    discover_skill_files_with_extras,
43};
44pub use error::{SkillError, SkillResult};
45pub use index::{load_skill_index, load_skill_index_with_extras};
46pub use injector::{
47    SkillInjector, SkillInjectorConfig, apply_skill_injection, select_skill_prompt_block,
48};
49pub use model::{
50    ParsedSkill, SelectionPolicy, SkillDocument, SkillFrontmatter, SkillIndex, SkillMatch,
51    SkillSummary,
52};
53pub use parser::{parse_instruction_markdown, parse_skill_markdown};
54pub use select::select_skills;