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 when_to_use(self, value: impl Into<String>) -> Self
pub fn when_to_use(self, value: impl Into<String>) -> Self
Set the SKILL.md frontmatter when_to_use field.
Sourcepub fn argument_hint(self, value: impl Into<String>) -> Self
pub fn argument_hint(self, value: impl Into<String>) -> Self
Set the SKILL.md frontmatter argument-hint field.
Sourcepub fn arguments<I, S>(self, arguments: I) -> Self
pub fn arguments<I, S>(self, arguments: I) -> Self
Set the SKILL.md frontmatter arguments list.
Sourcepub fn disable_model_invocation(self, disable: bool) -> Self
pub fn disable_model_invocation(self, disable: bool) -> Self
Set the SKILL.md frontmatter disable-model-invocation field.
Sourcepub fn user_invocable(self, invocable: bool) -> Self
pub fn user_invocable(self, invocable: bool) -> Self
Set the SKILL.md frontmatter user-invocable field.
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 disallowed_tools<I, S>(self, tools: I) -> Self
pub fn disallowed_tools<I, S>(self, tools: I) -> Self
Set the SKILL.md frontmatter disallowed-tools list.
Sourcepub fn model(self, model: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
Set the SKILL.md frontmatter model override.
Sourcepub fn effort(self, effort: SkillEffort) -> Self
pub fn effort(self, effort: SkillEffort) -> Self
Set the SKILL.md frontmatter effort override.
Sourcepub fn context(self, context: SkillContext) -> Self
pub fn context(self, context: SkillContext) -> Self
Set the SKILL.md frontmatter context mode.
Sourcepub fn shell(self, shell: SkillShell) -> Self
pub fn shell(self, shell: SkillShell) -> Self
Set the SKILL.md frontmatter shell override.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more