Our Claude Code session made ten calls to the Astryx MCP server, then wrote a support desk dashboard that compiled on the first build. Along the way it read the docs for Table, Badge, Grid and Card, and nobody pasted component docs into the prompt. That is the pitch behind Meta’s Astryx design system. The components ship as npm packages, and the agent gets a CLI, a hosted MCP endpoint and a rule file so it can look up real props instead of guessing them.
This guide wires those pieces together on a clean Ubuntu 26.04 server. We start with Node.js from NodeSource, a Vite React app, the scoped @astryxdesign/cli and a theme. Then we connect Claude Code through init --agent claude and the MCP server, and run astryx doctor on what the agent built. We confirmed every step working on Ubuntu 26.04 with Astryx 0.7.16 and Node.js 24 in November 2026, and we kept the errors we hit along the way, including the unscoped npx astryx trap that catches almost everyone on day one.
Map the pieces before wiring them
Astryx is a React component library that Meta open sourced under the MIT licence, and the agent side is what sets it apart. When we checked the meta/astryx repository on 15 November 2026 it had 28,260 stars, and npm counted 601,912 downloads of @astryxdesign/core for the week of 7 to 13 November. The repo describes it as fully customizable and agent ready. In practice that means four separate surfaces, and you can use any of them alone:
- The npm packages:
@astryxdesign/corefor components, one@astryxdesign/theme-*package per theme, and StyleX as a peer dependency. - The CLI,
@astryxdesign/cli, which installs two bins,astryxand a genericcli, and answers in plain text that both humans and agents can parse. - The hosted MCP server at
https://astryx.atmeta.com/mcp, with two tools:searchandget. - The agent docs:
astryx init --agent claudewrites a managed block into the rootCLAUDE.mdwhen one exists, otherwise into.claude/CLAUDE.md, and a Claude Code plugin adds anastryxskill.
The order matters for the wiring. The packages make the app render, the CLI makes the project inspectable, and the MCP server plus the rule file give Claude Code a way to reach that knowledge. The piece that ties this together is the rule file, because it tells the agent to use the other three. If you only want components in a hand-written app, stop after the theme section and skip the agent half entirely.
Prerequisites
We ran the lab on a 4 vCPU, 16 GB Ubuntu 26.04 cloud VM with a 30 GB disk, which is roomy for one Vite project and a headless browser. You’ll need the following before starting:
- Ubuntu 26.04 (or 24.04 with a newer Node, covered below) and a user with sudo.
- Node.js new enough for the CLI’s engines field, which asks for 22.13.0 or later.
- Claude Code installed and signed in for the agent half. Our Claude Code cheat sheet covers the flags used later.
A browser on the server is optional, because we previewed the build headless and took the screenshots with Playwright on the same machine.
Install Node.js from NodeSource
Ubuntu 26.04’s own archive is good enough to run Astryx, which surprised us. The nodejs package in universe is the 22.x line, and that clears the CLI’s minimum:
apt-cache policy nodejs
The candidate comes from resolute/universe:
nodejs:
Installed: (none)
Candidate: 22.22.1+dfsg+~cs22.19.15-1ubuntu1
Version table:
22.22.1+dfsg+~cs22.19.15-1ubuntu1 500
500 http://europe-west1.gce.archive.ubuntu.com/ubuntu resolute/universe amd64v3 Packages
We installed it, ran the CLI once through npx and it answered in 10 seconds. The catch is npm: the distro ships npm 9.2.0, which is old next to what Vite and current tooling expect, so we purged it and moved to NodeSource’s Node.js 24 LTS. The first two lines below only matter if you installed the distro packages; on a clean server start at curl. The Node.js on Ubuntu and Debian guide compares every install method if you prefer nvm or fnm.
sudo apt-get purge -y nodejs npm
sudo apt-get autoremove -y
curl -fsSL https://deb.nodesource.com/setup_24.x -o nodesource_setup.sh
sudo -E bash nodesource_setup.sh
sudo apt-get install -y nodejs
Check both binaries, since the point of the switch is the much newer npm that Node 24 bundles:
node --version; npm --version
The output shows Node 24 with npm 11:
v24.22.3
11.19.1
On Ubuntu 24.04 the archive gives you Node 18, and that one fails. We booted a second VM to confirm it, and the CLI refused to start after a wall of EBADENGINE warnings from its dependencies:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=20.19.0' },
npm WARN EBADENGINE current: { node: 'v18.19.1', npm: '9.2.0' }
npm WARN EBADENGINE }
astryx requires Node.js >=22.13.0 (you have v18.19.1). Please upgrade Node and try again.
The same NodeSource commands fix it on 24.04. Is this machine a fresh Ubuntu 26.04 workstation rather than a build box? Then the Ubuntu Desktop 26.04 lab-tested guide is the longer treatment, covering Node.js 24, Chrome, Docker and the rest of a daily development desktop.
Skip the unscoped npx astryx package
Always call the CLI by its scoped name, @astryxdesign/cli, until it’s installed in your project. The unscoped astryx package on npm belongs to someone else. It is an empty placeholder at version 0.0.0 with no description and an unrelated maintainer. Running npx astryx in an empty folder pulls that placeholder, and npm 11 fails because the package has no binary to run.

Nothing malicious happened in our run, but a typo-adjacent package name is exactly the kind of thing an agent reaches for when it guesses. The scoped call printed the version and a line saying which CLI and Core answered. Once @astryxdesign/cli is a dev dependency, npx astryx resolves to node_modules/.bin/astryx and the short form becomes safe inside that project only.
Scaffold a React app with Vite
Astryx needs React 19 or newer. The Vite react-ts template already ships React 19, so it is the fastest base to test against. The --no-interactive flag stops the scaffolder from asking questions, which matters when an agent or CI job runs it:
cd ~
npm create vite@latest astryx-demo -- --template react-ts --no-interactive
cd astryx-demo
npm install
create-vite 9.3.4 scaffolded the project, and the install pulled in 28 packages in about 9 seconds:
added 28 packages, and audited 29 packages in 9s
9 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Leave vite.config.ts as generated. Astryx ships precompiled CSS, so the plain path needs no StyleX or Babel plugin in the build. That changes only if you eject components later, which the swizzle section covers.
Install the Astryx packages
We set the Astryx version in a variable. The project shipped five releases between 10 and 14 November 2026, so naming one version keeps every package in the app on the same Core. npm still writes a caret range such as ^0.7.16 into package.json; the lockfile holds the exact versions, and adding -E to each install saves them exact if you want the manifest pinned too:
export ASTRYX_VERSION="0.7.16" #https://github.com/meta/astryx/releases
npm install @astryxdesign/core@${ASTRYX_VERSION}
npm install @stylexjs/stylex@^0.19.0 @astryxdesign/theme-neutral@${ASTRYX_VERSION}
npm install -D @astryxdesign/cli@${ASTRYX_VERSION}
npm 11 printed one warning per package that has a postinstall script, because those scripts are not yet on an allowScripts list. The install still completed. Confirm the tree, and look for StyleX sitting next to Core rather than missing:
npm ls @astryxdesign/core @astryxdesign/cli @astryxdesign/theme-neutral @stylexjs/stylex
Every Astryx package resolves to the same Core, deduped:
[email protected] /home/eugene/astryx-demo
├─┬ @astryxdesign/[email protected]
│ ├── @astryxdesign/[email protected] deduped
│ └─┬ @stylexjs/[email protected]
│ └── @stylexjs/[email protected] deduped
├─┬ @astryxdesign/[email protected]
│ └── @stylexjs/[email protected] deduped
├─┬ @astryxdesign/[email protected]
│ └── @astryxdesign/[email protected] deduped
└── @stylexjs/[email protected]
Next, load the base styles. Vite’s template imports src/index.css from main.tsx already, so replace that file’s demo styles with the two Astryx stylesheets:
vim src/index.css
The whole file is two imports:
@import '@astryxdesign/core/reset.css';
@import '@astryxdesign/core/astryx.css';
Without these, components render unstyled. The theme stylesheet is not here on purpose: the next step generates a module that imports it for you.
Add a theme and wire it to the app root
Themes are separate npm packages, and the CLI wires them into a generated file. The getting started docs list seven built themes: neutral, butter, chocolate, gothic (dark only), matcha, stone and y2k, and npx astryx theme list prints the same set. Add the one you already installed:
npx astryx theme add neutral
The command writes src/astryx-themes.ts and prints the exact wrapper to put around your app:
default: neutral
modulePath: src/astryx-themes.ts
action: add
slug: neutral
changed: true
firstAdd: true
Wire the generated module once in the app root:
import {Theme} from '@astryxdesign/core/theme';
import {themes, defaultThemeSlug} from './astryx-themes';
<Theme theme={themes[defaultThemeSlug]}>
<App />
</Theme>
We wanted a second theme, so we tried theme add matcha straight away. It refused, because the CLI only wires themes whose package is present. Install the package first, then add it and make it the default:
npm install @astryxdesign/theme-matcha@${ASTRYX_VERSION}
npx astryx theme add matcha
npx astryx theme use matcha
The generated module now imports both themes, their stylesheets and font files, and sets the default slug. Do not edit it by hand, because the CLI rewrites it on the next theme command.
/**
* @generated by `astryx theme` - do not edit manually.
* @astryx-theme-record {"themes":{"neutral":"@astryxdesign/theme-neutral","matcha":"@astryxdesign/theme-matcha"},"defaultThemeSlug":"matcha"}
*/
import {neutralTheme as _astryxTheme0} from "@astryxdesign/theme-neutral/built";
import "@astryxdesign/theme-neutral/theme.css";
import "@astryxdesign/theme-neutral/fonts.css";
import {matchaTheme as _astryxTheme1} from "@astryxdesign/theme-matcha/built";
import "@astryxdesign/theme-matcha/theme.css";
import "@astryxdesign/theme-matcha/fonts.css";
export const themes = {
"neutral": _astryxTheme0,
"matcha": _astryxTheme1,
} as const;
export type ThemeSlug = keyof typeof themes;
export const defaultThemeSlug: keyof typeof themes = "matcha";
Now wire the module into the app. We put the Theme wrapper inside App itself rather than main.tsx, so a mode state can flip light and dark. Open the component:
vim src/App.tsx
Replace the Vite demo with a card, a heading, a line of text and two buttons:
import {useState} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {Button} from '@astryxdesign/core/Button';
import {Card} from '@astryxdesign/core/Card';
import {Heading, Text} from '@astryxdesign/core/Text';
import {VStack} from '@astryxdesign/core/Layout';
import {themes, defaultThemeSlug} from './astryx-themes';
export default function App() {
const [mode, setMode] = useState<'light' | 'dark'>('light');
return (
<Theme theme={themes[defaultThemeSlug]} mode={mode}>
<VStack gap={4} padding={6}>
<Card padding={4}>
<VStack gap={2}>
<Heading level={1}>Hello Astryx</Heading>
<Text>Theme: {defaultThemeSlug}, mode: {mode}</Text>
<Button label="Primary action" variant="primary" onClick={() => alert('Hi!')} />
<Button
label={mode === 'light' ? 'Switch to dark' : 'Switch to light'}
onClick={() => setMode(m => (m === 'light' ? 'dark' : 'light'))}
/>
</VStack>
</Card>
</VStack>
</Theme>
);
}
It built in 727 ms once we fixed one type error: our first version had a bare <Heading>, and the component needs a level prop, covered in the errors section. That small app is the starting point the agent rewrites later.
Query components from the CLI
Every lookup an agent needs is a CLI command that prints structured plain text, which is why the same binary serves people and models. npx astryx manifest --json listed 17 commands in our install. These are the ones we used most:
| Command | What it answers |
|---|---|
npx astryx search "data table" | Components, hooks, docs and templates matching a phrase, each with its import path |
npx astryx component Card --props | The props table for one component, or several at once |
npx astryx template --list | Page templates such as dashboard, login, ai-chat and canvas-editor |
npx astryx docs styling-overview plain | One docs topic, here the exact CSS imports for the plain path |
npx astryx doctor | Project health: peers, agent docs, themes, CLI on the path |
npx astryx manifest --json | Every command and flag as JSON, for tools that call the CLI |
Search is the one that shows the design. Each hit prints the domain, package, import path and the next command to run:
npx astryx search "data table"
It found 337 matches and printed the top 20, starting with the Table component and its sort hook:
Results for "data table" (20 of 337)
name: Table
domain: component
package: @astryxdesign/core
import: @astryxdesign/core/Table
description: Table displays structured data in rows and columns with consistent dimensionality. It supports rich cell content, sorting, selection, pagination, and column management through a composable plugin system. Use Table for data sets with uniform structure; for simpler or inconsistent data, consider a list or card layout instead.
command: npx astryx component Table
name: useTableSortableState
domain: hook
package: @astryxdesign/core
import: @astryxdesign/core/Table
description: Owns a Table's sort state and sorts the rows locally, as a convenience layer over useTableSortable.
command: npx astryx hook useTableSortableState
Templates are the faster start for whole pages. npx astryx template login ./src/app copied a login page into src/app/page.tsx and told us to install @heroicons/react, which the template imports. Read that line, because skipping it breaks the build.
Eject a component only when props run out
astryx swizzle copies a component’s source into your repo so you can change it freely, and it is the one command here that changes how your build works. We ran it on Button to see what lands:
npx astryx swizzle Button
It copied 24 files into components/astryx/Button/ and ended with a warning worth reading twice:
[ok] Copied 24 files to components/astryx/Button/
What @astryxdesign/core exports is imported from @astryxdesign/core; the internal modules the component needs are copied beside it.
You can now customize the component source freely.
! These components use StyleX and require a StyleX compiler in your build.
Without one, importing them throws "Unexpected 'stylex.create' call at runtime"
and the page does not render. See setup per framework:
npx astryx docs styling
So the trade is explicit. The package stays a dependency you upgrade, and an ejected component becomes your code plus a StyleX compiler in the build. We left the copy in place without importing it, and it shows up again in the doctor results below. Reach for theme overrides and props first, and swizzle only when neither can express the change.
Point Claude Code at Astryx
Claude Code reaches Astryx three ways, and we wired all three because they do different jobs. The rule file tells the agent how to work, the MCP server answers its lookups from inside the session, and the plugin adds a skill that points at the CLI. The order we used:
- Run
npx astryx init --agent claudein the project to write the rule file. - Register the hosted MCP server with
claude mcp add. - Install the plugin from Meta’s marketplace.
- Check both links with
claude mcp listandclaude plugin list.
Some guides say init asks which agent you use. It does not. It runs non-interactively, and you name the agent with --agent (claude, cursor, codex, muse, hermes or all):
npx astryx init --agent claude
It writes one file and prints the setup steps you’ve already done above:

Our project had no root CLAUDE.md, so init chose .claude/CLAUDE.md; with a root file present, the block lands there instead. It holds a block between ASTRYX:START and ASTRYX:END markers, so init --remove-agents can take it out again without touching your own notes. These are its workflow and first rules from our file, with the em dashes swapped for hyphens:
Astryx v0.7.16 · 174 components
CLI: run every command as `npx astryx <cmd>` (shown below as `astryx ...`).
WORKFLOW - start every page from a template, never from scratch:
1. `astryx build "<idea>"` - names the template to scaffold from and the parts it lacks.
2. `astryx template <name> <path>` - scaffold it; keep its frame, gap and padding; replace the content.
3. `astryx template <Block>` for parts it lacks; `astryx component <Name>` to read props before using one.
Changing an existing page? Keep it: skip step 2 and add blocks/components inside its sections.
Before you deliver a build, run `astryx doctor --built <dir>`; don't deliver it if it fails.
RULES:
- No <div> - components handle all layout and spacing.
- Read `astryx docs layout` before changing a template's frame.
- Dense data = rows (Table, List/Item), not Card-wrapped lists. Badge = counts only.
Commit that file with the project so every teammate’s agent gets the same rules, and then connect the MCP server. The Astryx CLI has no mcp subcommand; the server is hosted on the docs site and speaks streamable HTTP, so Claude Code adds it by URL:
claude mcp add --transport http astryx https://astryx.atmeta.com/mcp
claude plugin marketplace add meta/astryx
claude plugin install astryx@astryx
The server is added to your local config for this project only, and the health check marks it connected. The plugin installs at user scope:

Add -s project to the mcp add command if you’d rather share the server through a committed .mcp.json. The plugin is skill-only, and version 0.1.0 holds a single astryx skill and no MCP config of its own, so it does not replace the server. Our Claude Code MCP servers guide explains the local, project and user scopes in more depth.
Test the MCP endpoint without Claude
When the health check fails, curl tells you whether the problem is the network or the client. The server is stateless and answers an initialize call with server-sent events, so send both JSON and event-stream in the Accept header:
curl -s -X POST https://astryx.atmeta.com/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
A healthy endpoint returns one message event naming the server:
event: message
data: {"result":{"protocolVersion":"2025-03-26","capabilities":{"tools":{"listChanged":true}},"serverInfo":{"name":"astryx","version":"2.0.0"}},"jsonrpc":"2.0","id":1}
A tools/list call to the same URL returned exactly two tools, search (a query and an optional limit) and get (a name and an optional section). That small surface is deliberate: the agent searches, then reads one component’s docs, and never has to load the whole catalogue into its context.
Let the agent build a page through MCP
To see whether the wiring actually changes what the agent writes, we gave Claude Code a page to build with Bash taken away. With no shell, it could not run the CLI. It kept Read, Glob and Grep, yet the log shows it opened only src/App.tsx, so every component fact came through the MCP server. We ran this session from our workstation against a copy of the same project, with only the Astryx MCP server loaded. Save that one server as mcp.json next to package.json before you start:
vim mcp.json
The file holds a single HTTP entry:
{"mcpServers":{"astryx":{"type":"http","url":"https://astryx.atmeta.com/mcp"}}}
Then start the headless session with Bash denied and the MCP tools allowed:
claude -p "Replace src/App.tsx with a support-ticket dashboard page built only from Astryx components: a page header with the title 'Support desk' and a 'New ticket' primary button, a row of three stat cards (Open 42, Waiting on customer 7, Resolved today 18), and a table of five tickets (ID, subject, requester, priority, status) where status shows as a badge. Keep the existing Theme wrapper and the light/dark toggle. Use the astryx MCP tools (search, get) to find the right components and their exact props before you write code. Do not add npm dependencies and do not use raw div or inline style. When done, list the Astryx components you used." \
--mcp-config mcp.json --strict-mcp-config --setting-sources project \
--allowedTools "mcp__astryx__search,mcp__astryx__get,Read,Write,Edit,Glob,Grep" \
--disallowedTools "Bash" --max-turns 40 --output-format stream-json --verbose
The session ran on the claude-opus-5-5 model, took 16 turns and 42 seconds and cost $0.52 in API usage. Its tool log shows the pattern the rule file asks for:
- One broad
searchfor “dashboard page header stat cards table”, thengeton Table and Badge. - Two narrower searches, for a page header and for stat values.
geton Layout, Grid, HStack and Text, then the first write ofApp.tsx.geton Card after writing, followed by two edits that removed a padding override and the Card it had put around the table.
That last step is the interesting one, because the Card docs say not to wrap page sections in cards and the agent corrected its own draft after reading them, without being told. It also reported that it couldn’t run doctor without a shell, which is honest and exactly why we ran it ourselves. This is the file it wrote, unedited:
import {useState} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {Button} from '@astryxdesign/core/Button';
import {Card} from '@astryxdesign/core/Card';
import {Badge} from '@astryxdesign/core/Badge';
import {Grid} from '@astryxdesign/core/Grid';
import {Table, proportional, pixel} from '@astryxdesign/core/Table';
import type {TableColumn} from '@astryxdesign/core/Table';
import {Heading, Text} from '@astryxdesign/core/Text';
import {HStack, VStack} from '@astryxdesign/core/Layout';
import {themes, defaultThemeSlug} from './astryx-themes';
type TicketStatus = 'Open' | 'Waiting on customer' | 'Resolved';
interface Ticket extends Record<string, unknown> {
id: string;
subject: string;
requester: string;
priority: 'Low' | 'Medium' | 'High' | 'Urgent';
status: TicketStatus;
}
const stats = [
{label: 'Open', value: 42},
{label: 'Waiting on customer', value: 7},
{label: 'Resolved today', value: 18},
];
const tickets: Ticket[] = [
{id: 'T-1042', subject: 'Cannot reset password', requester: 'Maria Lopez', priority: 'High', status: 'Open'},
{id: 'T-1041', subject: 'Invoice shows wrong billing address', requester: 'James Chen', priority: 'Medium', status: 'Waiting on customer'},
{id: 'T-1040', subject: 'API returns 500 on bulk export', requester: 'Priya Patel', priority: 'Urgent', status: 'Open'},
{id: 'T-1039', subject: 'Request to add team members', requester: 'Tom Becker', priority: 'Low', status: 'Resolved'},
{id: 'T-1038', subject: 'Mobile app crashes on launch', requester: 'Aisha Okafor', priority: 'High', status: 'Resolved'},
];
const statusVariant: Record<TicketStatus, 'info' | 'warning' | 'success'> = {
Open: 'info',
'Waiting on customer': 'warning',
Resolved: 'success',
};
const columns: TableColumn<Ticket>[] = [
{key: 'id', header: 'ID', width: pixel(96)},
{key: 'subject', header: 'Subject', width: proportional(3, {minWidth: 200})},
{key: 'requester', header: 'Requester', width: proportional(2)},
{key: 'priority', header: 'Priority', width: proportional(1)},
{
key: 'status',
header: 'Status',
width: proportional(2),
renderCell: ticket => <Badge label={ticket.status} variant={statusVariant[ticket.status]} />,
},
];
export default function App() {
const [mode, setMode] = useState<'light' | 'dark'>('light');
return (
<Theme theme={themes[defaultThemeSlug]} mode={mode}>
<VStack gap={6} padding={6}>
<HStack gap={4} hAlign="between" vAlign="center" wrap="wrap">
<Heading level={1}>Support desk</Heading>
<HStack gap={2} vAlign="center">
<Button
label={mode === 'light' ? 'Switch to dark' : 'Switch to light'}
variant="secondary"
onClick={() => setMode(m => (m === 'light' ? 'dark' : 'light'))}
/>
<Button label="New ticket" variant="primary" />
</HStack>
</HStack>
<Grid columns={{minWidth: 200, max: 3}} gap={4}>
{stats.map(stat => (
<Card key={stat.label}>
<VStack gap={1}>
<Text type="supporting" display="block">
{stat.label}
</Text>
<Text type="display-2" display="block" hasTabularNumbers>
{stat.value}
</Text>
</VStack>
</Card>
))}
</Grid>
<VStack gap={3}>
<Heading level={2}>Recent tickets</Heading>
<Table data={tickets} columns={columns} idKey="id" hasHover />
</VStack>
</VStack>
</Theme>
);
}
There isn’t a div, an inline style or a hex value in it, and it kept the Theme wrapper and toggle as asked. One thing to notice: the rule file says “Badge = counts only”, yet the agent used Badge for status text after reading the Badge docs through MCP. The type checker, the build and doctor all accepted it, so treat the rule file as guidance rather than an enforced lint.
Verify the build end to end
We copied the agent’s file onto the Ubuntu server and built it with the project’s own tsc -b && vite build script. It compiled on the first try:
npm run build
The main chunk lands at 669 kB minified (213 kB gzipped), over Vite’s 500 kB warning line:
dist/assets/index-jzH88MuU.css 332.69 kB │ gzip: 49.26 kB
dist/assets/isRtlElement-DWHDpdvb.js 1.33 kB │ gzip: 0.66 kB
dist/assets/Tooltip-Bj2NtQ3D.js 2.12 kB │ gzip: 0.98 kB
dist/assets/ItemSwipeLayer-ERVZJMu8.js 9.70 kB │ gzip: 3.75 kB
dist/assets/focusOutline.stylex-F6OcC8OO.js 27.24 kB │ gzip: 7.79 kB
dist/assets/useLayerDismissal-Uxxi-xGu.js 43.08 kB │ gzip: 15.52 kB
dist/assets/MenuBottomSheet-JA6bJ73R.js 128.91 kB │ gzip: 43.39 kB
dist/assets/index-BzIVsM-O.js 668.65 kB │ gzip: 212.67 kB
[plugin builtin:vite-reporter]
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rolldownOptions.output.codeSplitting to improve chunking: https://rolldown.rs/reference/OutputOptions.codeSplitting
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 987ms
The CSS alone is 333 kB because it carries every component’s styles plus two themes. For a real product, split routes with dynamic imports and keep one theme unless users can switch. We served the build with npm run preview and captured it in headless Chromium through Playwright at 2x scale:

The script headings come from matcha’s display font, and the status colours follow the Badge variants the agent picked. Clicking “Switch to dark” flips the mode prop on the Theme, and every token follows:

If you want the agent to capture pages like this itself, our Chrome DevTools MCP setup on Linux gives Claude Code a headless browser on the same kind of server.
Run doctor on source, not on dist
The rule file says to run astryx doctor --built <dir> before delivering, and the obvious reading is the build output folder. We ran npx astryx doctor --built dist first, and it passed (20 pass, 2 warnings), but its source-quality check reported “Not inspected: 0 source files under dist” and told us to point it at the project folder instead. Run it on the folder that holds the source:
npx astryx doctor --built .
That run read the JSX and raised three warnings and no failures:

None of the findings point at the agent’s code: theme fonts load from an external stylesheet doctor can’t prove, and all 25 purity findings sit in the swizzled Button, which uses stylex.create directly. To isolate the agent’s work we copied only App.tsx, main.tsx and the theme module into a clean folder and ran doctor again. App.tsx had zero findings. The single one left was main.tsx importing ./index.css, the stylesheet the getting-started docs told us to create, so expect that one to stay.
Fix the errors we hit
Each of these came up in the lab, with the exact message and the fix that cleared it. The unscoped npx failure and the Node 18 refusal are covered above.
Property ‘level’ is missing in type … HeadingProps
Astryx’s Heading has no default level, so tsc stops the build when you omit it:
src/App.tsx(16,14): error TS2741: Property 'level' is missing in type '{ children: string; }' but required in type 'HeadingProps'.
Pass the level that matches the document outline, for example <Heading level={1}> for the page title and level={2} for sections. The agent’s page set both levels correctly on its first write, after fetching the Text docs through MCP.
Cannot find module ‘@heroicons/react/24/outline’
Some templates import Heroicons, and astryx template copies the file without installing anything. The build then fails on the import:
src/app/page.tsx(14,24): error TS2307: Cannot find module '@heroicons/react/24/outline' or its corresponding type declarations.
The template command already printed the fix as “Install missing dependencies”. Run it, and the build passes:
npm install @heroicons/react@^2.2.0
Tell your agent to read the template command’s full output, not just its exit code, or it will miss this line.
Theme package “@astryxdesign/theme-matcha” is not installed
theme add only wires packages that exist in node_modules, and theme use only switches to themes already added. The CLI prints the two commands to run, in order: npm install @astryxdesign/theme-matcha, then npx astryx theme add matcha. Pin the theme to the same version as Core when you install it.
Missing StyleX peer builds a broken bundle
With npm 7 or newer, a plain npm install @astryxdesign/core installs @stylexjs/stylex for you as a peer, so most people never see this. It bites when peers are skipped, for example a project that sets legacy-peer-deps. We reproduced it with npm install --legacy-peer-deps, and npm ls showed the gap:
[email protected] /home/eugene/nostylex
└── (empty)
The first build failed on the unresolved import. A clean rerun was worse: Vite built 195 modules without an error and left a bare from"@stylexjs/stylex" in the bundle that no browser can resolve, so the page fails at load time instead of build time. Install the peer explicitly with npm install @stylexjs/stylex, and let npx astryx doctor confirm it under “peer dependencies”.
Upgrade Astryx with the codemods
Astryx is still in the 0.x line and releases often, so upgrades come with codemods. Bump the packages first, then tell astryx upgrade which Core version you came from. It is a dry run unless you add --apply:
npx astryx upgrade --from 0.7.16
On our install there was nothing newer yet, so it reported no work:
Upgrade
From version: 0.7.16
Installed target: 0.7.16 (@astryxdesign/core)
[ok] Already up to date - no codemods to run.
Use --force to run codemods anyway.
Done
After a real bump, review the dry run, then repeat with --apply. Add --install-deps if it reports jscodeshift missing. Run npx astryx init --agent claude again too, so the rule file’s component count and commands match the new release.
Weigh Astryx against shadcn for agent work
Pick Astryx when you want the agent to consume a maintained dependency, and shadcn/ui when you want the agent to own copied source. Both now have an MCP story. shadcn’s MCP server browses and installs registry items into your repo, configured through components.json. Astryx’s server answers lookups, and the code stays in node_modules until you swizzle it. We tested only the Astryx side here, so this table compares design rather than measured agent output:
| Question | Astryx | shadcn/ui |
|---|---|---|
| Where component code lives | npm dependency; swizzle copies source on request | Copied into your repo by the CLI |
| Agent lookups | Hosted MCP with search and get, plus the CLI | MCP server that searches and installs registry items |
| Rules for the agent | init --agent writes a managed block | Official skill (pnpm dlx skills add shadcn/ui) with composition rules |
| Upgrades | astryx upgrade codemods, including a --registry mode for shadcn-copied compositions | Re-add or diff the copied files |
| Styling | Precompiled CSS and themes; StyleX only for ejected components | Tailwind classes in your source |
| Self-check | astryx doctor --built . | Your own lint and type checks |
Don’t take Astryx’s agent focus as proof that agents build better pages with it. Meta’s own vibe tests post scores nightly builds from Astryx, Astryx with Tailwind, a shadcn and Tailwind baseline, and raw HTML. A good night on 10 July 2026 read 98, 97, 95 and 82, while a rough night on 28 June dropped Astryx to 77 overall. The team writes that across the full ledger the baseline actually wins the plurality of nights.
After wiring it end to end, our take is that Astryx earns its place when several people and several agents touch the same product and you need one upgrade path, one theme system and a doctor command everyone runs. For a solo project that already speaks Tailwind, shadcn plus its MCP server is less to set up. If you’re layering more tools on Claude Code, agent-browser for Claude Code and Codex pairs well with either, because it lets the agent look at the page it just built.