
lynx-a2ui
Convert natural-language UI requests into A2UI v0.9 JSON protocol messages that an A2UI renderer can consume.
- Installs
- 147
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/lynx-community/skills --skill lynx-a2ui- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads lynx-a2ui automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
A2UI Generator
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.
Generation Workflow
- Fetch the latest catalog from the URL in the Catalog Source section.
- Read
catalogId, component schemas, function schemas, required fields, enum values, and examples if the fetched catalog provides them. - Build the UI from the protocol rules, catalog schema, hard rules, and example patterns embedded in this skill.
- Translate the user's intent into a data model and a flat component graph that validates against the latest fetched catalog.
- Emit only the final JSON array of A2UI messages.
This skill is self-contained for third-party agent platforms. Do not rely on repository-local files.
Protocol Reference
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:
- Prompt-first: follow the in-context schema and examples exactly.
- Safe like data, expressive like code: emit trusted component data only.
- Structure/data separation: component messages define a flat UI graph; data model messages populate or update values used by dynamic bindings.
- Progressive rendering: each valid message may be rendered as it arrives. Prefer a useful minimal UI first, then add data or refinements.
- Transport-agnostic: A2UI messages may travel over SSE, REST, WebSocket, A2A, AG UI, MCP, or another host transport.
Envelope semantics:
createSurfacecreates a surface. Once created, itssurfaceIdandcatalogIdare fixed. To change catalog or theme, delete and recreate the surface.updateDataModelsets values inside a surface's data model. It has shape{ "surfaceId": string, "path"?: string, "value"?: any }.pathdefaults to/, andvaluemay be any JSON value.updateComponentsadds or replaces component definitions for a surface. It may reference data paths, but those paths should already be populated by an earlierupdateDataModelmessage in the same response.deleteSurfaceremoves a surface.
Output Contract
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:
createSurfaceupdateDataModelfor any initial values read through{ "path": ... }updateComponentscontaining a component with id"root"- optional additional
updateDataModelorupdateComponentsmessages
The 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.
Catalog Source
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.
Example Strategy
Examples improve accuracy, but they must be catalog-aware. Use examples this way:
- Prefer examples embedded in the fetched catalog if present.
- Use the embedded examples below as reusable patterns for a form with an action, a data-bound repeated view, a chart-like data view, and an action response patch.
- Validate embedded examples against the latest catalog before borrowing their structure. Discard or adapt any example that references missing components, missing props, changed required fields, changed enum values, or functions absent from the current catalog.
- Do not paste example JSON into the final answer unless it exactly satisfies the user's request and the latest catalog.
- If no example fits, generate from the fetched schemas directly.
Hard Rules
- Output must be a JSON array of A2UI messages. No prose, Markdown, XML, code fences, comments, or trailing commas.
- Each element must include
"version": "v0.9". - Output pretty-printed JSON with 2-space indentation. Do not emit minified single-line JSON.
- For a fresh non-action response, the first message must be
createSurface. Use the fetchedcatalogId, and use surface id"main"unless the user specifies otherwise. - For
{ "path": ... }bindings, sendupdateDataModelbefore the firstupdateComponentsmessage that reads those paths. - The first fresh
updateComponentsmessage must contain exactly one component with id"root". - Use property-based component discriminators:
"component": "SomeComponent", not wrapper objects such as{ "SomeComponent": { ... } }. - Children are referenced by id only. Never inline child components.
- Child references must point to components present in the same response, or to components that already exist on the same surface during a patch.
- Keep ids kebab-case and unique per surface, such as
"root","title-text", and"submit-button". - Do not invent components, props, functions, enum values, or action shapes outside the latest fetched catalog.
- If a component has a layout
weightprop, treat it as a small child layout ratio, not CSS font weight. Do not use typography values like400,500,600, or700unless the latest catalog explicitly defines that meaning. - If the user asks for impossible, unsafe, or unsupported UI, return a concise explanatory A2UI surface using supported catalog components rather than prose.
- If the latest user message starts with
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. - For action responses, prefer the smallest valid patch: one
updateDataModelfor changed data, plusupdateComponentsonly if visible structure needs to change. - For UI that should change after an interaction, keep the initial response in the pre-action state. Put confirmation, success, error, or result details in the action response.
Component Rules
- Components are flat objects in
updateComponents.components; children are referenced by id strings, never nested inline. - Every component has a unique kebab-case
"id"and a catalog discriminator whose value is one of the keys in the fetched catalog'scomponentsobject. - The first visible component tree for a fresh UI must include
"id": "root". - If a component schema has
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. - If a component schema requires an action, emit the action shape allowed by
the fetched schema, with either an allowed event payload or a function call
whose function name exists in
functions. - Do not invent components, props, functions, enum values, or layout fields that are not in the active catalog.
- For media-like components, follow the fetched schema for URL/source fields. If the host resolves image queries, use a short English search query instead of inventing CDN URLs.
- If the user asks for an unsupported or unsafe UI, still return A2UI JSON: render a concise explanatory surface using components available in the latest catalog instead of returning prose.
Data Binding
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.
Action Responses
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:
- Use
updateDataModelwhen only data changed. - Add
updateComponentsonly when visible structure changed. - Keep the same
surfaceIdunless 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.
Embedded Example Patterns
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.
Form With Action
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"
}
]
}
}
]
Data-Bound Repeated View
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"
}
]
}
}
]
Chart-Like Data View
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
}
]
}
}
]
Action Response Patch
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"
}
}
]
}
}
]
Validation Checklist
Before final output, verify:
- The first character is
[and the last character is]. - Every message includes
"version": "v0.9". - A fresh response starts with
createSurface. - The first fresh
updateComponentsmessage containsroot. - Every child id reference exists in the same response.
- Bound paths have matching earlier data-model values.
- Repeated templates use object items and relative item fields.
- No component, prop, enum value, function, or action shape is outside the latest fetched catalog.
- The JSON parses without comments or trailing commas.
FAQ
What does the lynx-a2ui skill do?
Convert natural-language UI requests into A2UI v0.9 JSON protocol messages that an A2UI renderer can consume.
How do I install lynx-a2ui?
Run npx skills add https://github.com/lynx-community/skills --skill lynx-a2ui in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/lynx-a2ui/ (personal) or .claude/skills/lynx-a2ui/ (project).
Which AI agents can use lynx-a2ui?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is lynx-a2ui safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains lynx-a2ui?
It is published by lynx-community in lynx-community/skills. It has 147 recorded installs.
More from lynx-community/skills
lynx-devtool
lynx-community/skills
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, evaluating JavaScript on a device, screenshots, heap snapshots, performance traces, Page.reload or App.openPage, global switches, interactive snapshot refs and taps/fills/scrolls, inspecting or searching a ReactLynx component tree, linking DOM Snapshot refs to ReactLynx components (reactlynx link), or mutating ReactLynx props/state/context on Android, iOS, or Desktop.
rspeedy-bundle-size
lynx-community/skills
Open the skill to read its SKILL.md instructions.
reactlynx-best-practices
lynx-community/skills
Open the skill to read its SKILL.md instructions.
lynx-typescript
lynx-community/skills
Open the skill to read its SKILL.md instructions.
lynx-trace-analysis
lynx-community/skills
Specializes in analyzing Lynx trace data to diagnose performance issues and provide actionable optimization strategies. Key Scenarios: - Loading Performance: Diagnosing slow startup metrics (FCP, FMP, TTI) and white screen issues. - Smoothness Analysis: Investigating root causes for scroll jank, frame drops, and interaction lag. - Regression Detection: Comparing traces to identify performance degradation or verify optimization gains between versions. - Pipeline Deep Dive: Pinpointing bottlenecks in specific rendering stages like Layout, Paint, JS execution, and background threads. - Native Module Analysis: Investigating performance issues related to native module calls. - Memory Analysis: Diagnosing high PSS, page lifecycle leaks, shared BTS context growth, VM pool waste, and JS heap snapshots.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.