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: Stringfrontmatter 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: PathBufSKILL.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: boolIf true, model cannot invoke this skill directly (only user via slash)
user_invocable: boolIf 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
impl SkillEntry
Sourcepub fn resolve_bundled_files(&self) -> Vec<PathBuf>
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.