pub struct LoopSkill {
pub name: String,
pub description: Option<String>,
pub version: Option<String>,
pub scope: SkillScope,
pub dir: PathBuf,
pub manifest: PathBuf,
pub model_invocable: bool,
pub allowed_tools: Vec<String>,
pub argument_names: Vec<String>,
pub argument_hint: Option<String>,
}Expand description
One SKILL.md package the supercode loop itself will load.
Fields§
§name: StringThe name the loop invokes it by — frontmatter name (else the
directory name), qualified plugin:skill / dir:skill where the
source harness qualifies it.
description: Option<String>Frontmatter description, one line. The INDEX line’s whole payload;
a skill without one is still invocable, just undescribed.
version: Option<String>Frontmatter version.
scope: SkillScopePrecedence class of the root it came from.
dir: PathBufThe skill’s own directory.
manifest: PathBuf<dir>/SKILL.md — where the BODY lives, read only on invocation.
model_invocable: boolWhether the model may see it in the prompt index at all. false for
enabled: false / disable-model-invocation: true frontmatter: the
skill stays user-invocable by name, it is simply not advertised
(cc§7 “Invocation control”, pi§2).
allowed_tools: Vec<String>BP-5 (cc§7 “Invocation control”: “pre-approved tools while active”):
the package’s own allowed-tools frontmatter, verbatim. Its only
consumer is ShellInjection::expand, where it pre-approves this
body’s OWN !`cmd` commands and nothing else — it never widens
what the model’s tool calls are allowed to do.
argument_names: Vec<String>BP-5 (cc§7 “Skill frontmatter”: arguments (named positional)): the
package’s ARGUMENT SCHEMA — the names its body substitutes as
$name, in positional order. Empty when the body only uses
$ARGUMENTS/$1..$9.
argument_hint: Option<String>BP-5 (cc§7 argument-hint): the one-line usage hint shown beside
this package in the prompt index, so a model calling it by name knows
what the trailing text should be.
Implementations§
Source§impl LoopSkill
impl LoopSkill
Sourcepub fn index_line(&self) -> String
pub fn index_line(&self) -> String
The prompt-index line: name and description only — never the body.
Sourcepub fn body(&self, arguments: &str) -> Result<String, Error>
pub fn body(&self, arguments: &str) -> Result<String, Error>
Read this skill’s BODY (everything after the frontmatter fence),
substituting $ARGUMENTS / $1..$9 with the invocation’s trailing
text. This is the ONLY function that spends a body’s tokens; nothing
on the discovery path reads past the frontmatter.
Sourcepub fn body_with_shell(
&self,
arguments: &str,
shell: &ShellInjection,
) -> Result<String, Error>
pub fn body_with_shell( &self, arguments: &str, shell: &ShellInjection, ) -> Result<String, Error>
BP-5: Self::body, then the !`cmd` expansion shell
authorizes (cc§7 “Dynamic context injection”). This is the door every
invocation surface uses — the skill tool, /name, /skill:name
and $slug — so one body cannot mean two things depending on which
door loaded it. With shell injection off (the default) this is
exactly Self::body.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoopSkill
impl<'de> Deserialize<'de> for LoopSkill
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoopSkill, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoopSkill, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for LoopSkill
Source§impl Serialize for LoopSkill
impl Serialize for LoopSkill
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for LoopSkill
Auto Trait Implementations§
impl Freeze for LoopSkill
impl RefUnwindSafe for LoopSkill
impl Send for LoopSkill
impl Sync for LoopSkill
impl Unpin for LoopSkill
impl UnsafeUnpin for LoopSkill
impl UnwindSafe for LoopSkill
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.