Skip to main content

SkillSpecBuilder

Struct SkillSpecBuilder 

Source
pub struct SkillSpecBuilder { /* private fields */ }
Expand description

Builder for SkillSpec.

Implementations§

Source§

impl SkillSpecBuilder

Source

pub fn owner(self, tag: impl Into<String>) -> Self

Set the consumer’s owner tag.

Source

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.

Source

pub fn description(self, d: impl Into<String>) -> Self

Set the SKILL.md frontmatter description.

Source

pub fn when_to_use(self, value: impl Into<String>) -> Self

Set the SKILL.md frontmatter when_to_use field.

Source

pub fn argument_hint(self, value: impl Into<String>) -> Self

Set the SKILL.md frontmatter argument-hint field.

Source

pub fn arguments<I, S>(self, arguments: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the SKILL.md frontmatter arguments list.

Source

pub fn disable_model_invocation(self, disable: bool) -> Self

Set the SKILL.md frontmatter disable-model-invocation field.

Source

pub fn user_invocable(self, invocable: bool) -> Self

Set the SKILL.md frontmatter user-invocable field.

Source

pub fn allowed_tools<I, S>(self, tools: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the SKILL.md frontmatter allowed-tools list (Claude only).

Source

pub fn disallowed_tools<I, S>(self, tools: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the SKILL.md frontmatter disallowed-tools list.

Source

pub fn model(self, model: impl Into<String>) -> Self

Set the SKILL.md frontmatter model override.

Source

pub fn effort(self, effort: SkillEffort) -> Self

Set the SKILL.md frontmatter effort override.

Source

pub fn context(self, context: SkillContext) -> Self

Set the SKILL.md frontmatter context mode.

Source

pub fn agent(self, agent: impl Into<String>) -> Self

Set the SKILL.md frontmatter agent field.

Source

pub fn paths<I, S>(self, paths: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the SKILL.md frontmatter paths list.

Source

pub fn shell(self, shell: SkillShell) -> Self

Set the SKILL.md frontmatter shell override.

Source

pub fn body(self, body: impl Into<String>) -> Self

Set the markdown body of SKILL.md.

Source

pub fn asset(self, asset: SkillAsset) -> Self

Add one supporting file.

Source

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.

Source

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

Trait Implementations§

Source§

impl Clone for SkillSpecBuilder

Source§

fn clone(&self) -> SkillSpecBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SkillSpecBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.