A2ui Core a2ui-core

Core A2UI protocol instructions and syntax rules for UI generation.

Works in Claude, ChatGPT, Codex and more
Our test
5/10
tested Dec 6, 2026
GitHub stars
39k
copilotkit/copilotkit
Added by
0
members
Updated
Dec 4
commit bd8b22b
Content
1 file
no scripts · 4 KB
License
MIT
free to use

What our test found

The skill gives clear output-format and DSL rules, but lacks a component catalog and signatures needed to reliably generate valid interfaces.

Request we tested it on“Create a simple sign-in screen with email and password fields and a submit button.”

Limits spotted

  • No component catalog or constructor signatures are provided, so component names and properties must be guessed.
  • No guidance for accessibility, layout conventions, or error handling beyond field validation.
View on GitHub ↗
name: a2ui-core
description: Core A2UI protocol instructions and syntax rules for UI generation.

A2UI Express DSL Output Contract

You must output the user interface using A2UI Express.

IMPORTANT: You MUST always surround the entire A2UI Express block with the literal sentinel tags <a2ui> and </a2ui> (always include both the opening and closing tags; do NOT wrap the tags in backticks or replace the opening tag with a markdown code fence such as ```a2ui).

The host compiler will compile your A2UI Express output into the correct JSON envelopes automatically.

Grammar Rules

  1. Component constructors can be assigned to variables or nested inline inside parent component arguments: header = ComponentA(prop1="val1") root = ComponentB([header, ComponentC("Click", action=Event("submit"))])

Keyword arguments (param=value) and positional arguments with _ placeholders are supported.

Variable names MUST start with a letter or underscore, and only contain letters, digits, and underscores.

  1. The interface tree must have a single entry point assigned to the reserved variable 'root'.
  1. Primitives:
  2. Strings: Quoted with " or """. Support for \n, \t, \\, and \" escapes. Raw Strings: Prefaced by r (e.g., r"..." or r"""..."""), with no escape processing.
  3. Numbers: write as integers or decimals, e.g., 42
  4. Booleans: write true or false
  5. Null values: write null
  6. Dates & Times: Values for date-time inputs (e.g. in DateTimeInput) must strictly use RFC 3339 format with a timezone offset (e.g. "2026-03-14T00:00:00Z").
  1. Lists: represent as arrays, e.g., [child1, child2].
  1. Maps: represent as key-value blocks, e.g., {title: "Overview", child: contentCol}. Map keys are always literal strings (dynamic variable resolution is not supported for keys).
  1. Data bindings: prefix absolute paths in the data model with '$', e.g., $/user/firstName. Prefix relative list scopes with '$', e.g., $firstName. A lone '$' represents an empty relative path which resolves to the root of the current context (e.g. inside a template, representing the entire item itself).
  1. Logic and validation: prefix client check rules with '?', e.g., ?required or ?regex("^[0-9]{5}$"). To specify a custom error message for validation failures, append it as an extra string argument, e.g. ?regex("^[0-9]{5}$", "Postal code must be 5 digits").
  1. Action events: represent server-side actions using the Event helper: Event("save_deal", {rep: $/form/rep})
  1. Nested functions: call client functions directly using catalog signatures, for example myFunction("value").
  1. Data model population: Assign a value directly to an absolute data path (e.g. $/path/to/key = "value") to populate or initialize values inside the shared dataModel. The value can be a primitive, array, or map.
  1. Dynamic list templates: If a component expects a template child list, represent it using the _template helper: _template($/path/to/list, itemTemplate) And define the template component variable on another line, utilizing relative path references prefixed with $: itemTemplate = Image($url)
  1. To delete a user interface surface, output the standalone deleteSurface(surfaceId) command (no variable assignment): deleteSurface("dashboard-surface-1")
  1. Static properties: Arguments annotated with '(static)' in the signatures below MUST be defined as literal values or arrays inline. You CANNOT use a dynamic data binding path (prefixed by $) for these arguments.
  1. Required actions: Parameters named 'action' (or annotated in component signatures) are strictly required. You must pass a valid Event (e.g. Event("click")) or function call. If no specific action is described in the user request, you must provide a dummy click event like Event("click") instead of passing null or omitting the parameter.
  1. Surface targeting: Output surface(surfaceId) to specify or target a user interface surface: surface("dashboard-surface-1") root = Card(...)