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.
Auto Trait Implementations§
impl Freeze for SkillConfig
impl RefUnwindSafe for SkillConfig
impl Send for SkillConfig
impl Sync for SkillConfig
impl Unpin for SkillConfig
impl UnsafeUnpin for SkillConfig
impl UnwindSafe for SkillConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more