Skip to main content

Module builtin_loader

Module builtin_loader 

Source
Expand description

Loads SKILL.md manifests from the active Prometheus Skill Pack root into the [SkillService] as kind = Manifest, origin = Builtin skills.

Root resolution: super::pack_detection::resolve_skill_pack_root (CH-16 skill-pack-bundling, docs/uar-next-fable.md §6.2) — env override, developer sibling checkout, installed plugin, or the embedded submodule floor, in that precedence order.

Discovery rules:

  • Walks the resolved root plus any extra roots from UAR_EXTRA_BUILTIN_SKILL_DIRS (colon-separated, lower precedence than the resolved primary root).
  • Picks up every SKILL.md whose path does not include imported/ unless UAR_LOAD_IMPORTED_SKILLS=true.
  • Parses the full agentskills.io frontmatter (§6.3 item 1): license, authors, language, compatibility, metadata.tags/category, model_routing, in addition to the fields the loader already read.
  • Preserves nested-skill parent/child relationships (§6.3 item 3).
  • Collision policy is precedence-wins, not last-wins (§6.3 item 6): the first root in precedence order to define a name keeps it; later roots’ same-named skills are dropped with a warning, UNLESS the collision is listed in the pack’s scripts/skill-collision-allowlist.json.

NOT implemented in this pass (see docs/uar-next-fable.md §6.3 for the full item list) — each is either a separate concern or too risky to wire in without the compile/integration-test verification this pass deliberately defers (implementation-first-then-test):

  • §6.3 item 2 (progressive disclosure / lazy body load) — prompt_overlay is still read eagerly. Changing this ripples into every consumer of Skill.prompt_overlay; needs its own focused pass.
  • §6.3 item 4 (pack MCP servers) — detect_pack_mcp_servers parses and logs which servers the pack’s .mcp.json declares, but does NOT register them into UAR’s live MCP registry yet.
  • §6.3 item 5 (hooks mapping) — explicitly out of scope; not attempted at all (matches the plan’s own “or explicitly document as unsupported; don’t half-load”).
  • §6.3 item 7 (activation metrics) — already shipped separately as CH-08 skill-activation-metrics.

Functions§

all_builtin_dirs
Returns all skill roots: the resolved primary root (§6.2 precedence) plus any extras from UAR_EXTRA_BUILTIN_SKILL_DIRS (colon-separated list of additional lower-precedence paths to scan).
builtin_dir
Returns the primary builtin-skills directory, honouring UAR_BUILTIN_SKILLS_DIR.
detect_pack_mcp_servers
Parse the pack’s .mcp.json (relative to the skill-pack root’s parent) and return the MCP server names it declares. Detection/logging only — does NOT register these into UAR’s live MCP registry (see module docs, §6.3 item 4 is intentionally not fully wired in this pass).
discover_builtin_skills
Scan all builtin skill directories and return parsed Skill structs plus the PackProvenance of the primary (highest-precedence) root.