This document is the authoritative guide for AI agents working within the A2UI repository. It outlines design philosophy, repository structure, and synchronization guidelines.
INSTRUCTION FOR ALL AGENTS (Gemini CLI, Claude, OpenAI, Antigravity, etc.): Before performing any specific tasks, load and read the respective skill recipe file in full:
- For working with Spec-Driven Development (SDD) or repository blueprints: Read blueprints/README.md
- For implementing new SDKs in a client language: Read .agents/skills/a2ui-implement-new-sdks-for-client-language/SKILL.md
A2UI (Agent-to-User Interface) is a platform-agnostic, streaming-first UI protocol designed specifically to allow Large Language Models (LLMs) and autonomous agents to generate user interfaces.
Key capabilities:
- Streaming UI: Progressive rendering of components and values on the fly to minimize latency.
- Two-Way Data Binding: Seamless state synchronization between client and agent.
- Local Function Evaluation: Execution of validation/logic functions registered in Component Catalogs.
The repository supports multiple versions of the A2UI protocol:
- v0.8: Stable specification; not supported by the latest SDKs.
- v0.9: Stable specification; implemented in SDKs; very minor differences from v0.9.1.
- v0.9.1: Latest published and active protocol version implemented by our multi-language SDKs, renderers, and sample clients.
- v1.0: Candidate specification for stable release (previously v0.10).
- Authority Rule: Default to version v0.9.1 as the primary authority when working on SDKs or adapters, unless the user specifies otherwise or a different version is requested.
IMPORTANT: By default, agents should IGNORE the
blueprints/folder unless explicitly instructed by the user to work with blueprints or Spec-Driven Development.
To scale development across multiple programming languages and UI frameworks, the A2UI repository adopts Spec-Driven Development (SDD). Under this methodology:
- Language-Agnostic Blueprints define high-level architecture and features under the
blueprints/directory (blueprints/modules/andblueprints/features/). - Concrete Codebases track their module compliance by git commit hash using a
codebase.blueprint.mdfile stored underblueprints/codebases/<relative_codebase_path>/codebase.blueprint.md. - SDD Skills: SDD skills live in
blueprints/skills/and can be symlinked into.agents/skills/by running./blueprints/link_skills.sh. To remove them when done, remove the.agents/skills/a2ui-*symlinks.
For a detailed explanation of the methodology, lifecycle, and workflows, read the Spec-Driven Development Proposal.
blueprints/: Isolated central repository for language-agnostic module blueprints (modules/), feature blueprints (features/,features/archived/), codebase compliance blueprints (codebases/), and SDD skills (skills/).docs/: Documentation hierarchy. Public site documentation published via MkDocs resides indocs/public/, while non-public contributor or internal documentation resides underdocs/alongsidedocs/scripts/.specification/: Versioned subdirectories (v0_8/,v0_9/,v0_9_1/,v1_0/) containing JSON schemas, component/function catalogs, and human-readable guides. Thespecification/<version>/docs/a2ui_protocol.mdfile is the most important source of truth for each protocol version, and thespecification/<version>/jsondirectory contains the associated schemas for the protocol.agent_sdks/: Server integration SDKs for Python (python/) and core conformance tests (conformance/).kotlin/: Legacy Kotlin agent SDK (agent_sdk_legacy/).renderers/: Shared core state logic (web_core/), Lit renderer (lit/), Angular renderer (angular/), React renderer (react/), markdown parser (markdown/), and placeholder for Flutter (flutter/).samples/: Ready-to-run demo agents utilizing Python ADK (agent/adk/), MCP server (agent/mcp/), and sample clients (client/lit/,client/angular/,client/react/,client/flutter/).tools/: Developer utility suite including visual Editor (editor/), visual Composer (composer/), payload Inspector (inspector/), and catalog builder (build_catalog/).
All Node.js and TypeScript projects inside the repository must be managed as Yarn workspaces registered inside the "workspaces" array of the root package.json.
When creating or modifying workspaces, guarantee strict script uniformity by implementing canonical targets:
"build": TypeScript compilation viawireitortsc -b."lint"/"lint:fix": Standardized to"eslint ."/"eslint . --fix"extending rooteslint.preset.mjsvia moderneslint.config.mjsflat configs. Pure container folders lacking code must cleanly echo"Workspace has no lint configuration."."test": Unit test execution (vitest,node --test). Packages lacking tests must implement the standard auto-detecting Node fallback script to cleanly emit"Workspace has no tests."and exit 0."format"/"format:check": Natively runs local Prettier formatting ("prettier --write ."/"prettier --check .").
New Node Projects: Guarantee that any newly initialized Node/TypeScript project uses Yarn Berry, is situated within the monorepo directory structure, is correctly registered in root "workspaces", and fully defines these five canonical script targets.
Do not use hardcoded or guessed build/run sequences. Each subdirectory contains detailed setup, build, dependency resolution, and execution steps.
- Prerequisite: Consult the
README.mdunderrenderers/to build shared web core and renderer packages before running any web tools or clients. - Running SDKs & Samples: Consult the local
README.mdinside any targeted directory underagent_sdks/,kotlin/,samples/, ortools/for specific run/test/build commands.
As A2UI evolves, keep agent documentation and skills perfectly synchronized with specification and codebase changes:
- Update
AGENTS.mdand associated skill files when specifications, schemas, or directory layouts are added, modified, or removed. - Enforce Yarn workspace script hygiene across all Node packages.
- Suggest updates to the user at the end of your task if any changes affect documented files.
To ensure the integrity, consistency, and high quality of the repository, all agents must adhere to the following core guidelines:
- Prioritize Authoritative Specifications: Always base designs, protocol changes, and implementations on the formal schemas and documents under the versioned
specification/directory (schemas first, catalogs second, protocol guides third) rather than general workspace markdown files. - Maintain Agent-Agnostic Instructions: When creating or modifying agent instruction files, skills, or guides, write them in a generic, vendor-agnostic manner. Avoid proprietary or environment-specific names (e.g., model names, specific tool terms) and use generic terms (e.g., "assistant", "subagent", "retrieval tool").
- Enforce Script Uniformity: Strictly maintain Yarn workspace script hygiene. Ensure all Node/TypeScript packages implement the five canonical targets (
build,lint,lint:fix,test,format,format:check).