A2ui Core a2ui-core
Core A2UI protocol instructions and syntax rules for UI generation.
- 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.
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.
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
- 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.
- The interface tree must have a single entry point assigned to the reserved variable 'root'.
- Primitives:
- Strings: Quoted with
"or""". Support for\n,\t,\\, and\"escapes. Raw Strings: Prefaced byr(e.g.,r"..."orr"""..."""), with no escape processing. - Numbers: write as integers or decimals, e.g., 42
- Booleans: write true or false
- Null values: write null
- 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").
- Lists: represent as arrays, e.g., [child1, child2].
- 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).
- 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).
- 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").
- Action events: represent server-side actions using the Event helper: Event("save_deal", {rep: $/form/rep})
- Nested functions: call client functions directly using catalog signatures, for example myFunction("value").
- 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.
- 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)
- To delete a user interface surface, output the standalone
deleteSurface(surfaceId)command (no variable assignment): deleteSurface("dashboard-surface-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.
- 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.
- Surface targeting: Output
surface(surfaceId)to specify or target a user interface surface: surface("dashboard-surface-1") root = Card(...)