Expand description
Skill discovery and SKILL.md frontmatter parsing.
Structs§
- Discovery
- A discovery pass: the parsed skills, plus every
SKILL.mdthat was found but yielded no skill (unreadable, unusable frontmatter, placeholder) with the reason — soski indexcan say why a skill is missing instead of silently indexing without it. - Skill
Functions§
- discover
- Walk
rootsand parse everySKILL.mdfound (skills only; seediscover_allfor the skip diagnostics). - discover_
all - Walk
rootsand parse everySKILL.mdfound. One bad file never aborts the pass — it is recorded inskipped(and traced underSKI_DEBUG) and the rest of the library survives. - extract_
phrases - Mine multi-word trigger phrases from a skill description. Scans the already
unquoted description for inner quoted spans (single or double quotes, ASCII or
curly), keeps those with [
MIN_PHRASE_TOKENS]..=[MAX_PHRASE_TOKENS] content tokens, and returns each normalized to a space-joined string of its content tokens (the form the ranker matches against a prompt). De-duplicated, order-preserving. - parse_
file - Parse a single
SKILL.md. ReturnsNonewhen the file yields no usable skill for any reason — unreadable file as well as missing/placeholder frontmatter — so a caller holding a possibly-stale path (e.g. the reranker’s doc-text read) degrades gracefully. Usediscover_allwhen the skip reason matters; theResultwrapper is kept for signature compatibility. - parse_
frontmatter - Extract
name,description, andkeywords/aliasesfrom a leading--- ... ---YAML frontmatter block. Intentionally minimal — not the full YAML grammar (no nested maps, anchors, flow maps) — but it covers every shape real skills ship: single-linekey: value, quoted values, inline lists, block scalars (description: >-+ indented lines — common in community skills, and previously parsed as the literal description">-"), multi-line plain scalars (indented continuation lines), and indented- itemlists.