pub struct SkillConfig {
pub name: String,
pub content: String,
pub version: String,
pub environment: Environment,
}Expand description
Configuration for a skill to be managed.
Fields§
§name: StringThe tool name (e.g., “agent-doc”, “webmaster”).
content: StringThe bundled SKILL.md content (typically from include_str!).
version: StringThe tool version (typically from env!("CARGO_PKG_VERSION")).
environment: EnvironmentThe detected agent environment (used for path resolution).
Implementations§
Source§impl SkillConfig
impl SkillConfig
Sourcepub fn new(
name: impl Into<String>,
content: impl Into<String>,
version: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, content: impl Into<String>, version: impl Into<String>, ) -> Self
Create a new skill config. Create a new skill config, auto-detecting the agent environment.
Sourcepub fn with_environment(
name: impl Into<String>,
content: impl Into<String>,
version: impl Into<String>,
environment: Environment,
) -> Self
pub fn with_environment( name: impl Into<String>, content: impl Into<String>, version: impl Into<String>, environment: Environment, ) -> Self
Create a new skill config with an explicit environment.
Sourcepub fn skill_path(&self, root: Option<&Path>) -> PathBuf
pub fn skill_path(&self, root: Option<&Path>) -> PathBuf
Resolve the skill file path under the given root (or CWD if None). Uses the detected environment to determine the path layout.
Sourcepub fn install(&self, root: Option<&Path>) -> Result<()>
pub fn install(&self, root: Option<&Path>) -> Result<()>
Install the bundled SKILL.md to the project.
When root is None, paths are relative to CWD.
Sourcepub fn check(&self, root: Option<&Path>) -> Result<bool>
pub fn check(&self, root: Option<&Path>) -> Result<bool>
Check if the installed skill matches the bundled version.
When root is None, paths are relative to CWD.
Returns Ok(true) if up to date, Ok(false) if outdated or not installed.
Sourcepub fn install_for(&self, env: Environment, root: Option<&Path>) -> Result<()>
pub fn install_for(&self, env: Environment, root: Option<&Path>) -> Result<()>
Install the skill to a specific environment (overriding auto-detection).