/ceh-ag-ui:build-ag-uifrom ceh-ag-ui
Load this skill when starting a generative-UI frontend for an AG-UI agent: a canvas where the agent answers by placing components from a catalogue. Trigger on "build a UI with AG-UI", "generative UI for my agent", or @ag-ui/client with no canvas yet.
Ships in ceh-ag-ui. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The user types, and the agent answers by placing components. It never writes the markup. The catalogue fixes the set of components at build time, and the theme fixes how they look. The agent chooses which component to show and fills in its content, and it controls nothing else.
How it works over AG-UI: each catalogue entry is sent to the agent as a frontend tool on every run. When the agent calls one, the canvas checks the arguments against that entry's schema, renders the component, and returns a tool result. It then runs the agent again so it can respond.
${CLAUDE_SKILL_DIR}/assets/canvas-template/ into the project (default:
web/ and agent/ at the repo root). Copy it, and edit only the copy.| Seam | Default file | Owns |
|---|---|---|
| Catalogue | web/src/catalogue/ | One file per component: defineComponent({ name, description, schema, example, Component }) |
| Agent connection | web/src/useAgent.ts | One HttpAgent, sends the catalogue as tools, validates the arguments, returns tool results, loops |
| Canvas | web/src/App.tsx | Renders the placed blocks, an empty state with starter prompts, and the chat input that is always there |
| Theme | web/src/theme.css and web/src/global.css | Every colour and font token, and their wiring into Tailwind. Nothing else sets a colour or a font |
The canvas starts with no components placed. It is never blank: the chat input is always there, and the empty state offers starter prompts built from the catalogue.
Invoke the Skill tool with skill="ceh-ui-design:design-ui" and follow its Theme layer, with
one override: the theme is already chosen. Use Meridian without asking, unless the user named
Tidewater or brought their own token file with shadcn's token names. Copy global.css and
meridian/theme.css from that skill's references directory to web/src/global.css and
web/src/theme.css. app.css imports global.css, which imports theme.css first. The template
already has Tailwind, its Vite plugin and UI SDK in package.json. Every colour, font and component
style comes from the tokens, through Tailwind utilities and UI SDK components. Switching later
means replacing theme.css, and no markup changes, so a canvas build never stalls on a
look-and-feel question.
The seven default components cover most answers. Keep the ones the app needs and delete the rest,
removing each from catalogue/index.ts as well.
| Tool | Shows |
|---|---|
show_note | A titled block of prose |
show_stat | One KPI, with an optional change whose colour comes from its sign |
show_table | Records with named columns |
show_list | Short items, ordered or not |
show_key_values | The labelled facts about one item |
show_callout | A message with a semantic tone: info, success, warning or danger |
show_bar_chart | Up to 12 values compared by length, coloured from the theme's chart ramp |
For any component the app needs beyond these, invoke the Skill tool with skill="ceh-ag-ui:add-canvas-component". It holds the rules each entry must pass.
Start both halves with the commands in the template's README.md, then check:
show_note {"title":"t","body":"b","style":{"color":"red"}} renders a note with no style
applied.show_stat {"label":"x"} is refused, and the chat shows the reason.The mock agent (agent/main.py) has no LLM. A message containing a component's phrase places that
component with the example arguments the canvas sends in each tool's metadata. The form
<tool> <json> sends exact arguments.
Any AG-UI server works if it passes the frontend tools through to its model and ends the run as soon as the model calls one. The canvas renders the component and starts the next run itself. To build that server, invoke the Skill tool with skill="ceh-ag-ui:build-ag-ui-agent".
AGENT_ORIGIN and Vite proxies /agent to it, so no CORS setup is needed. If the
real endpoint uses a different path, change the proxy key in vite.config.ts.VITE_AGENT_URL. The server must then allow the canvas's origin.Keep agent/ for testing components, and delete it only when the user asks.
The agent must never be able to change how a component looks. Three layers enforce this, and none of them may be removed:
defineComponent throws at startup if a schema exposes a
style-like key (style, className, color, size, variant, …). When a visual choice is
genuinely needed, it becomes a semantic enum, such as tone in show_callout, and the
component maps it to token utilities.useAgent renders only schema.safeParse(args).data.
Unknown keys are stripped, so an agent that sends style or className gets a normal render
without them. Invalid arguments render nothing, and the agent receives an error: tool result
it can correct from.show_bar_chart, and that comes from a number the schema already validated.MAX_TOOL_ROUNDS (5) caps the runs per message, so an agent stuck in a render-reject loop
stops.useMemo) and unsubscribe in the effect's cleanup. StrictMode runs
effects twice in development.abortRun(). It does not remove components that were already placed.A canvas (web/) and a mock agent (agent/) in the project, or the same four seams added to the
user's template. The work is done when:
design-ui, and no component carries a hard-coded style.ceh-ag-ui:add-canvas-component, and the real
agent server to ceh-ag-ui:build-ag-ui-agent.ceh-ag-ui:add-live-state-panel). It can also get approval steps, where the agent pauses
until the user decides (ceh-ag-ui:add-human-approval).assets/canvas-template/README.md (opens in a new tab)assets/canvas-template/agent/main.py (opens in a new tab)assets/canvas-template/agent/pyproject.toml (opens in a new tab)assets/canvas-template/web/index.html (opens in a new tab)assets/canvas-template/web/package.json (opens in a new tab)assets/canvas-template/web/src/App.tsx (opens in a new tab)assets/canvas-template/web/src/app.css (opens in a new tab)assets/canvas-template/web/src/catalogue/bar-chart.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/callout.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/define.ts (opens in a new tab)assets/canvas-template/web/src/catalogue/index.ts (opens in a new tab)assets/canvas-template/web/src/catalogue/key-values.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/list.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/note.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/stat.tsx (opens in a new tab)assets/canvas-template/web/src/catalogue/table.tsx (opens in a new tab)assets/canvas-template/web/src/main.tsx (opens in a new tab)assets/canvas-template/web/src/ui.ts (opens in a new tab)assets/canvas-template/web/src/useAgent.ts (opens in a new tab)assets/canvas-template/web/tsconfig.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/add-canvas-componentLoad this skill when adding or changing a component in an AG-UI canvas catalogue: a card, chart, or form the agent can place on screen. Trigger on "add a component the agent can show", "let the agent render a <thing>", or an edit under `catalogue/`./add-human-approvalLoad this skill when an AG-UI agent must stop for the user's decision before an irreversible or costly step (a delete, a payment, a send), using AG-UI 1.0 interrupts and resume. Trigger on "ask the user before", "human in the loop", "approval step"./add-live-state-panelLoad this skill when adding a live panel to an AG-UI canvas: one fixed area the agent keeps updating while it works, wired from STATE_SNAPSHOT and STATE_DELTA. Trigger on "show the agent's progress live", "shared state", "sync state with the agent"./build-ag-ui-agentLoad this skill when building or fixing the agent server behind an AG-UI canvas: an endpoint that calls an LLM with the canvas's frontend tools and streams AG-UI events over SSE. Trigger on "build the AG-UI server", "connect Claude to my canvas", "replace the mock agent".npx claudepluginhub cheneeheng/ceh-claude-code-library --plugin ceh-ag-ui