Skills
A skill is a folder with a SKILL.md file. Viewport reads the open Agent Skills format and adds a few optional fields.
A skill is one unit of capability: a name, a description the model reads in the catalog, instructions it reads once the skill loads, and the tools it may use while the skill is loaded.
---
name: refunds
description: Issue refunds for damaged, late or wrong orders. Use when a customer asks for money back.
tools: [lookup_order, issue_refund]
requires: [support-voice]
---
# Refunds
1. Look up the order. Never refund an order you have not looked up.
2. Refunds over $100 need a human: say so and stop.name, description and the body are plain Agent Skills, so the same
folder works in Claude Code, Codex, Cursor and every other client that reads SKILL.md. Folders can also hold
references/, assets/ and scripts/: Viewport lists them as resources and never reads or runs them on its own.
Every file in the folder except dot files and node_modules is listed, so keep secrets out of skill folders; the
model can read listed files only when you turn on resources.
Viewport fields
All optional. Keys are snake_case except the inherited allowed-tools.
| Field | Default | Meaning |
|---|---|---|
tools | [] | Tool names (wire names, Tool.name) bound to this skill: visible and callable only while it is loaded |
requires | [] | Skills loaded first, in dependency order |
loading | model | always, model, router, trigger or manual (see Loading) |
triggers | [] | { input: <matcher> }, or { tool_called: <name>, result?: <matcher> } (fires after a call returns without throwing, and only if its return value matches result), for loading: trigger (lint errors otherwise) |
priority | 50 | 0 to 100. Orders eviction; always skills default to 90 |
budget | none | Most tokens the instructions may use. Exceeding it is a load error |
version | none | Free-form label shown in events. Sessions pin the content hash, not this |
Claude Code's disable-model-invocation: true is honored as loading: manual, so folders shared with Claude Code
mean the same thing in both.
Strict consumers: the sidecar
Claude Code ignores unknown frontmatter keys, but the Agent Skills reference validator and the skill upload APIs
reject them. Put the Viewport fields in agents/viewport.yaml inside the skill folder instead and the SKILL.md
stays spec-clean:
# refunds/agents/viewport.yaml
tools: [lookup_order, issue_refund]
requires: [support-voice]A key set in both places is a load error. viewport-context export <dir> --portable writes a copy with every
Viewport field moved to the sidecar, and viewport-context lint --portable flags frontmatter a strict consumer
would reject.
Validation
Frontmatter is strict YAML, read the same way in both languages. Indent with spaces: a tab character is refused
anywhere in the frontmatter, quoted values and comments included. To put a tab in a value, write the escape \t
inside double quotes (description: "Columns:\tname, price"). Line endings are LF or CRLF; a bare CR is refused. Each
of these is a load error naming the file, line and column. Mappings and lists nest at most 64 levels (brackets inside a
quoted value or a comment are text and do not count), and frontmatter is at most 64 KiB. Keep frontmatter to plain keys and
values: explicit keys (? key), tags, directives and the ... document marker are refused, and a value that starts
with or contains odd punctuation must be quoted (description: ": ask first", not description: : ask first).
In flow mappings put a space after each colon ({ tools: [x] }, not {tools:[x]}). An unclosed [ or { is reported
where it opens.
The body below the frontmatter is Markdown and may contain anything.
Loading is strict and reports every problem at once, with file, line and path: unknown keys (with a "did you mean"),
a tools entry with no registered tool, a requires cycle, a name that does not match its folder, two skills with
one name, a body over its budget. Pass strict: false to load third-party folders leniently (warnings instead of
errors, as the Agent Skills client guide recommends). viewport-context lint prints the same issues.
A skill is a value: it is content-hashed, and a session pins each loaded skill to its hash, so a skill edited while a conversation is running never silently rewrites that conversation's prompt.
Where skills come from
Folders are the default source. Anything that can list skills is a source: an object with a label and an async
read() returning parsed skills, raw SKILL.md text, or inline definitions, so skills can live in a database or
object storage. Python sources may implement read(), aread() or both; use aload_skills for async ones.
# A source, as data: what read() returns
- { name: refunds, description: "Refund orders.", instructions: "...", tools: [issue_refund] }Many tenants, one pack
Build the shared pack once, then give each tenant its own registry. configure(...) changes defaults (an allow list,
a budget) and shares everything. An allow list is a grant, enforced on every load path: the model's load_skill,
session.load from code, triggers, the router, loading: always skills, requires chains and restored state. Code
outside the grant gets not_allowed, the same status the model gets. A derived grant narrows, never widens: a
session's or configure's allow is intersected with the registry's, and extend can grant the tenant's own new
skills but no pack skill outside the pack's grant; a tenant skill binds only its own tools, ambient tools and tools a
granted pack skill binds. extend(...) adds a tenant's own skills and tools on top of the pack: the pack's
skills, tools and counts are shared by reference, only what is new is validated, and a tenant skill can require pack
skills and bind pack tools. A tenant skill with a pack skill's name replaces it only with on_conflict="last_wins".
Caches are keyed on immutable skill and tool values, never on a tenant, so nothing leaks between tenants.
make bench measures it: see bench/TENANTS.md.