Building with AI agents
VUI ships an agent-ready usage guide so your AI coding assistant produces consistent, token-driven, accessible UI on the first pass instead of reinventing the design system. This page covers using the theme in your own app.
Which guide do I need?
AGENT.md. When you're contributing to the theme itself, see Contributing (humans) and its AGENTS.md (agents).Where the guide lives
The full guide ships inside the npm package at node_modules/@viliha/vui-ui/AGENT.md. The fastest way to wire it up is the ready-made CLAUDE.template.md that comes with the package: copy it to your project root as CLAUDE.md (Claude Code) or AGENTS.md(Cursor, Copilot). It's a one-line @import of AGENT.md, so the rules stay in one place and you never paste them by hand.
# after: npm install @viliha/vui-ui
cp node_modules/@viliha/vui-ui/CLAUDE.template.md ./CLAUDE.md
# or ./AGENTS.md, and your agent reads it automaticallyPrefer a self-contained copy over the @import? Copy AGENT.md itself:
cp node_modules/@viliha/vui-ui/AGENT.md AGENTS.mdAlso on GitHub
AGENT.md is the one you want for consuming VUI downstream.How do I connect the VUI MCP server?
Run npx @viliha/vui-ui mcp and register it with your agent. The package ships an MCP server so an assistant can ask VUI direct questions (how do I install it, what components exist, what props a component takes, how the organizations page is built) instead of reading through node_modules and guessing. These docs ship with it as markdown, so it runs over stdio, needs no API key and no network, and answers for whatever version of the package you installed.
# Claude Code
claude mcp add vui -- npx -y @viliha/vui-ui mcp
# Cursor, Windsurf, or any MCP client (.mcp.json / mcp.json)
{
"mcpServers": {
"vui": { "command": "npx", "args": ["-y", "@viliha/vui-ui", "mcp"] }
}
}Seven tools come with it:
MCP is an addition, not a replacement
CLAUDE.md pointer above. It loads the rules every session; the MCP server answers the follow-up questions on demand. They read the same files, so the two never disagree.What the guide enforces
Package exports vs. reference-app patterns
The package ships the primitives: Button, Input, Select, Dialog, Menu, RecordView, ChartContainer, and theme.css. The app-shell pieces the guide references (SetPageTitle, Breadcrumbs, the sidebar and nav-config, and the AuthCard* auth screens) are reference-app patterns to copy from the backoffice demo rather than package exports. The shipped AGENT.mdmakes this distinction explicit so your agent won't invent imports.