Getting started
AI agents
Give Claude, Cursor, Codex and other coding agents the context to use CodeAtlas UI correctly, through skills, llms.txt and the agent guide.
The API is designed so a language model gets it right on the first try. A component name says what the screen is (AppList, AppForm, AppSettings, PageShell), props are data, and snippets are the holes you fill. There are no styling decisions to guess: colors, spacing and radius come from --ca-* tokens.
Typed props are the first source of truth. The package ships TypeScript declarations for every component, so an agent with editor or svelte-check feedback sees the exact prop names, unions and defaults.
Start here
One entry point: /llms.txt. It opens with a recipe for every screen type (app shell, list, form, settings, auth, dashboard, landing, theming), then the decision tables and the common workarounds, and only then the page index. An agent asked to build a screen copies the recipe whole and changes data, copy and theme. Before it writes CSS, a wrapper, a setTimeout or a // ca-ui-workaround, it checks the two tables.
Machine-readable docs
This site publishes its documentation in plain text for tools that cannot render pages.
| Resource | Content |
|---|---|
/llms.txt |
The canonical entry: recipes, decision tables, workarounds, endpoints, then one line per documentation page. |
/llms-full.txt |
The pages an agent reads before it writes a screen in full (introduction, installation, recipes, choosing, workarounds, theming, mobile, i18n, this page, layout primitives), then a summary of every other page: its description and the names, types and defaults of its props. It stays under 350 KB however many pages there are, so it is safe to paste whole. Followed by the rules for an app that uses the package. |
/llms/<group>/<slug>.txt |
One page with the complete source of its demos, for example /llms/layout/form-page.txt. The slug is the docs URL path; every page in llms-full.txt links its own file. |
/api/v1/endpoints.json |
The machine-readable endpoints that exist: gallery index, demo catalog, demo source and the search index. Any other path under /api/v1/ is a 404. |
| Contributor guide | AGENTS.md in the repository: how to work on this package (issue workflow, tests). Not for apps that consume it. |
An app gets its own rules file: bunx @codeatlasdev/ui init --write creates AGENTS.md (or adds a block between <!-- codeatlas-ui:start --> and <!-- codeatlas-ui:end --> to the one you have, leaving the rest alone) with the rules above and the link to /llms.txt. Run it again after an upgrade and only that block is replaced.
Every page is also linked with <link rel="alternate" type="text/plain" href="/llms.txt"> in its head.
MCP server
ca-ui-mcp is a local Model Context Protocol stdio server that ships with the package. It reads the manifests generated from the component source at build time (components.json, tokens.json and guides.json), so it works offline and always matches the installed version.
| Tool | Returns |
|---|---|
get_recipe |
A complete page for a screen type (app-shell, list-page, form-page, settings-page, auth-pages, dashboard, landing-page, theming) with its rules. Call it first when asked to build a screen. Without a name it lists the recipes. |
list_components |
Every component with its import path and a one-line description; a deprecated one says DEPRECATED and what replaces it. Optional query filter. |
get_component |
One component’s import path, props (type, default, bind: or not, docs), snippets and styling (stable ca-* parts, scoped variables, data-* attributes; see list_parts), plus deprecated (the replacement) when it is deprecated. The name is case-insensitive and forgives spaces, - and _: get_component("app list") finds AppList. |
get_export |
Signature and summary of any non-component export: functions, stores, constants and types of every entry point (setLocale, toast, caErrorPlugin from /vite, createErrorHandler and nativeFeel from /kit, primeKeyboard from /actions). Without a name it lists them all with their import path. |
list_parts |
The official override surface of a component: the stable ca-* parts you may target in app CSS, its component-scoped --ca-* variables and data-* attributes, and the internal parts (ca-x-*, @keyframes) that can change in any release. Without a component it lists every component with its counts. Call it before writing a .ca-* selector. |
get_migration |
The breaking changes between two majors (from, to): before, after, why, and whether codeatlas-ui migrate --from --to rewrites each one (yes, partial, no). Call it before upgrading a project that is not on the latest major. See Upgrade between majors. |
get_equivalent |
What replaces a React UI component (shadcn/ui, Radix, Base UI or MUI): the target components with their import path, the prop renames, and for the nine the library lacks, the gap issue and a workaround. The name is a shadcn component (Dialog), a Radix or Base UI package (@radix-ui/react-dialog) or an MUI name (Autocomplete). Without a name it lists every shadcn component. |
search_tokens |
--ca-* design tokens matching a name, value or section, with light and dark values (the first 60 matches). |
list_surfaces |
The surface styles (<html data-style>: glass, frosted, solid, flat, outlined, neumorphic, clay, tonal, chrome) with the blur each draws (full, reduced, none), the tokens it rewrites and the design recipes that default to it, generated from the [data-style] selectors in materials.css. Optional query filter. The answer also carries the per-platform defaultStyle note: backdrop blur on Tauri for Linux (WebKitGTK) is [INFERENCE: validate with feature detection]. |
get_guide |
A documentation page as markdown, with the complete source of its demos, by slug (getting-started/theming) or title. Without a name it lists every guide. |
search_demos |
Numbered demos (#NNN) by motion name or alias, title, summary, tags or component. See Pick a demo by number. |
search_ui |
The gallery index: words plus facet filters (kind, subtype, style, motion, interaction, layout, colorMode, density, tech, cost, component). Values of one facet are alternatives, facets combine. Returns the match count and #id title. |
list_facets |
Every filter facet with its values and counts; pass a query or filters to see the counts for that selection. |
get_related |
Entries related to a numbered demo: named relations first, then shared subtype, style and components. |
get_demo |
The source and spec of up to 8 demos by id. |
get_style |
A design style as markdown by id or title (swiss, editorial, brutalism, sketchbook, glassmorphism, terminal): origin, traits, do and don’t, accessibility pitfalls with their sources and strength labels, where it fits, the designStyle("<id>") recipe and a prompt. Without a name it returns the digest of every style. The same text is at /llms/styles.txt; the pages are at /styles/. |
report_issue |
Drafts a sanitized GitHub issue when the library gets in the agent’s way: markdown body, the redactions applied, a prefilled form link and a gh issue create command. It never posts. See Reporting problems. |
Prop names are never guessed: an agent asks the server and gets the types the compiler sees.
claude mcp add codeatlas-ui -- npx -y -p @codeatlasdev/ui ca-ui-mcp{
"mcpServers": {
"codeatlas-ui": {
"command": "npx",
"args": ["-y", "-p", "@codeatlasdev/ui", "ca-ui-mcp"]
}
}
}{
"mcpServers": {
"codeatlas-ui": {
"command": "npx",
"args": ["-y", "-p", "@codeatlasdev/ui", "ca-ui-mcp"]
}
}
}If the package is already a dependency of your app, point the command at the local binary instead (node_modules/.bin/ca-ui-mcp) to skip the download and pin the version your code compiles against.
The same data is available as files: @codeatlasdev/ui/components.json (components under components, every other export under exports) and @codeatlasdev/ui/tokens.json (tokens).
Pick a demo by number
Every docs demo has a stable id #NNN (index: /api/v1/catalog.json, gallery: /gallery/). An id, a ?pick=012,045 link and pasted “I picked these N from the @codeatlasdev/ui gallery” text are the same selection.
- Unknown id:
search_demos({ query })(MCPca-ui-mcp). Known ids:get_demo({ ids }), at most 8 per call. Without MCP, fetchhttps://ui.codeatlas.com.br/api/v1/en/e/NNN.txt. - Port: keep component names, props, variants and motion tokens as in the reference; change only data, copy and theme. Keep the first comment line (license) of the reference in the file you write.
- Report one line per demo:
#NNN title → file, what changed, demo link.
get_demo takes ids as 12, 012, #012 or a docs URL ending in #<slug>. In Claude Code the plugin installs the skill and the MCP server in one line:
/plugin install codeatlas-ui --marketplace codeatlasdev/ui
Motion demos also carry Names (a canonical name and aliases, other languages included) and a Motion list with the exact property, duration, easing, delay, stagger or spring. search_demos matches a name or alias first, so “fade rise” finds #256 before any summary does. The prompt tells the agent to reproduce those values exactly and to render the final state under prefers-reduced-motion. See Motion.
Each reference carries a Spec list written from the demo’s literal values (props, snippets, state, counts, sizes), so the agent can check its port against it. get_demo and the /api/v1/en/e/NNN.txt page print it under What it shows and When to use.
To choose pages without leaving the terminal, run the pick command. It opens the gallery, waits for you to press Send to AI, and prints the ids:
bunx @codeatlasdev/ui pick # opens /gallery/, prints: #005 #012
bunx @codeatlasdev/ui pick 12 45 # same, with #012 and #045 already ticked
The command listens on 127.0.0.1 only, on a random port, and the callback link carries a random per-run token: a request without the token gets a 403 and the listener keeps waiting. It closes after the first valid pick, after --timeout <seconds> (600 by default) or on Ctrl-C, and exits with code 1 if nothing was picked. The gallery only shows Send to AI for a loopback cb address. --url <gallery> points it at another deployment.
When the library gets in the way
The agent writes a workaround marked // ca-ui-workaround(#<n>): <why> and drafts a sanitized issue with report_issue, with neutral names only. bunx @codeatlasdev/ui workarounds later lists the markers and which issues are closed. Details and the privacy rules: Reporting problems.
Set up and migrate with the CLI
bunx @codeatlasdev/ui init
init detects SvelteKit or Astro and wires up what the installation page describes: the theme file, the theme hook or integration, the global.css import, colorScheme.init() and a mobile-ready viewport meta. It creates files that are missing and never overwrites one that exists: it prints a diff instead, and --write applies it. --dir <path> runs it on another project directory. Running it twice changes nothing.
bunx @codeatlasdev/ui migrate # print the diff
bunx @codeatlasdev/ui migrate --write # apply it
migrate rewrites code for renamed APIs by parsing .svelte, .ts, .js and .astro files (it walks src by default, or the paths you pass), so only real references change (not strings or same-named identifiers from other packages). It renames the BrandPreset type to PresetDefinition and moves the deprecated GlassCard, GlassSurface and Row to Card, Surface and Flex; an element with a prop it cannot map is left as it was and listed at the end (file:line, reason, recipe). --strict exits with code 1 when anything was left.
Coming from React? The Migrate from React guide maps MUI, shadcn/Radix and Chakra components, hooks and themes onto this library, and tells the agent how to report what has no equivalent. In MCP it is get_guide("migrate-react").
Install the skills
The repository ships three agent skills that work with Claude Code, Cursor, Codex and other agents that support the skills format:
npx skills add codeatlasdev/ui
| Skill | What it teaches |
|---|---|
codeatlas-ui |
Components, props, layout rules, AppShell and page template patterns, and the anti-patterns to avoid. |
codeatlas-dx |
File structure and size limits so the codebase stays clean. |
codeatlas-writing |
UI copy that does not read like a chatbot wrote it. |
The skill follows main, not your installed version
npx skills add copies the skill and its API.md from the main branch, so they can describe props, tools and exports that your installed @codeatlasdev/ui does not have yet (with 4.1.0 installed, a skill from main already documented the icon snippet of DropdownMenuItem and the report_issue tool, both new in 4.2.0). API.md states the version it was generated for in its first lines. The package you installed is the source of truth: ca-ui-mcp ships inside it and answers for exactly that version, as does node_modules/@codeatlasdev/ui/dist/components.json. Pin the server to your version (npx -y -p @codeatlasdev/ui@<your version> ca-ui-mcp, or node_modules/.bin/ca-ui-mcp), and update the skill with npx skills update after you upgrade the package.
Point your agent at the docs
-
Claude Code. Install the skills above, or add a line to your
CLAUDE.md:This project uses @codeatlasdev/ui (Svelte 5). Start at https://ui.codeatlas.com.br/llms.txt: copy the recipe for the screen you build, check "Choosing a component" and "Common workarounds" before writing CSS or a wrapper. Never write layout CSS; use Flex, Stack, Grid and --ca-* tokens.init --writealready puts this in the project’sAGENTS.md. -
Cursor. Add
https://ui.codeatlas.com.br/llms-full.txtas a custom doc source in Cursor’s settings, or put the same instructions in a project rule so every chat starts with them. -
Other agents. Put the instructions in
AGENTS.md(or your tool’s equivalent) at the root of your app, and let the agent fetchllms.txtwhen it needs a component.
Rules worth repeating to any agent
These come from the agent guide and prevent the most common mistakes:
- Import everything from
@codeatlasdev/ui, never from internal paths. Charts, DataTable and CodeSnippet come from the/charts,/tableand/codesubpaths. Interface sound is opt-in:soundprops do nothing until the app imports@codeatlasdev/ui/soundand showsSoundToggle; never use sound as the only signal. - Import
global.cssonce, in the root layout, and callcolorScheme.init()there. - No layout CSS and no hardcoded colors. Use
Grid,FlexandStackwith a numericgap, and--ca-*tokens. - No inline
paddingormargin. Inline styles are only for dynamic custom properties such asstyle="--bar-w:{pct}%". - Build pages with
AppList,AppForm,AppSettingsorPageShell, not hand-made wrappers. PutAppShellLayoutonly in authenticated route layouts. - Svelte 5 runes only (
$state,$derived,$props). No stores fromsvelte/store, nosvelte:component. - Write for the default style (
solid); glass and frosted are opt-indefaultStylevalues. Only when you blur: never combinewill-change: transformwithbackdrop-filter. ca-*classes are public API: do not rename or remove them.
Tip
Ask the agent to run svelte-check after generating UI. Prop typos and wrong snippet names show up as type errors, which is the fastest feedback loop for both people and agents.
Why it works
- Page-level components: the agent chooses a template, not forty primitives.
- Closed prop vocabularies:
variant,sizeandseverityare string unions, not free-form classes. - One token system: there is one place for color, radius, spacing and type, so output stays consistent across generations.
- Tested for accessibility: components are checked with axe, so generated pages start from an accessible baseline, see Accessibility.