class LittleGhost::Skills::Catalog

A Catalog lets an agent discover focused instructions without putting every skill in its prompt. The model sees short descriptions first and can load a skill’s full instructions when the task calls for them.

catalog = LittleGhost::Skills::Catalog.new(paths: ["app/skills"])
catalog.names # => ["refund_policy", "search_orders"]
catalog.discovery_prompt.include?("refund_policy") # => true
catalog.tool # a LittleGhost::Tool that loads full instructions on demand

Each immediate child directory may contain one SKILL.md with YAML front matter whose name matches the directory name. A symbolic link that escapes its root or an oversized file raises ConfigurationError. Linked skill directories and manifests, unsafe or mismatched names, and invalid UTF-8 or YAML are skipped before instructions reach a model, and each skip emits a little_ghost.skills.skill_skipped warning through Events with the directory name and a reason. Optional resource listings are limited by count and depth.

Layering skill roots

When several roots define the same skill name, precedence decides the result: :last (the default) lets a later root override an earlier one, :first keeps the earliest definition, and :error raises ConfigurationError. List roots so the one you trust most wins.

catalog = LittleGhost::Skills::Catalog.new(
  paths: [shared_skills, repository_skills, "app/skills"],
  precedence: :last
)
catalog.materialize("/srv/run/skills") # => "/srv/run/skills"

materialize copies the resolved skills into one directory, so a Sandbox can expose a single read-only path instead of every source root.

Choosing skill sources

Skill files become model instructions, so keep configured roots under application control and non-user-writable. The allowed-tools field tells the model what a skill expects; the Agent’s Tool list and each Tool’s application checks still decide what can run. For a workspace:// resource root, the Catalog verifies the named read-only grant and rejects direct writable aliases it can identify. LittleGhost cannot identify every alias created by an outer container or mount namespace, so the application must not expose the same files through another writable bind mount.