pub struct SkillSpecBuilder { /* private fields */ }Expand description
Builder for SkillSpec.
Implementations§
Source§impl SkillSpecBuilder
impl SkillSpecBuilder
Sourcepub fn adopt_unowned(self, adopt: bool) -> Self
pub fn adopt_unowned(self, adopt: bool) -> Self
Adopt a skill directory that exists on disk but has no recorded owner.
See SkillSpec::adopt_unowned.
Sourcepub fn description(self, d: impl Into<String>) -> Self
pub fn description(self, d: impl Into<String>) -> Self
Set the SKILL.md frontmatter description.
Sourcepub fn allowed_tools<I, S>(self, tools: I) -> Self
pub fn allowed_tools<I, S>(self, tools: I) -> Self
Set the SKILL.md frontmatter allowed-tools list (Claude only).
Sourcepub fn asset(self, asset: SkillAsset) -> Self
pub fn asset(self, asset: SkillAsset) -> Self
Add one supporting file.
Sourcepub fn build(self) -> SkillSpec
pub fn build(self) -> SkillSpec
Finalize the spec, panicking on missing or invalid fields.
Convenience wrapper around try_build() for tests
and examples. Production code should prefer try_build()
to propagate errors instead of panicking.
§Panics
Panics if owner or description were never set.
Sourcepub fn try_build(self) -> Result<SkillSpec, AgentConfigError>
pub fn try_build(self) -> Result<SkillSpec, AgentConfigError>
Finalize the spec, returning Result on missing or invalid fields.
This is the recommended way to build a spec in production code. See crate-level documentation for a full example.
§Errors
AgentConfigError::MissingSpecFieldwithfield = "owner"whenSkillSpecBuilder::ownerwas never called,field = "frontmatter.description"when the skill frontmatter description is empty, orfield = "body"when the body is empty.AgentConfigError::InvalidTagwhennameviolates the kebab-case skill-name contract orowner_tagis malformed, or when a frontmatter scalar contains a control character.
Trait Implementations§
Source§impl Clone for SkillSpecBuilder
impl Clone for SkillSpecBuilder
Source§fn clone(&self) -> SkillSpecBuilder
fn clone(&self) -> SkillSpecBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SkillSpecBuilder
impl RefUnwindSafe for SkillSpecBuilder
impl Send for SkillSpecBuilder
impl Sync for SkillSpecBuilder
impl Unpin for SkillSpecBuilder
impl UnsafeUnpin for SkillSpecBuilder
impl UnwindSafe for SkillSpecBuilder
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