# Skills extension The skills extension discovers instruction files and exposes a session snapshot as context, commands, and Python routes. It requires the `commands` extension. See [skills extension](../extensions/skills/src/albedo_ext_skills/extension.gleam). The skills catalog is part of the SDK. It is the type behind the per-session `skills` configuration, which the daemon handles beside `instructions` and `mcp`. The modules under [sdk/skills](../packages/albedo_sdk/src/albedo_sdk/skills) own the catalog, frontmatter policy, prompt mentions, and the native scanner. The extension owns session preparation, load records, the loads service, and Python bindings. Core code must not import the extension's modules. The skill command argument list is `command.skill_arguments` in [command.gleam](../packages/albedo_sdk/src/albedo_sdk/command.gleam), shared by the extension and the daemon's input catalog. ## Discovery [`catalog.scan_at`](../packages/albedo_sdk/src/albedo_sdk/skills/catalog.gleam) scans workspace, user, and built-in sources. It reads the workspace's project skills from the directory its `readable` argument answers. The extension passes its preparation's `project_files`, which the host answers with core's [`project_files.readable`](../apps/albedo/src/albedo/workspace/project_files.gleam): a remote workspace's mirror. If that mirror is unavailable, it skips project skills and records a diagnostic. Session preparation filters discovered skills through the preparation's capability `preferences`, read only when it discovered a skill, and keeps a snapshot for that session. The snapshot supplies `` metadata and commands. See [extension.gleam](../extensions/skills/src/albedo_ext_skills/extension.gleam). The native scanner checks immediate child directories under these roots in order: 1. `/.albedo/skills` 2. `/.agents/skills` 3. `$HOME/.albedo/skills` 4. `$HOME/.agents/skills` 5. The installation's `apps/albedo/priv/skills` Each candidate needs a regular `SKILL.md`. Its declared name must match the installed directory name. Earlier valid candidates take precedence over later duplicates. Symlinks resolve before the file is read. Root order, filesystem discovery, and selection identity belong to [`skills/files`](../packages/albedo_sdk/src/albedo_sdk/skills/files.gleam). [`frontmatter`](../packages/albedo_sdk/src/albedo_sdk/skills/frontmatter.gleam) owns frontmatter extraction and metadata validation for both discovery and selected-skill revalidation. The closing delimiter must fit within 65,536 bytes, including the delimiter lines and their counted newlines. CRLF delimiters are accepted. The shared [`albedo_file.read_prefix`](../packages/albedo_file/src/albedo_file.gleam) reads at most 65,537 bytes and closes its descriptor on success or failure. It decodes YAML with yamerl's failsafe schema while retaining duplicate keys, and adapts yamerl's terms in its `yaml_node` function. Keep metadata policy out of that adapter. A name uses 1 to 64 lowercase ASCII letters, digits, and single separating hyphens. For compatibility, a single trailing LF is also accepted in a name. An omitted name falls back to the installed directory name, which must pass the same validation. A description is trimmed and must contain 1 to 1,024 Unicode scalars. Duplicate `name` or `description` fields are rejected. Other well-formed metadata fields are ignored. ## Activation and Python API `await skills.resources(name)` lists resource names. `await skills.read(name, resource="SKILL.md", offset=0, limit=16384)` reads a bounded page with `content`, `next_offset`, and `truncated`. Failures raise `SkillsError`. See [skills.py](../python/albedo_plugins/skills.py) and [catalog.gleam](../packages/albedo_sdk/src/albedo_sdk/skills/catalog.gleam). The resource reader accepts at most 65,536 bytes per page and rejects resources larger than 16 MiB. After the existing selected-skill identity, path resolution, and regular-file checks, it uses [`albedo_file.read_range`](../packages/albedo_file/src/albedo_file.gleam) for bounded byte I/O. The shared helper does not replace those checks. A read error returns a resource error, and EOF returns empty bytes. The response includes its encoding and total size. See `read_resource` in [files.gleam](../packages/albedo_sdk/src/albedo_sdk/skills/files.gleam). Each cataloged skill has a slash command. A reserved command name uses `/skill:`. A user invocation submits an activation as a turn. A model command invocation returns activation data. See `command_name` in [catalog.gleam](../packages/albedo_sdk/src/albedo_sdk/skills/catalog.gleam) and `skill_command` in [extension.gleam](../extensions/skills/src/albedo_ext_skills/extension.gleam). ## Trust and execution The built-in [image generation skill](../apps/albedo/priv/skills/imagegen/SKILL.md) describes the [imagegen binding](imagegen.md) and links its prompting guidance, source attribution, and license. Discovering or reading it does not enable a driver or establish that an account is signed in. Reading or activating a skill does not run its scripts, import modules, fetch links, or grant tools. `allowed-tools` metadata is descriptive. Resolve relative paths from the installed skill directory. The extension attempts to record loads, but a recording failure does not prevent a load. See `instructions`, `record`, and `skill_command` in [extension.gleam](../extensions/skills/src/albedo_ext_skills/extension.gleam) and the activation preamble in [catalog.gleam](../packages/albedo_sdk/src/albedo_sdk/skills/catalog.gleam). ## Related pages - [All topics](README.md) - [Change guidance](contributing.md) - [Commands](commands.md) - [Extensions](extensions.md) - [Image generation](imagegen.md)