Skip to main content

SkillEntry

Struct SkillEntry 

Source
pub struct SkillEntry {
Show 21 fields pub name: String, pub description: String, pub when_to_use: Option<String>, pub source: SkillSource, pub tier: Option<SkillTier>, pub path: PathBuf, pub argument_hint: Option<String>, pub allowed_tools: Option<Vec<String>>, pub disallowed_tools: Option<Vec<String>>, pub arguments: Option<Vec<String>>, pub model: Option<String>, pub effort: Option<String>, pub context: Option<String>, pub agent: Option<String>, pub background: Option<bool>, pub disable_model_invocation: bool, pub user_invocable: bool, pub paths: Option<Vec<String>>, pub version: Option<String>, pub files: Option<Vec<String>>, pub hooks: Option<Vec<String>>,
}
Expand description

单个 Skill:从 <dir>/<skill_name>/SKILL.md 的 YAML frontmatter 抽出。

Fields§

§name: String

目录名(如 summarize-pr);当 frontmatter 给 name 时取 frontmatter 值

§description: String

frontmatter description;不存在则取 markdown 第一行

§when_to_use: Option<String>

frontmatter when_to_use;可选

§source: SkillSource§tier: Option<SkillTier>

Which user-level directory a User skill was read from.

§path: PathBuf

SKILL.md 的物理路径(用于 /skills 命令展示)

§argument_hint: Option<String>

Hint shown to user for arguments (e.g. “commit message”)

§allowed_tools: Option<Vec<String>>

Restrict tools this skill can invoke (whitelist of tool names)

§disallowed_tools: Option<Vec<String>>

Tools removed from the pool while this skill is active (denylist, applied before allowed_tools). Clears on the next user message, same lifecycle as allowed_tools.

§arguments: Option<Vec<String>>

Named positional arguments (arguments: [issue, branch]) for $name substitution in the skill body, in addition to the existing positional $1..$9/$ARGUMENTS forms.

§model: Option<String>

Override model for this skill

§effort: Option<String>

Effort/thinking-mode override while this skill is active. Maps onto base::interface::model::ThinkingMode — Agix has no separate “effort” axis, so this is not a new concept, just this field’s name.

§context: Option<String>

Execution context: “fork” (sub-agent) or “inline” (default)

§agent: Option<String>

Which agent type to run as when context: "fork" is set. Defaults to general-purpose when unset.

§background: Option<bool>

Only meaningful with context: "fork". false waits for the forked result in the invoking turn instead of running it in the background. Default: true (background).

§disable_model_invocation: bool

If true, model cannot invoke this skill directly (only user via slash)

§user_invocable: bool

If false, skill is hidden from user-facing slash command list

§paths: Option<Vec<String>>

Glob patterns for conditional activation (auto-load when matching files are touched)

§version: Option<String>

Version string for the skill

§files: Option<Vec<String>>

Reference files bundled with the skill. Each entry is a path relative to the skill directory. When the skill is invoked, these files are read and their content is injected into the skill context.

§hooks: Option<Vec<String>>

Hook event names this skill subscribes to. When the skill is loaded, these hooks are registered with the HookRunner.

Implementations§

Source§

impl SkillEntry

Source

pub fn resolve_bundled_files(&self) -> Vec<PathBuf>

Resolves self.files (paths relative to the skill’s folder) to absolute paths. self.path is the SKILL.md file itself, so the skill folder is self.path.parent(). Returns an empty Vec if files is None/empty.

Purely mechanical path joining — no existence checks or traversal/symlink-escape validation happen here. Callers that need those (e.g. SkillTool, which must surface a visible error for any declared file that escapes the skill folder) run them separately via permissions::path_safety, which this core crate deliberately does not depend on.

Trait Implementations§

Source§

impl Clone for SkillEntry

Source§

fn clone(&self) -> Self

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 SkillEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for SkillEntry

Source§

fn default() -> Self

Returns the “default value” for a type. 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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more