ワンクリックで
lynx-a2ui
Convert natural-language UI requests into A2UI v0.9 JSON protocol messages that an A2UI renderer can consume.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Convert natural-language UI requests into A2UI v0.9 JSON protocol messages that an A2UI renderer can consume.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Generate valid OpenUI Lang v0.5 functional-notation programs for the Lynx OpenUI renderer. Use when Codex must turn a natural-language UI request into raw OpenUI DSL for OpenUiRenderer, including static mobile UI, $state, Query/Mutation tool flows, Action plans, streaming-friendly output, or catalog-constrained revisions. Do not use for JSX, HTML, CSS, A2UI JSON, or implementing new ReactLynx components.
Query @lynx-js/css-defines compat_data to check Lynx CSS property and nested feature/value support by rendering backend and Lynx version, or check whether a newer dataset version exists. Use when asked whether CSS is supported in Lynx or ReactLynx, which backends support it, when support was added, whether a style change is compatible, whether the bundled data is current, or when inspecting the raw definition JSON.
Use this Skill when building Lynx applications directly with vanilla Lynx Element PAPI APIs from @lynx-js/type-element-api, without ReactLynx JSX. It covers Rspeedy project structure for native Lynx artifacts, main-thread Element PAPI rendering, UI event binding, main/background thread event communication, CSS packaging, and common Element API patterns. Trigger Scenarios: - User wants to build a Lynx app without ReactLynx, JSX, or a framework - User asks to use @lynx-js/type-element-api, Element PAPI, vanilla Lynx, or APIs such as __CreatePage, __CreateView, __CreateText, __AppendElement, __SetAttribute, or __FlushElementTree - User needs a native Lynx artifact with main-thread, optional background-thread, and CSS assets - User asks how vanilla Lynx UI events should stay on the main thread or be forwarded to background logic
Use when working with Lynx DevTool or debugging a Lynx app, page, or device, especially when the task mentions clients or sessions, CDP or App commands, DOM/CSS inspection, runtime or console logs, screenshots, heap snapshots, Page.reload or App.openPage, global switches, or inspecting a ReactLynx component tree (`reactlynx tree`), searching components (`reactlynx find`), inspecting props/state/hooks (`reactlynx component`), or mutating props/state/context (`reactlynx update-prop` / `update-state` / `update-context`) on Android, iOS, or Desktop.
Remap the function_id:pc_index to the original source code position by provided debug info json file.
Guidance on using Habitat to manage multi-repo source and asset dependencies via .habitat/DEPS and hab sync, plus troubleshooting common sync failures.
| name | lynx-a2ui |
| description | Convert natural-language UI requests into A2UI v0.9 JSON protocol messages that an A2UI renderer can consume. |
Use this skill when an agent must turn a natural-language request into A2UI protocol data for rendering. The output is data only: a JSON array of A2UI v0.9 messages.
catalogId, component schemas, function schemas, required fields, enum
values, and examples if the fetched catalog provides them.This skill is self-contained for third-party agent platforms. Do not rely on repository-local files.
A2UI is a JSON-based streaming UI protocol. The agent describes an interface by emitting declarative JSON messages. The renderer instantiates only trusted components from the active catalog. There is no arbitrary code: never emit JavaScript, HTML, CSS, event handlers, scripts, or executable snippets.
Design principles:
Envelope semantics:
createSurface creates a surface. Once created, its surfaceId and
catalogId are fixed. To change catalog or theme, delete and recreate the
surface.updateDataModel sets values inside a surface's data model. It has shape
{ "surfaceId": string, "path"?: string, "value"?: any }. path defaults
to /, and value may be any JSON value.updateComponents adds or replaces component definitions for a surface. It
may reference data paths, but those paths should already be populated by an
earlier updateDataModel message in the same response.deleteSurface removes a surface.Return only a pretty-printed JSON array. Do not return Markdown, prose, XML, HTML, JavaScript, CSS, code fences, comments, or trailing commas.
Each array item must be a top-level object with "version": "v0.9" and exactly
one of these message keys:
"createSurface": create a new render surface."updateDataModel": set JSON values used by bindings."updateComponents": add or replace component definitions."deleteSurface": remove an existing surface.For a fresh UI response, emit messages in this order:
createSurfaceupdateDataModel for any initial values read through { "path": ... }updateComponents containing a component with id "root"updateDataModel or updateComponents messagesThe first fresh updateComponents message should contain exactly one root
component. Later updateComponents messages may replace or add more components
as needed. Put each message object and component object on separate lines so the
JSON remains easy to parse and validate.
Before finishing, check bracket balance: every component object closes once,
every components array closes once, every message object closes once, and the
outer array closes exactly once.
Use surface id "main" unless the caller provides a different id. Before
generating A2UI JSON, fetch the latest Lynx GenUI A2UI catalog from:
"https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json"
Treat that fetched catalog as the authoritative, dynamic type definition for the generated UI. Do not rely on a stale component list remembered from this skill. The catalog has this top-level structure:
{
"catalogId": "https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json",
"components": {},
"functions": {}
}
Use the fetched catalogId value in createSurface.catalogId. Use only
components listed under components, only functions listed under functions,
and only props, required fields, enum values, dynamic value shapes, and action
schemas allowed by that latest catalog. If the catalog cannot be fetched, ask
for the catalog content or a reachable catalog URL before generating non-trivial
UI.
If the user supplies a different catalog URL or catalog JSON, use that catalog
instead of the default URL and keep createSurface.catalogId aligned with the
active catalog.
Examples improve accuracy, but they must be catalog-aware. Use examples this way:
"version": "v0.9".createSurface.
Use the fetched catalogId, and use surface id "main" unless the user
specifies otherwise.{ "path": ... } bindings, send updateDataModel before the first
updateComponents message that reads those paths.updateComponents message must contain exactly one component
with id "root"."component": "SomeComponent",
not wrapper objects such as { "SomeComponent": { ... } }."root",
"title-text", and "submit-button".weight prop, treat it as a small child layout
ratio, not CSS font weight. Do not use typography values like 400, 500,
600, or 700 unless the latest catalog explicitly defines that meaning.A2UI_USER_ACTION:, return a
non-empty patch for the existing surface. Do not create a new surface unless
the action explicitly asks to replace the whole UI.updateDataModel
for changed data, plus updateComponents only if visible structure needs to
change.updateComponents.components; children are
referenced by id strings, never nested inline."id" and a catalog discriminator
whose value is one of the keys in the fetched catalog's components object."id": "root".children, provide the shape allowed by that
schema. If it has a singular child reference, provide exactly one component
id. If multiple visual children are needed, use a catalog component whose
schema accepts multiple children.functions.Use literal values for fixed text and simple static UI. Use data-model bindings when values need to be shared, editable, repeated, or updated after an action.
{ "someProp": "literal value" }
{ "someProp": { "path": "/data/path" } }
If a component reads { "path": "/..." }, send a preceding updateDataModel
message that creates that value.
For repeated children, use the template shape from the fetched component schema.
When the schema supports { "path": "...", "componentId": "..." }, the
container points to an absolute array path, while template components use
relative item paths.
The corresponding data must be an array of objects:
[
{ "label": "Alpha" },
{ "label": "Beta" }
]
Inside the template component tree, bind with { "path": "label" }. Do not use
wildcard paths such as "/items/*/label" and do not use { "path": "." }.
Choose the repeated-content component whose fetched schema and description best
match the requested layout and scrolling behavior.
If the latest user input starts with A2UI_USER_ACTION:, update the existing
surface instead of creating a new one. Return a non-empty JSON array with the
smallest valid patch:
updateDataModel when only data changed.updateComponents only when visible structure changed.surfaceId unless the action explicitly replaces the UI.Do not show success, confirmation, or post-action result states in the initial response before the user action occurs. Put those states in the action response. For UI that changes after an interaction, keep the initial response in the pre-action state and rely on the action response patch for confirmation, success, error, or result details.
These examples are illustrative in-context patterns. Before reusing one, fetch the latest catalog and confirm every component, prop, enum value, and action shape still validates. Adapt the component names and props if the current catalog changed.
User: Generate a login card with email, password, and a submit button.
[
{
"version": "v0.9",
"createSurface": {
"surfaceId": "main",
"catalogId": "https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json"
}
},
{
"version": "v0.9",
"updateDataModel": {
"surfaceId": "main",
"value": {
"form": {
"email": "",
"password": ""
}
}
}
},
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main",
"components": [
{
"id": "root",
"component": "Card",
"child": "form-column"
},
{
"id": "form-column",
"component": "Column",
"children": [
"title",
"email",
"password",
"submit"
]
},
{
"id": "title",
"component": "Text",
"text": "Sign in",
"variant": "h2"
},
{
"id": "email",
"component": "TextField",
"label": "Email",
"value": {
"path": "/form/email"
}
},
{
"id": "password",
"component": "TextField",
"label": "Password",
"variant": "obscured",
"value": {
"path": "/form/password"
}
},
{
"id": "submit",
"component": "Button",
"variant": "primary",
"child": "submit-label",
"action": {
"event": {
"name": "submit_login",
"context": {
"email": {
"path": "/form/email"
},
"password": {
"path": "/form/password"
}
}
}
}
},
{
"id": "submit-label",
"component": "Text",
"text": "Sign in"
}
]
}
}
]
User: Show three trip ideas as a compact vertical group.
[
{
"version": "v0.9",
"createSurface": {
"surfaceId": "main",
"catalogId": "https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json"
}
},
{
"version": "v0.9",
"updateDataModel": {
"surfaceId": "main",
"path": "/items",
"value": [
{
"name": "Canal walk",
"detail": "Morning coffee and quiet bridges"
},
{
"name": "Museum loop",
"detail": "Design exhibits plus lunch nearby"
},
{
"name": "Sunset hill",
"detail": "Short climb with skyline views"
}
]
}
},
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main",
"components": [
{
"id": "root",
"component": "Column",
"children": [
"title",
"trip-items"
]
},
{
"id": "title",
"component": "Text",
"text": "Trip ideas",
"variant": "h2"
},
{
"id": "trip-items",
"component": "Column",
"children": {
"path": "/items",
"componentId": "trip-row"
}
},
{
"id": "trip-row",
"component": "Row",
"children": [
"trip-icon",
"trip-copy"
],
"align": "center"
},
{
"id": "trip-icon",
"component": "Icon",
"name": "location_on"
},
{
"id": "trip-copy",
"component": "Column",
"children": [
"trip-name",
"trip-detail"
]
},
{
"id": "trip-name",
"component": "Text",
"text": {
"path": "name"
},
"variant": "h3"
},
{
"id": "trip-detail",
"component": "Text",
"text": {
"path": "detail"
},
"variant": "body"
}
]
}
}
]
User: Show weekly active users as a line chart.
[
{
"version": "v0.9",
"createSurface": {
"surfaceId": "main",
"catalogId": "https://unpkg.com/@lynx-js/genui/a2ui/dist/catalog.json"
}
},
{
"version": "v0.9",
"updateDataModel": {
"surfaceId": "main",
"value": {
"chart": {
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"series": [
{
"name": "Users",
"values": [
120,
148,
132,
171,
190
]
}
]
}
}
}
},
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main",
"components": [
{
"id": "root",
"component": "Card",
"child": "chart-column"
},
{
"id": "chart-column",
"component": "Column",
"children": [
"title",
"chart"
]
},
{
"id": "title",
"component": "Text",
"text": "Weekly active users",
"variant": "h2"
},
{
"id": "chart",
"component": "LineChart",
"labels": {
"path": "/chart/labels"
},
"series": {
"path": "/chart/series"
},
"xLabel": "Day",
"yLabel": "Users",
"showGrid": true,
"showLegend": true
}
]
}
}
]
User:
A2UI_USER_ACTION: {"surfaceId":"main","action":{"name":"submit_login","context":{"email":"me@example.com"}}}
[
{
"version": "v0.9",
"updateDataModel": {
"surfaceId": "main",
"path": "/status",
"value": {
"kind": "success",
"message": "Signed in as me@example.com"
}
}
},
{
"version": "v0.9",
"updateComponents": {
"surfaceId": "main",
"components": [
{
"id": "root",
"component": "Card",
"child": "status-column"
},
{
"id": "status-column",
"component": "Column",
"children": [
"status-title",
"status-message"
]
},
{
"id": "status-title",
"component": "Text",
"text": "Success",
"variant": "h2"
},
{
"id": "status-message",
"component": "Text",
"text": {
"path": "/status/message"
}
}
]
}
}
]
Before final output, verify:
[ and the last character is ]."version": "v0.9".createSurface.updateComponents message contains root.