Nous.Skill.Loader (nous v0.21.1)

Copy Markdown View Source

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.

Summary

Functions

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

Load a single skill from a markdown file.

Parse YAML frontmatter from markdown content.

Parse a skill from raw markdown content with YAML frontmatter.

Functions

load_directory(path)

@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(path)

@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(content)

@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(content, source_path \\ nil)

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

Parse a skill from raw markdown content with YAML frontmatter.