Expand description
SKILL.md parsing, {baseDir}/${CLAUDE_PLUGIN_ROOT} substitution, and discovery.
Task 21 (spec §7.6) — LAZY skill bodies: boot discovery reads ONLY the bounded frontmatter (never one body byte), records an immutable source fingerprint, and defers body read/substitution/validation to exact selection, which re-verifies the fingerprint before returning content.
Constants§
- DISCOVERY_
MAX_ METADATA_ BYTES - Deterministic cap on total retained metadata bytes (names + descriptions + paths) across the whole discovery pass.
- DISCOVERY_
MAX_ SKILLS - Deterministic cap on discovered skills (first-wins across roots).
- SKILL_
DESCRIPTION_ MAX_ BYTES - Bounded retained skill description: the retained copy is a BOUNDED
PROJECTION (UTF-8-safe truncation via
BoundedText) used only for display/search; selection verification always uses the exact frontmatter byte digest, never this projection. - SKILL_
FILE_ MAX_ BYTES - Hard cap on a SKILL.md regular file; larger files are skipped at discovery (stat only) and refused at selection.
- SKILL_
FRONTMATTER_ MAX_ BYTES - Hard bound on the boot-time frontmatter scan: the scan reads through
the closing
---delimiter and never past this many bytes. - SKILL_
NAME_ MAX_ BYTES - Bounded retained skill name.
Functions§
- default_
roots - The four default discovery roots, in priority order (local first, global second).
- load_
all - Walk the given roots and discover all plugins and skills. Deduplicates on (plugin_name, skill_name); first occurrence wins.
- load_
skill_ file - Discover a SKILL.md into a LAZY
LoadedSkill(Task 21): bounded frontmatter scan ONLY — zero body bytes read, no substitution. The open-handle fstat fingerprint (device/inode/size/mtime/ctime + frontmatter digest + body offset) is recorded so selection can verify the exact same content before trusting one body byte.