Docs menu

Guides


Primitives
Forms
Layout
Feedback
Overlays
Navigation
Data Display
AI

AI agents

Kernel is built to be used by coding agents as well as people. Every component's exact API is generated from its source, the conventions are the same across all of them, and there's a checker that tells an agent what it got wrong and how to fix it. You don't need to paste docs into a prompt.

Set up a project in one step

npx @kernelui-lib/cli agents

This does three things, each of which you can also do on its own:

  • Installs Kernel's skills into.claude/skills. They ship inside@kernelui-lib/react and @kernelui-lib/elements, so they always match the version you installed:kernel-ui (building), kernel-ui-theming,kernel-ui-migrate (from shadcn/ui or Radix) andkernel-ui-elements.
  • Registers the Kernel MCP server, so the agent can look components up instead of guessing.
  • Adds a short Kernel section to AGENTS.md(and CLAUDE.md if you have one). Codex, Cursor, Copilot and most other agents read AGENTS.md.
npx @kernelui-lib/cli agents                   # Claude Code: .claude/skills + .mcp.json
npx @kernelui-lib/cli agents --client cursor   # Cursor: .cursor/mcp.json
npx @kernelui-lib/cli agents --client vscode   # VS Code: .vscode/mcp.json
npx @kernelui-lib/cli agents --client codex    # Codex: .codex/config.toml
npx @kernelui-lib/cli agents --dir .agents/skills --no-mcp   # skills only, anywhere

Claude Code plugin

To have Kernel in every Claude Code project rather than one, install it as a plugin. The Kernel repository is a plugin marketplace. Inside a Claude Code session, run:

/plugin marketplace add kemiljk/kernel-ui
/plugin install kernel-ui@kernel-ui

Or from your shell:

claude plugin marketplace add kemiljk/kernel-ui
claude plugin install kernel-ui@kernel-ui

The plugin bundles the same four skills (they appear askernel-ui:kernel-ui, kernel-ui:kernel-ui-theming,kernel-ui:kernel-ui-migrate andkernel-ui:kernel-ui-elements) and the Kernel MCP server, run with npx -y @kernelui-lib/cli@latest mcp. Its version follows @kernelui-lib/react, so the skills update with each release; claude plugin update kernel-ui picks up a new one. The plugin's skills describe the latest release. If a project is pinned to an older Kernel, use npx @kernelui-lib/cli agents there instead, which installs the skills from the version innode_modules.

The MCP server

npx @kernelui-lib/cli mcp runs a Model Context Protocol server over stdio. It answers from data bundled into the CLI, so it works offline and matches the version you installed. To add it to any MCP client by hand:

{
  "mcpServers": {
    "kernel": { "command": "npx", "args": ["-y", "@kernelui-lib/cli", "mcp"] }
  }
}

Codex reads TOML instead:

# .codex/config.toml (or ~/.codex/config.toml)
[mcp_servers.kernel]
command = "npx"
args = ["-y", "@kernelui-lib/cli", "mcp"]
Tools the Kernel MCP server provides.
ToolWhat it gives the agent
list_componentsEvery component, with its category and summary
search_componentsThe right component for a need in plain words, like "date range" or "tool approval"
get_componentExact React props (types, defaults, notes), custom element attributes and events, why the component uses its native element, and migration notes
get_tokensDesign tokens with their values and what each is for
get_conventionsInstall steps and the conventions every component shares
check_codeA review of code the agent just wrote, with each fix spelled out

Let the agent check its own work

kernel check (and the MCP check_code tool) catches the mistakes agents make most often, and says how to fix each one: props from other libraries (asChild,leftIcon), invalid values, fields without a label, icon-only buttons without a name, clickable <div>s, raw colours and hand-picked radii. It exits with an error when it finds one, so it also works in CI.

npx @kernelui-lib/cli check src/**/*.tsx

Lint rules

For the same checks in your editor and CI on every save, add the ESLint plugin. It recognises Kernel components by their import, and every message says how to fix the problem.

// eslint.config.js
import kernel from "@kernelui-lib/eslint-plugin";

export default [kernel.configs.recommended];
Rules in kernel.configs.recommended.
RuleCatches
no-foreign-props (error)Props from other libraries: asChild, leftIcon, isDisabled…, with Kernel's equivalent
valid-prop-values (error)Values a prop doesn't accept, such as variant="primry"
field-requires-label (error)Form fields without label
icon-button-requires-label (error)Icon-only Buttons without aria-label
no-clickable-non-interactive (error)Click handlers on <div>s and other non-controls
no-unknown-props (warn)Props a component doesn't have, with the closest real one
no-raw-colors (warn)Raw colours in inline styles instead of tokens
prefer-kernel-components (warn)shadcn/ui and Radix imports Kernel replaces

Agents that use your UI

Everything above helps an agent build with Kernel. To let an agent use the UI you built, from inside the page, add theagent bridge. It gives the agent a snapshot built from roles, names and states, act() steps that fire real events, prompts a person must approve before risky steps, and experimental WebMCP tools.

A prompt that works

If your agent doesn't have the skills or MCP server yet, start with this:

Build this UI with Kernel UI (@kernelui-lib/react). Before writing markup,
look up components and their exact props with the kernel MCP server (or
npx @kernelui-lib/cli docs <name> --markdown). Style only with --kernel-*
tokens. When you're done, run npx @kernelui-lib/cli check on the files you
changed and fix what it reports.

Machine-readable docs

  • /llms.txt: what Kernel is, when it fits, and an index of every page
  • /llms-full.txt: every guide and component page in one file
  • Any page as markdown: add .md to its URL, for example /components/button.md
  • /api.json: every component's exact props, attributes and events, generated from source
  • /registry.json: the component catalogue, with shadcn aliases and migration notes
  • /r/registry.json: the same components as a shadcn registry, which the shadcn CLI and the shadcn MCP server can browse and install from
  • llms.txt and skills/ inside each npm package, versioned with the code