# Class LittleGhost::Skills::Catalog

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Skills/Catalog.html

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. Symbolic-link escapes, unsafe names, oversized files, and
invalid YAML are rejected or skipped before instructions reach a model.
Optional resource listings are limited by count and depth.

### 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.

## Inheritance

`LittleGhost::Skills::Catalog < Object`

## Includes

- `Enumerable`

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(paths:,
        max_skills: DEFAULT_MAX_SKILLS,
        max_file_bytes: DEFAULT_MAX_FILE_BYTES,
        max_resource_files: DEFAULT_MAX_RESOURCE_FILES,
        only: nil,
        resource_root: nil,
        workspace: nil,
        sandbox: nil)
```

Loads valid skills immediately using the supplied safety limits.
`resource_root` may be an absolute process-visible path. A
`workspace://name` reference also requires `workspace` and
`sandbox`; it must resolve to every configured skill root through a read-only
file-tool grant.

## Instance methods

<a id="method-i-discovery_prompt"></a>
### `#discovery_prompt`

```ruby
#discovery_prompt()
```

Produces the escaped, metadata-only prompt used for discovery.

<a id="method-i-each"></a>
### `#each`

```ruby
#each(&block)
```

Yields each Skill in lookup order.

<a id="method-i-fetch"></a>
### `#fetch`

```ruby
#fetch(name)
```

Finds the named Skill or raises ConfigurationError.

<a id="method-i-format"></a>
### `#format`

```ruby
#format(skill)
```

Formats one Skill, including allowed tools, compatibility, and bounded
resource paths.

<a id="method-i-names"></a>
### `#names`

```ruby
#names()
```

Lists immutable skill names in lookup order.

<a id="method-i-tool"></a>
### `#tool`

```ruby
#tool()
```

Exposes full instructions on demand through a `skills` Tool.
