Skill unstable
Standalone Agent Skill value and schema for local agents and MCP servers.
A Skill models an Agent Skill (https://agentskills.io/specification) as
plain data โ validated YAML frontmatter, markdown instructions, and
supporting files โ with SKILL.md as its serialization format via
toFiles and fromFiles.
Constructors
Parses a Skill from a file map containing SKILL.md and optional
supporting files.
Details
Fails with Cause.IllegalArgumentError when SKILL.md is missing, not
valid UTF-8, lacks a valid YAML frontmatter block, or fails Skill
schema validation.
See
Signature
declare function fromFiles(files: Readonly<Record<string, string | Uint8Array>>): Effect<Skill, IllegalArgumentError>Constructs a validated Skill.
Gotchas
Throws an Error (with the validation issue on cause) when frontmatter
fails validation or any key in files is "SKILL.md" or an unsafe path.
Use fromFiles or Schema.decodeUnknownEffect(Skill) for untrusted input.
See
- fromFiles for effectful construction from a raw file map
Signature
declare function make(options: { readonly files?: Readonly<Record<string, string | Uint8Array<ArrayBufferLike>>>; readonly frontmatter: { [key: string]: Json; readonly "allowed-tools"?: string; readonly compatibility?: string; readonly description: string; readonly license?: string; readonly metadata?: { [key: string]: string; }; readonly name: string; }; readonly instructions: string;}): SkillConversions
Renders a Skill into a file map that includes the generated
SKILL.md along with all supporting files.
Details
Frontmatter keys and values are JSON-encoded so YAML edge cases round-trip cleanly through fromFiles.
See
Signature
declare function toFiles(self: Skill): { readonly "SKILL.md": string;} & Readonly<Record<string, string | Uint8Array<ArrayBufferLike>>>Models
The YAML frontmatter of an Agent Skill's SKILL.md.
Signature
type Frontmatter = typeof Frontmatter.TypeSchema and class for an Agent Skill bundle.
Details
Holds validated Frontmatter, markdown instructions, and supporting
files keyed by safe relative paths (excluding SKILL.md). When encoded
with Schema.toCodecJson, binary Uint8Array files are represented as
{ base64: string } so text and binary files stay distinct.
See
Signature
declare class Skill extends { readonly files: { [key: string]: string | Uint8Array<ArrayBufferLike>; }; readonly frontmatter: { [key: string]: Json; readonly "allowed-tools"?: string; readonly compatibility?: string; readonly description: string; readonly license?: string; readonly metadata?: { [key: string]: string; }; readonly name: string; }; readonly instructions: string;} { constructor(...args: [props: { readonly files: { [key: string]: string | Uint8Array<ArrayBufferLike>; }; readonly frontmatter: { [key: string]: unknown; readonly "allowed-tools"?: string; readonly compatibility?: string; readonly description: string; readonly license?: string; readonly metadata?: { [key: string]: string; }; readonly name: string; }; readonly instructions: string; }, options?: MakeOptions]);}Schemas
Frontmatter
unstableSchema for the YAML frontmatter of an Agent Skill's SKILL.md, as the
Agent Skills specification defines it (https://agentskills.io/specification).
Details
Fields the specification does not define are kept unchanged.
Signature
declare const Frontmatter: StructWithRest<Struct<{ readonly "allowed-tools": optionalKey<String>; readonly compatibility: optionalKey<String>; readonly description: String; readonly license: optionalKey<String>; readonly metadata: optionalKey<$Record<String, String>>; readonly name: String;}>, readonly [$Record<String, Codec<Json, Json, never, never>>]>