1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Ship agent skills inside a Rust binary, and give that binary a
//! `skill install` command.
//!
//! It is the reverse of `gh skill install`. A tool carries its own skills in
//! the executable, and writes them into the directory the user's agent reads
//! from. The agent directories and the flag set are taken from
//! `gh skill install`, so a user who knows that command already knows this one.
//!
//! Skills live under `skills/<name>/SKILL.md`, which is the layout defined by
//! the [Agent Skills specification](https://agentskills.io/specification).
//!
//! ```no_run
//! use std::process::ExitCode;
//! use std::sync::LazyLock;
//!
//! use include_dir::{Dir, include_dir};
//! use skill_embed::{Installer, SkillSet};
//!
//! static SKILLS_DIR: Dir<'static> = include_dir!("$CARGO_MANIFEST_DIR/skills");
//!
//! static SKILLS: LazyLock<Installer> = LazyLock::new(|| {
//! Installer::new(SkillSet::from_include_dir(&SKILLS_DIR).expect("valid skills"))
//! .with_tool_name("mytool")
//! .with_version(env!("CARGO_PKG_VERSION"))
//! });
//!
//! fn main() -> ExitCode {
//! if let Some(code) = SKILLS.intercept() {
//! return code;
//! }
//! // the rest of your tool
//! ExitCode::SUCCESS
//! }
//! ```
//!
//! [`Installer::intercept`] gives a tool the skill subcommand in one line.
//! [`Installer::run`] is for a tool that parses its own arguments, and the
//! `skill-embed-clap` crate wires the same commands into
//! [clap](https://docs.rs/clap).
pub use Action;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Scope;
pub use ;
pub use State;
/// Frontmatter keys written into an installed [`SKILL_FILE`].
///
/// They let a later run tell an outdated copy from one that was edited by hand,
/// and they are namespaced so they never collide with the source tracking keys
/// `gh skill install` writes.