Skip to main content

include_skill

Macro include_skill 

Source
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.md does not exist at the given path
  • SKILL.md does not begin with ---
  • SKILL.md frontmatter 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();