a2ui-catalog
БесплатноЗапускает вложенные скриптыНе проверенTurns an app's existing React components into a CopilotKit Gen UI 2.0 generative UI (A2UI 1.0, `createGenerativeUI` on top of `standardUI`), with fixed-schema…
от CopilotKit★ 39 079 звёзд на GitHubОб этом скилле
A2UI catalog: from your React components to Gen UI 2.0 in CopilotKit
Built in a2ui-playground (123 components: CopilotKit's 69 standard ones plus 54 of the app's own; Next 16, CopilotKit 1.85 Gen UI 2.0, A2UI 1.0). Fixed surfaces paint in ~1.4 to 3 s, dynamic in ~3 s first paint with progressive streaming (measured on the v0.9 build of the same pipeline; re-measure after porting). Every step below links to a reference with the real code.
Quick start (minimum path)
One custom component rendering in CopilotKit chat, with the runtime giving a stock agent the render_ui tool. The playground's /minimal page is this path (src/app/minimal/page.tsx, src/app/api/minimal/...slug/route.ts).
- Install:
pnpm add @copilotkit/react-core @copilotkit/runtime @copilotkit/shared zod(zod 3.25+, or zod 4.2+). - Define the component (React-free file). The schema describes the literal value only: the engine resolves
{ "@path" }bindings and{ "@call" }functions at any depth before it validates.export const definitions = { Stat: { description: "One KPI: label, short value, optional delta like '+4%'.", props: z.object({ label: z.string(), value: z.string(), delta: z.string().optional(), }), }, }; - Render it and build the UI (client file). Your component receives the resolved props directly:
import { createGenerativeUI, standardUI, } from "@copilotkit/react-core/v2/generative-ui"; export const ui = createGenerativeUI({ id: "https://example.dev/catalogs/main/v1", extends: [standardUI], components: { Stat: { ...definitions.Stat, component: ({ label, value, delta }) => ( <div className="card"> <span>{label}</span> <strong>{value}</strong> {delta} </div> ), }, }, }); - Pass it to the provider:
<CopilotKitProvider runtimeUrl="/api/copilotkit" generativeUI={{ ui }}><CopilotChat /></CopilotKitProvider>. Every run then carries the catalog inforwardedProps.copilotkit.ui(the tool transport is the default). - Serve a stock agent from a catch-all route (
app/api/copilotkit/...slug/route.ts):
No runtime option is needed: a tool-transport envelope makes the runtime applyconst runtime = new CopilotRuntime({ agents: { default: new BuiltInAgent({ model: "openai:gpt-5.5", prompt: "Answer with UI: call render_ui with A2UI 1.0 operations.", }), }, }); const handler = createCopilotRuntimeHandler({ runtime, basePath: "/api/copilotkit", }); export const GET = handler; export const POST = handler;GenerativeUIMiddleware, which injectsrender_ui, validates each streamed operation against your catalog, and commits it as agenerative-ui-surfaceactivity that the chat paints.
That path has the primary model write the whole surface, and each operation paints when it closes. The workflow below adds what made the playground fast and robust: fixed templates, a dedicated streaming composer, server-side repair, geocoding, and in-place updates.
Workflow
- Inventory components. Run
scripts/scan-components.ts <componentsDir>to draft Zod definitions from the TypeScript props. Keep components an agent would pick to answer a question (cards, charts, tables, inputs). CheckstandardUIfirst: it already has layout, text, form,Chart,Map,TableandList(69 components), and a name can come from one place only. Drop internals (DialogOverlay,SelectTrigger). ->references/definitions-and-descriptions.md - Write definitions. One Zod object + one tight description per component, React-free so the server can import them. Props describe literal values. Child references are
child()/childList(). Callbacks areevents(onAction). Inputs declarewritable: ["value"]. -> same reference - Write renderers. Display renderers read resolved props; children arrive rendered. Input renderers bind two-way:
useBound(props.value, props.setValue, fallback). TheonActionevent arrives asaction(). Never throw on partial data. Use container queries, not viewport breakpoints. ->references/renderers-and-data-binding.md - Create the generative UI.
createGenerativeUI({ id, extends: [standardUI], components })plus athemefor the standard components. Restyle a standard component withoverrides, or drop it withstandardUI.omit([...])and define your own. ->references/wiring-and-runtime.md - Wire provider + runtime.
<CopilotKitProvider generativeUI={{ ui, theme, transport: "tool" }}>on the client;app/api/copilotkit/...slug/route.tswithCopilotRuntime({ generativeUI: false })when your agent writes its own surfaces. Catch-all route or/info404s. ->references/wiring-and-runtime.md - **Fixed-schema surfaces + t
Установить a2ui-catalog в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл a2ui-catalog?
Turns an app's existing React components into a CopilotKit Gen UI 2.0 generative UI (A2UI 1.0, `createGenerativeUI` on top of `standardUI`), with fixed-schema templates for common asks and a streaming dynamic-schema sub-agent for everything else. Use when the user wants the agent to answer with their own components, asks to "add A2UI", "build an A2UI catalog", "createGenerativeUI", "render_ui", "make the agent render our design system", "fixed vs dynamic schema", "generate_a2ui is slow", "migrate from A2UI v0.9", or to debug "Couldn't display this part" / rejected operations / surfaces that never paint. Don't use for open-ended HTML generation (Open Generative UI), for useComponent/useRenderTool controlled gen UI only, or for MCP Apps.
Как установить скилл a2ui-catalog?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл a2ui-catalog запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic