# `Nous.Skill.Loader`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/skill/loader.ex#L1)

Loads skills from markdown files with YAML frontmatter.

Supports progressive disclosure: only frontmatter is parsed initially,
the full markdown body is loaded on first activation.

## File Format

    ---
    name: code_review
    description: Reviews code for quality and bugs
    tags: [code, review]
    group: review
    activation: auto
    allowed_tools: [file_read, file_grep]
    priority: 100
    ---

    You are a code review specialist...

`allowed_tools` confines the agent to the listed tool names while the skill
is active (see `Nous.Plugins.Skills`). It also accepts a comma- or
space-separated string (`allowed_tools: file_read, file_grep`). Omit it to leave
the tool set unrestricted; any other value restricts to nothing rather than
silently allowing everything.

`model_override` is parsed but **not applied** — requests always use the
agent's model. A skill that sets it logs a one-time warning.

# `load_directory`

```elixir
@spec load_directory(String.t()) :: [Nous.Skill.t()]
```

Load all `.md` skill files from a directory (recursively).

Returns skills with only frontmatter parsed (status: :discovered).

# `load_file`

```elixir
@spec load_file(String.t()) :: {:ok, Nous.Skill.t()} | {:error, term()}
```

Load a single skill from a markdown file.

Parses YAML frontmatter for metadata. The markdown body is stored
but marked as `status: :discovered` for lazy loading.

# `parse_frontmatter`

```elixir
@spec parse_frontmatter(String.t()) :: {:ok, map(), String.t()} | {:error, term()}
```

Parse YAML frontmatter from markdown content.

Returns `{:ok, metadata_map, body}` or `{:error, reason}`.

# `parse_skill`

```elixir
@spec parse_skill(String.t(), String.t() | nil) ::
  {:ok, Nous.Skill.t()} | {:error, term()}
```

Parse a skill from raw markdown content with YAML frontmatter.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
