Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

a2ui-protocol

БесплатноБез исполняемых скриптовНе проверен

This skill should be used when building A2UI (Agent to UI) interfaces — the six streamed message types, surfaces, the flat adjacency-list component model…

TheLobbiот TheLobbi★ 22 звезды на GitHub

Об этом скилле

A2UI — Agent to UI Protocol (v1.0)

A2UI takes the opposite bet from MCP Apps. Instead of shipping HTML into an iframe, the agent streams a declarative JSON description of the UI and the client renders it with its own native components — React, Flutter, SwiftUI, web components, whatever the client is built from.

The security consequence is the point: UI is data, not code. The agent can only reference components in a client-controlled catalog. There is no arbitrary script from model output, so there is no UI injection surface.

The portability consequence is the other point: one payload renders on every client, natively.

Choose A2UI when the client owns the design system, when you must render on non-web surfaces, or when executing model-authored markup is unacceptable. Choose MCP Apps when you need arbitrary web capability inside a chat host.

The six messages

Every message is one JSON object with "version": "v1.0" and exactly one envelope key. Typically streamed as JSONL.

Message Purpose
createSurface Open a surface. May carry initial components and dataModel.
updateComponents Add or replace components in a surface.
updateDataModel Write values at JSON Pointer paths. Upsert semantics.
deleteSurface Destroy the surface and everything in it.
callRendererFunction Invoke a function the catalog registered on the renderer.
agentFunctionResponse Return a result for a renderer→agent function call.
{"version":"v1.0","createSurface":{"surfaceId":"contact_form_1","catalogId":"https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"}}
{"version":"v1.0","updateComponents":{"surfaceId":"contact_form_1","components":[{"id":"root","component":"Card","child":"form_container"},{"id":"form_container","component":"Column","children":["header","name_row"],"align":"stretch"}]}}
{"version":"v1.0","updateDataModel":{"surfaceId":"contact_form_1","path":"/contact","value":{"firstName":"John"}}}
{"version":"v1.0","deleteSurface":{"surfaceId":"contact_form_1"}}

surfaceId must be unique for the renderer's lifetime. A deleted surface cannot be recreated under the same ID.

The three schemas

Schema Defines
common_types.json DynamicString, DynamicNumber, ComponentId, ChildList, AccessibilityAttributes, CheckRule
agent_to_renderer.json The message envelope. Uses catalog.json#/$defs/anyComponent so it validates against any compliant catalog.
catalogs/basic/catalog.json The baseline components (Text, Button, TextField, Row, Column, Card, CheckBox, ChoicePicker, …) and functions.

The component model

Components are a flat adjacency list, not a nested tree. Each entry has an id; parents reference children by ID.

{"id": "root",   "component": "Card",   "child": "col"}
{"id": "col",    "component": "Column", "children": ["title", "field"]}
{"id": "title",  "component": "Text",   "text": "Contact us"}
{"id": "field",  "component": "TextField", "value": {"path": "/contact/email"}}

Every surface implicitly contains a canonical Surface container whose child is "root". Surface is reserved and cannot be redefined by a catalog.

Flatness is what makes streaming and incremental patching work — you can update one component without resending its ancestors.

Catalogs

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/catalogs/mine/catalog.json",
  "catalogId": "https://example.com/catalogs/mine/catalog.json",
  "components": {
    "Badge": {
      "properties": {
        "component": { "const": "Badge" },
        "label": { "$ref": "common_types.json#/$defs/DynamicString" }
      },
      "allowedParents": ["Row", "Column"],
      "allowedChildren": []
    }
  },
  "functions": {
    "formatCurrency": { "returnType": "string", "callableFrom": ["renderer"] }
  },
  "instructions": "Use Badge for status only. Never for primary actions."
}

Rules that bite:

  • catalogId is a unique string, conventionally a URI, not required to resolve.
  • Every component schema must pin "component": {"const": "<Name>"}.
  • Identifiers follow UAX #31: ^[\p{XID_Start}_][\p{XID_Continue}]*$. The @ prefix is reserved for system context.
  • allowedParents / allowedChildren are enforced at runtime — violations emit UNALLOWED_PARENT / UNALLOWED_CHILD.
  • Catalog resolution: explicit catalogId on the component → surface default from createSurface → error. There is no fallback to renderer defaults.
  • instructions is prose for the LLM. Use it to encode design intent the schema cannot express.

Data model and binding

UI structure and application data are strictly separate. Components reference data by JSON Pointer.

  • Root scope — absolute paths: /user/name.
  • Collection scope — inside a template, relative paths (firstName) resolve against the current item; a
Полный SKILL.md на GitHub

Установить a2ui-protocol в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл a2ui-protocol?

This skill should be used when building A2UI (Agent to UI) interfaces — the six streamed message types, surfaces, the flat adjacency-list component model, component catalogs, JSON Pointer data binding and two-way input binding, actions vs functionCalls, CheckRule validation, and progressive streaming.

Как установить скилл a2ui-protocol?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл a2ui-protocol запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить a2ui-protocol с