include_skill!() { /* proc-macro */ }Expand description
Embeds an AgentSkill directory into the binary at compile time.
Reads the SKILL.md file from the given path (relative to the crate root),
validates its frontmatter structure, and returns an AgentSkillDef value
that can be passed to AgentBuilder::with_skill_def.
Because include_str! is used internally, the SKILL.md content is compiled
into the binary — no filesystem I/O happens at runtime, and this works on
WASM targets.
§Panics (at startup, not compile time)
If the embedded SKILL.md fails full validation (e.g. the name field is
invalid), the process will panic at startup with a clear message.
§Compile errors
SKILL.mddoes not exist at the given pathSKILL.mddoes not begin with---SKILL.mdfrontmatter is not closed with---
§Examples
ⓘ
use radkit::{agent::Agent, include_skill};
let agent = Agent::builder()
.with_name("My Agent")
.with_skill_def(include_skill!("./skills/pdf-processing"))
.build();