Skip to main content
Prompts get unwieldy when you pack every instruction into the system message. Skills solve this. They are lazy-loaded instruction packages that keep your initial context window small while providing deep expertise on demand.

How Skills Work

Skills are markdown documents with a name, description, and body of instructions. At prompt render time, Output builds a summary of available skills and adds it to the system message: The LLM decides which skills are relevant for the task and loads them when nessesary.

Providing Skills

There are three ways to give skills to an LLM call in Output: colocated files, frontmatter paths, or inline code.

Colocated Files (Auto-Discovery)

Place .md files in a skills/ folder next to your prompt file. Output discovers them automatically, no configuration needed.
Each skill file is markdown with optional YAML frontmatter for name and description:
clarity_guidelines.md
The prompt file itself doesn’t need any special configuration. The skills directory is discovered by convention:
writing_assistant@v1.prompt

Frontmatter Paths (Explicit)

For explicit control over which skills are loaded, list paths in the prompt frontmatter. Paths can point to individual files or directories of .md files, resolved relative to the prompt file’s location:
writing_assistant@v1.prompt
When skills: is set in frontmatter, auto-discovery of the colocated skills/ directory is skipped. Only the explicitly listed paths are loaded.

Inline Skills (Code)

Create skills programmatically with the skill() function. This is useful when skill content is dynamic or generated from data:
steps.ts
Pass inline skills to generateText or Agent:
Inline skills are merged with any file-based skills (from auto-discovery or frontmatter paths).

Skill File Format

Skill files are markdown documents with an optional YAML frontmatter block: If you omit the frontmatter entirely, the filename (without .md) is used as both the name and description. A file named clarity_guidelines.md with no frontmatter would have name: "clarity_guidelines" and description: "clarity_guidelines". Write good descriptions. They’re what the LLM uses to decide whether to load a skill. “Rules for writing clear, readable technical content” is better than “clarity_guidelines”.

Resolution Priority

Skills are resolved in this order:
  1. Frontmatter paths: If skills: is set in the prompt frontmatter, those paths are loaded
  2. Colocated auto-discovery: If no skills: in frontmatter, the skills/ directory next to the prompt file is scanned
  3. Caller-provided skills: Skills passed via code (skills: [...] in generateText or Agent) are always merged in
Frontmatter paths and colocated auto-discovery are mutually exclusive. Setting skills: in frontmatter disables auto-discovery. Caller-provided skills are always added regardless of which file-based method is used.

Disabling Skills

Set skills: [] in the prompt frontmatter to explicitly opt out of auto-discovery:
no_skills_assistant@v1.prompt
This is useful when you have a skills/ directory for other prompts in the same folder, but a specific prompt should not load any skills.