Kimen pre-v1 home
Menu

Agents write data. Kimen renders real UI.

The component foundation built for generative UI. Your agent emits a JSON spec, a guarded catalog validates it fail-closed, and real, accessible ki-* components render it — in your brand, in any framework.

pnpm add @kimen/elements @kimen/tokens
Get started Open the playground

Pre-v1: not on npm yet. These are the commands v1 ships with; build it from the repository today.

New workspace
eu-west us-east ap-south Invite via link
Create workspace
The preview uses real ki-* components. The spec and its verdict illustrate the guarded renderer. How it works
Components
107
Themes
2 one attribute to switch
Allowed axe violations
0
Browser engines
3
Size budget
Under 10 KB per component
Token-styled
100%

onmars · light

Same spec. Any brand. Light or dark.

Themes are token layers: primitive, theme, semantic, component. One attribute restyles every component; no component CSS changes.

4 components, 1 declared action, 0 issues. Ana GarcíaOwner Mina KatoEditor Leo BrandtPending
Syncedeu-west3 seats
New workspace
eu-westus-east
Invite via link Send a weekly digest
Cancel Create workspace
data-ki-color-scheme="light"

This page runs on @kimen/tokens. Flip it.

Every band is the same markup; only data-ki-theme and data-ki-color-scheme change. Load your own theme as another token layer. Theming guide

Write it yourself, or let your agent compose it.

The same web components serve both. Hand-written UI imports them directly. Agent-written UI goes through the catalog, which turns a spec into components only after it passes validation.

By hand, in any framework

Standards-first custom elements: identical in plain HTML, React, Vue and Angular, with generated, typed wrappers for the three frameworks.

HTML React Vue Angular
// pnpm add @kimen/elements @kimen/tokens
import { defineCustomElement } from '@kimen/elements/ki-button';
import '@kimen/tokens/css';

defineCustomElement();

<ki-button variant="primary">Save</ki-button>
import { KiButton, KiInput } from '@kimen/react';
import '@kimen/tokens/css';

<KiInput label="Name" onInput={onName} />
<KiButton variant="primary" onClick={save}>Save</KiButton>
import { KiButton, KiInput } from '@kimen/vue';
import '@kimen/tokens/css';

<KiInput label="Name" v-model="name" />
<KiButton variant="primary" @click="save">Save</KiButton>
import { KiButton, KiInput, TextValueAccessor } from '@kimen/angular';

// standalone component imports: [KiButton, KiInput, TextValueAccessor]
<ki-input label="Name" [formControl]="name"></ki-input>
<ki-button variant="primary" (click)="save()">Save</ki-button>

By agents, through the guarded catalog

Agents emit data, never code. Only catalog components render, only declared actions dispatch, and protocol adapters translate A2UI and MCP Apps into the same path.

Render a spec A2UI MCP server
import { renderUiSpec } from '@kimen/catalog';

const result = renderUiSpec(spec, {
  surface: document.querySelector('#genui'),
  onAction: (event) => agent.send(event.action),
});
if (!result.ok) console.warn(result.diagnostics);
import { createA2uiAdapter } from '@kimen/adapter-a2ui';

const adapter = createA2uiAdapter({
  surface: document.querySelector('#genui'),
  onAction: (event, meta) => channel.send(event, meta),
  onError: (error) => channel.send(error),
});
adapter.apply(message); // A2UI 1.0 or v0.9.1
# Build the server from the repository (pre-v1)
pnpm exec nx run @kimen/mcp-server:build

# Point Claude Code, or any MCP client, at it
claude mcp add kimen -- node --permission \
  --allow-fs-read=/absolute/path/to/kimen/packages/mcp-server/dist/kimen-mcp.mjs \
  /absolute/path/to/kimen/packages/mcp-server/dist/kimen-mcp.mjs

# Agents list the catalog, validate specs, render MCP Apps

The guardrail says no, and says why.

validateUiSpec rejects a spec before anything renders, and names the offender and its path so a model can repair it in one round. Select an example to see the recorded validator result.

spec

{ "version": 1,
  "root": { "component": "ki-button",
    "props": { "onclick": "alert(1)" },
    "slots": { "": ["Pay now"] } } }

validateUiSpec(spec)

{ ok: false, issues: [{
    code: 'unknown-prop',
    path: 'root.props.onclick',
    message: 'ki-button declares no prop "onclick"',
    value: 'onclick' }] }

Examples of issue codes: malformed-spec · unknown-component · unknown-prop · invalid-prop-type · unknown-slot · undeclared-action · forbidden-key · size-budget · depth-budget. The validator also rejects getters, functions and shared references.

The ki-* catalog: every component, live.

Rendered from the same tokens the package ships. Hover, focus and click them: every state is the real one. Not screenshots.

Explore the components

Legible to agents, by contract.

Everything a model needs ships with the package and is generated from the source, never written by hand. An API a capable agent can't wire correctly from its description is treated as a defect.

custom-elements.json
Every prop, event, slot and part, machine-readable.
llms.txt llms-full.txt
The library as an index for language models, and all of it in one file.
@whenToUse @whenNotToUse
Usage guidance on every component, inside the contract itself.
@kimen/emitter
A system prompt, a provider-ready JSON Schema and a tool definition derived from any catalog, plus a one-round repair loop.
kimen.dev/llms.txt
# @kimen/elements — Kimen web components

> Kimen web components (ki-*). Standards-first Stencil
> components, tokens-only styling, agent-legible by contract.

Install with `pnpm add @kimen/elements @kimen/tokens`.

## Components

- [ki-button](https://kimen.dev/llms/ki-button.md): trigger the
  single main action of a view, supporting actions in descending
  hierarchy, or confirming/destructive actions through tone.
What only a GenUI-first library does.
Capability Kimen React-only kits Classic WC kits
Runs in any framework — or none Web components, identical in every host React hosts only Yes
Re-theming DTCG token layers — one attribute swaps the theme Varies per library CSS custom props, ad hoc
Agent-legible contracts custom-elements.json + llms.txt + when-to-use, shipped Rare Manifest sometimes, no guidance
Guarded GenUI rendering Schema-validated specs, fail-closed Not a goal Not a goal
Protocol adapters A2UI + MCP Apps (AG-UI via A2UI) — —
Accessibility enforcement 0 axe violations gated in CI, WCAG 2.2 AA target Varies Varies
Size discipline Under 10 KB per component, gated Varies Varies

“React-only kits” are component libraries coupled to one framework. “Classic WC kits” are web-component design systems without agent contracts.

Done means gates exit 0.

Run the quality gates locally with bash scripts/gates/gates-suite.sh

Quality gates
Gate Bar Required
Real-browser tests Chromium, Firefox and WebKit at release, never JSDOM Yes
Accessibility 0 axe-core violations; WCAG 2.2 AA and EN 301 549 targeted Yes
Size budget Under 10 KB per component, measured on packed tarballs Yes
Tokens only Every visual value resolves from a --ki-* token, enforced by lint Yes
Right to left Logical properties only; RTL is the default, not a variant Yes
Mutation testing Changed-core mutation gate: tests that test the tests Not yet

Honest, gated, in the open.

Pre-v1. Build and use the packages from the repository today. The roadmap tracks the first npm release and the remaining protocol adapters.

Read the roadmap
  1. Tokens & themingfour layers, two themes, re-theming proven in CI

  2. Factory hardeningclosing enforcement, mutation, release and sandbox gaps

  3. Core componentsReal ki-* components, contracts and browser tests

  4. Catalog + guardrailschema-validated specs rendered fail-closed

  5. Protocol adaptersA2UI and MCP Apps available; AG-UI streams reach the A2UI adapter

  6. v1.0.0npm with trusted publishing and signed provenance

Capability status

  • Consumer catalog registration: your own components behind a JSON facade, validated and rendered through the same fail-closed guardrail
  • Emitter kit: model-agnostic prompt, catalog-specialized JSON Schema and tool definition so any LLM emits valid specs, with a single-round repair loop
  • Generated framework wrappers: @kimen/react, @kimen/vue and @kimen/angular with typed props, native events and each framework form idiom, drift-gated
  • Schema-constrained guarded renderer: untrusted UI specs render only through the neutral catalog, fail-closed
  • Kimen MCP server: over stdio, agents list and describe the catalog, validate UI specs with correctable issues and render them as MCP Apps surfaces through the guarded renderer
  • Changed-core mutation quality gate in hardening
  • A2UI protocol adapter: declarative A2UI messages render through the guarded renderer
  • MCP Apps adapter: Kimen surfaces reach MCP Apps hosts as self-contained ui:// resources rendered through the guarded renderer
  • Neutral runtime component catalog with schema-validated UI specs at the GenUI boundary
  • Machine-readable Web Components foundation with token-driven theming

Start with one element.

pnpm add @kimen/elements @kimen/tokens