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★ 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:
catalogIdis 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/allowedChildrenare enforced at runtime — violations emitUNALLOWED_PARENT/UNALLOWED_CHILD.- Catalog resolution: explicit
catalogIdon the component → surface default fromcreateSurface→ error. There is no fallback to renderer defaults. instructionsis 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic