pub struct SkillDraft {
pub name: String,
pub description: String,
pub body: String,
pub source_situation: String,
pub metadata: BTreeMap<String, Value>,
}Expand description
A drafted, not-yet-persisted skill.
Guaranteed by construction to pass harness_context::skills::validate and to produce
no Error/Warning lint findings — SkillDistiller::distill refuses to
return one that doesn’t.
Fields§
§name: Stringagentskills.io-legal name; also the directory name it must be written to.
description: StringOne-line description carrying a routing cue.
body: StringMarkdown body — no frontmatter.
source_situation: StringThe episode situation this was distilled from, kept for provenance and for a human reviewing the draft.
metadata: BTreeMap<String, Value>Frontmatter metadata, pre-stamped with the revision ledger at 0.
Implementations§
Source§impl SkillDraft
impl SkillDraft
pub fn manifest(&self) -> SkillManifest
Sourcepub fn to_skill_md(&self) -> String
pub fn to_skill_md(&self) -> String
The full SKILL.md text: frontmatter + body.
Sourcepub fn validate(&self) -> Result<(), DistillError>
pub fn validate(&self) -> Result<(), DistillError>
Re-check the draft against harness_context::skills’ validator and linter.
Sourcepub fn write_to(&self, skills_root: &Path) -> Result<PathBuf, SkillError>
pub fn write_to(&self, skills_root: &Path) -> Result<PathBuf, SkillError>
Opt-in persistence: write <skills_root>/<name>/SKILL.md.
Delegates to harness_context::skills::write_skill_md, which validates by loading
the file back and rolls the write back if it doesn’t load — so a bad
draft cannot leave a broken skill behind.
Trait Implementations§
Source§impl Clone for SkillDraft
impl Clone for SkillDraft
Source§fn clone(&self) -> SkillDraft
fn clone(&self) -> SkillDraft
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more