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
Source§fn clone(&self) -> PromptFile
fn clone(&self) -> PromptFile
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 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