Expand description
Public types, SKILL.md parse, discovery, and activation selector.
DiscoveryOptions::default sets implicit_roots: true so
discover walks cwd-to-git .agents / vendor trees and
$HOME/.agents / vendor trees.
CLI --no-implicit-roots and MCP implicit_roots: false turn that
walk off; extra paths and user_skills_dir still load.
SkillMiss peels error_kind, error, and path so a leftover-only
host can branch without scraping Display. unknown_skill omits path.
A name_collision skip also peels winner_path. Other misses omit it.
List JSON, why JSON, and list XML share SkillSummary
(description, invocation flags, argument_hint, when_to_use,
triggers, allowed_tools, license, compatibility, metadata).
A new field on that type must land in all three wires
(skill_summary_json_keys_have_list_xml_siblings). Catalog stays cheap
and omits disable_model_invocation (official client-guide). JSON, XML,
and TSV still list those rows.
format_load_message is the text envelope (License,
Compatibility, Metadata, Allowed tools, and host extras
when set). format_load_view can print an outline or one
heading section of that same SKILL.md body instead of the
whole body. It does not dump scripts/ or references/.
validate_path_with_options accepts a SKILL.md file or package directory
(joins SKILL.md / skill.md). Success is ValidationReport
(no error_kind). A miss is ValidationReport::miss. CLI
validate --json and MCP skills_validate share that report.
format_skip_tsv is the skip TSV source (skip\tkind\tpath\tdetail)
for CLI list stderr, CLI why stdout, and MCP catalog/xml text.
format_list_tsv is default list TSV. format_why_text is CLI
why text and MCP skills_why format=text (loaded rows, skip TSV,
activation). format_watch_dirs is CLI list --watch-dirs and
MCP skills_list format=watch. Do not inline those rows on a new
text surface.
Re-exports§
pub use discover::CURSOR_VENDOR_DENYLIST;pub use discover::DiscoveryOptions;pub use discover::ValidationReport;pub use discover::discover;pub use discover::find_skill_by_name;pub use discover::format_watch_dirs;pub use discover::validate_path;pub use discover::validate_path_with_options;pub use discover::walk_cwd_to_git_root;pub use discover::watch_dirs;
Structs§
- Activation
Decision - One activation decision for
why. - Discovery
Options - Options for multi-root skill discovery.
- Discovery
Report - Result of multi-root skill discovery, including skips for
why. - Format
Options - Host-supplied strings used when formatting catalog and load text.
- Progressive
Budgets - Catalog and auto-body budgets derived from the model context window.
- Skill
- A parsed skill loaded from a SKILL.md file.
- Skill
Miss - Host-branchable load / why miss. Display is the one-line text.
- Skill
Outline - Section keys and token costs for a SKILL.md body.
- Skill
Section - One heading (or the preamble) plus the text until the next heading.
- Skill
Section Meta - One outline row.
- Skill
Skip - A skill package that discovery found but did not load.
- Skill
Summary - Loaded skill row for
why. - Validation
Report - Result of validating one SKILL.md path.
- WhyReport
- Doctor report: loaded, skipped, and activation decisions.
Enums§
- Activation
Reason - Why a loaded skill was or was not auto-injected.
- Error
- Crate-level error. Discovery IO variants land with the discovery slice.
- Host
Token Field - Which host field produced a refused token. Recorded at construction so miss peel does not grep error prose.
- List
Format - Accepted
list --format/ MCPskills_listformattoken. - Load
View - Which SKILL.md body to print after the load envelope.
- Parse
Error - Frontmatter or agentskills field failure.
- Skill
Source - Where a skill was loaded from.
- Skip
Kind - Why a candidate
SKILL.mdwas not loaded.
Constants§
- CHARS_
PER_ TOKEN - Cheap heuristic used by agentskills-core
estimate_tokens. - CURSOR_
VENDOR_ DENYLIST - Cursor vendor-shipped skill names never injected from
.cursorroots. Silent in v1 (no skip row). - DEFAULT_
ACTIVATE_ HINT - Host-neutral wording for how to load one full skill body.
- SKILL_
BODY_ LINE_ SOFT_ WARN - Soft warn threshold: agentskills recommends keeping SKILL.md under ~500 lines.
- SKILL_
COMPATIBILITY_ MAX_ CHARS - agentskills.io: compatibility max length.
- SKILL_
DESCRIPTION_ MAX_ CHARS - agentskills.io: description max length.
- SKILL_
MD_ MAX_ BYTES - Hard cap on SKILL.md bytes for discover and validate. Prevents unbounded reads.
- SKILL_
NAME_ MAX_ CHARS - agentskills.io: name max length.
- UNKNOWN_
SKILL_ KIND - Wire name when
load/whymatched no skill and no skip. - WHOLE_
BODY_ CHEAPER_ TOKENS - Below this, outline-then-section costs more than the whole body.
Functions§
- discover
- Discover skills for
cwdusing the host-neutral root matrix. - estimate_
tokens ceil(chars / 4). Empty text is 0.- filter_
skills - Filter skills by trigger match and token budget.
- find_
skill_ by_ name - Case-insensitive skill lookup by frontmatter
name(NFKC). - format_
available_ skills_ xml - Official skills-ref
<available_skills>XML inventory for hosts. Includesdisable_model_invocationrows (slash palette). The model-facing catalog isformat_catalog. - format_
catalog - Build a cheap catalog fragment: name + description, plus
when_to_usewhen the author set it. - format_
list_ tsv - Default list TSV rows (
name\tsource\tpath) for CLIlist. - format_
load_ message - User-turn payload that asks the model to follow one skill fully.
- format_
load_ view - Same envelope as
format_load_message, with an outline or one section in place of the whole body. - format_
package_ envelope - Skill package root plus capped listings of scripts/references/assets.
- format_
skip_ tsv - TSV skip rows (
skip\tkind\tpath\tdetail) for CLI list stderr, CLI why stdout, and MCP catalog/xml text (stdio has no stderr). - format_
watch_ dirs - One leftover-safe watch root per line for CLI
list --watch-dirsand MCPskills_list format=watch. - format_
why_ text - Text why rows for CLI
why(not--json) and MCPskills_whyformat=text:loaded\tname\tpath, skip TSV, thenactivation\tname\treason\tdetail. - normalize_
skill_ name - NFKC form of a skill name (skills-ref / agentskills Unicode policy).
- outline_
of - Outline rows plus the cheaper-than-section hint.
- parse_
list_ format - Parse a format token. Surrounding whitespace is ignored.
- parse_
skill - Parse a SKILL.md file’s content into a
Skill. - progressive_
budgets - Derive catalog + body budgets from the model context window size.
- rank_
skills_ for_ catalog - Rank skills for catalog display: high relevance first, then name.
- sanitize_
error_ token - Echo a host or CLI token on one stderr line.
- skill_
name_ is_ ascii_ policy - True when
nameis onlya-z0-9-. - skill_
name_ matches_ directory - True when the parent directory name of
skill_mdmatchesname. - skill_
names_ equal - True when two names are the same package after NFKC and case fold.
- skill_
relevance_ score - Relevance score for ranking skills against user text.
- skill_
section - Body for
key, or an error that lists the keys that exist. - split_
sections - Split
contentinto flat sections. Parent text stops at the next heading of any level. ATX lines inside a fenced```/~~~block are not headings. - trigger_
matches - Case-insensitive trigger match on word/token boundaries, not substrings.
- unknown_
list_ format - Error text for CLI
--format/ MCPskills_listformat. - unknown_
or_ skipped_ skill - Classify a
loadmiss so hosts can branch without scraping Display. - unknown_
or_ skipped_ skill_ message - Error text when
loadcannot return a skill. - unknown_
or_ skipped_ skill_ named - Same as
unknown_or_skipped_skill, plus loaded skill names for a single-token typo hint (did you mean review-pr?). - unknown_
section_ message - One-line miss.
keyis sanitized like other host-echoed tokens. - validate_
path - Validate a SKILL.md path: readable, parse, and name/dir match.
- validate_
path_ with_ options - Validate a SKILL.md path or a package directory.
- validate_
skill_ name - Validate agentskills.io
namefield rules after NFKC. - version
- Package version from
Cargo.toml. - walk_
cwd_ to_ git_ root - Ancestors of
cwdthrough the nearest.git(cwd first). - watch_
dirs - Existing directories (and lone extra-path
SKILL.mdfiles) a host should watch so hot reload matchesdiscover. - why
- Explain loaded vs skipped skills and optional activation decisions.