pub struct PromptFile {
pub name: String,
pub description: String,
pub body: String,
pub path: PathBuf,
pub user_invocable: bool,
pub agent_invocable: bool,
pub argument_hint: Option<String>,
pub tags: Vec<String>,
pub triggers: PromptTriggers,
pub agent_authored: bool,
pub helpful: u32,
pub harmful: u32,
}Expand description
A resolved skill artifact discovered from a SKILL.md file.
Fields§
§name: String§description: String§body: String§path: PathBuf§user_invocable: bool§agent_invocable: bool§argument_hint: Option<String>§triggers: PromptTriggers§helpful: u32§harmful: u32Implementations§
Source§impl PromptFile
impl PromptFile
Sourcepub fn parse(path: &Path) -> Result<Self, PromptFileError>
pub fn parse(path: &Path) -> Result<Self, PromptFileError>
Parse a prompt file at the given path into a PromptFile.
The name defaults to the parent directory name unless overridden in frontmatter.
Sourcepub fn validate(&self) -> Result<(), PromptFileError>
pub fn validate(&self) -> Result<(), PromptFileError>
Validate this prompt file has a non-empty description and at least one activation surface.
Sourcepub fn write(&self, path: &Path) -> Result<(), PromptFileError>
pub fn write(&self, path: &Path) -> Result<(), PromptFileError>
Write this prompt file to the given path, creating parent directories as needed.
Sourcepub fn confidence(&self) -> f64
pub fn confidence(&self) -> f64
Confidence score based on helpful/harmful ratings.
Trait Implementations§
Source§impl Clone for PromptFile
impl Clone for PromptFile
Auto Trait Implementations§
impl Freeze for PromptFile
impl RefUnwindSafe for PromptFile
impl Send for PromptFile
impl Sync for PromptFile
impl Unpin for PromptFile
impl UnsafeUnpin for PromptFile
impl UnwindSafe for PromptFile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.