Anatomy of a skill
A skill is two files. A typed manifest entry in src/lib/skills/registry.ts and a SKILL.md file on disk. The manifest controls runtime behavior. The SKILL.md carries the system prompt. The frontmatter inside the SKILL.md duplicates the manifest so the file is self-documenting for humans, with the manifest winning at load time.
Overview
- Manifest
src/lib/skills/registry.ts- Types
src/lib/skills/types.ts- Prompt files
src/lib/skills/<category>/<id>/SKILL.md- Required fields
- id, name, category, description, tools, model, maxTurns
- Optional fields
- author, version, license, tags
- Category
- One of 8 literal strings
- Model
- haiku, sonnet, or opus
- Always-on tools
- log_activity, save_memory
A skill is the smallest reusable unit the engine knows how to execute. Everything the engine needs to run one - which model to call, which tools to expose, how many tool-calling iterations to allow, and what the system prompt should be - is captured in two files that live next to each other in the source tree. There is no plugin loader, no database lookup, no runtime registration. The catalog is closed by design.
The contract is also tiny. One TypeScript interface, one filename convention, one always-on tool set. Anyone who has read this page once can scan an unfamiliar skill in under a minute and know what it does, what it touches, and what it cannot do.
SkillMeta interface
The typed contract every skill in the manifest must satisfy.
Skill type at load time. The full type adds one field, content, which holds the entire SKILL.md body that becomes the system prompt.SkillCategory union
The category is a literal union, not a free string. Adding a category means changing the type.
The category determines two things. First, the folder a skill's SKILL.md is loaded from at runtime. Second, the group the catalog browser shows the skill under. The two stay in sync because the loader composes the file path from the category string itself.
System tools
A short list of tools every skill gets for free. They are unioned into the catalog before the integration gate runs.
tools array. The engine merges them in at catalog build time. Listing them anyway is harmless; the set is deduplicated.Manifest vs SKILL.md
The manifest is metadata. The SKILL.md is the prompt. The loader merges them, with the manifest winning the runtime fields.
The runtime preference order is intentional. For values that change behavior (tools, model, maxTurns, category), the manifest is the source of truth and the loader ignores whatever the frontmatter says. For human-facing strings (name, description), the frontmatter wins so a maintainer can edit the markdown file without touching the registry.
Frontmatter
Every SKILL.md opens with a YAML block that mirrors the manifest entry.
SKILL.md body
Below the frontmatter, the markdown body becomes the system prompt. Structure it for the model, not for a human reader.
Skill bodies follow a loose template across the catalog. A short persona statement at the top, a Before Starting checklist that lists prerequisites and memory lookups, one or more numbered Mode sections describing the actual procedures, an output format spec, and a quality gate. The model reads the entire body on every invocation; long bodies mean expensive turns, so most skills stay under a thousand tokens.
Trigger description
The description field has one job. It tells the discovery step when to pick this skill.
The discovery model only sees the description, not the body. If the description tries to describe what the skill does, the discovery model will start to follow the description and skip reading the full prompt. Keep descriptions to a single sentence focused on the trigger condition. Include the exact words a user is likely to type. List sibling skills the description should rule out.
Tool allow-list
The tools array on a manifest is the only place a skill declares what it can call. The engine enforces it at catalog build time.
Model and turns
Two fields control cost and depth. Choose them together.
| Field | Allowed values | Effect |
|---|---|---|
| model | the model class | Selects the skill's model class, from fastest to heaviest; resolved internally to a versioned model id. Determines cost and reasoning ceiling. |
| maxTurns | 3 to 12 in practice | Hard cap on the tool-calling loop. The engine forces a final answer when reached. |
Pick the fastest class for tight extract-and-format work that does not require deliberation. Pick the default class for the agentic loop where the model picks tools and synthesizes results. Pick the heaviest class for long planning sessions, document scanning, or skills that have to compose more than five tool calls deep.
The turn budget is the wider lever. A six-turn budget keeps a skill snappy and predictable. A twelve-turn budget lets a skill recover from missed searches and re-plan once. Bigger than twelve is almost always a sign the skill should be split into two.
Optional fields
Four fields exist for marketplace and search use cases. None of them change runtime behavior.
| Field | Purpose |
|---|---|
author | Attribution for catalog listings and marketplace display |
version | Semver string used to track skill changes over time |
license | Free-form license tag for skill distribution |
tags | Array of strings used by the catalog search and filter UI |
File layout
Glossary
- SkillMeta
- The typed interface every manifest entry implements. Source of truth at runtime.
- Skill
- SkillMeta plus the loaded content from SKILL.md. Returned by loadSkill at execution time.
- SKILL.md
- Markdown file holding the system prompt for one skill. Frontmatter mirrors the manifest entry.
- Manifest
- The exported array SKILL_MANIFEST in registry.ts. The closed catalog of all runnable skills.
- Frontmatter
- YAML block at the top of a SKILL.md that duplicates manifest metadata for human readers.
- System tools
- Two tools (log_activity, save_memory) merged into every skill's allow-list automatically.
- Trigger description
- The description field on SkillMeta. Used only by the discovery step to pick a skill from the catalog.
- Connection gate
- A pre-call filter that drops tools whose required provider is not connected for the user.