Imported from lablup/backend.ai-webui (
react/AGENTS.md). Install upstream withnpx skills add lablup/backend.ai-webui --skill react. Copyright stays with the author.
AGENTS.md
Project-specific guidance for AI coding agents.
Astryx v0.5.4 · 163 components
CLI: run every command as pnpm exec astryx <cmd> (shown below as astryx ...).
SETUP (once, in your app entry e.g. main.tsx) — without these, components render unstyled: import "@astryxdesign/core/reset.css"; import "@astryxdesign/core/astryx.css";
WORKFLOW — discover, don't guess. Before writing UI:
astryx build "<idea>"— START HERE: returns a kit (closest [page] + [block]s + [component]s). No args = full playbook.astryx template <name> [--skeleton]— scaffold the [page]/[block]s it named, or study their layout. Templates are reference code.astryx component <Name>— props + examples for every component you use.
RULES:
- No — components do all layout/spacing, page frame included.
- Frame first: read
astryx docs layoutbefore writing any page or screen — page frame, region widths, breakpoint behavior. - Dense data = rows (Table, List/Item), never Card-wrapped list items; Card is for standalone widgets. Status = StatusDot/Token; Badge = counts only.
- Custom styling: component props first; else the xstyle prop / StyleX tokens (@astryxdesign/core/theme/tokens.stylex). No raw hex/px.
- Tokens for every value (
astryx docs tokens). Brand/accent belongs in the theme (astryx theme list/theme add <slug>, orastryx theme templatefor a custom one) — never override --color-* in :root. - SELF-CHECK before you finish: re-read the file and replace any className=, style={{…}}, raw / layout, imported .css/@apply, or hardcoded #hex/px with the component or the xstyle prop + a token. If unsure a component/prop exists, run
astryx component <Name>/astryx search "<thing>"; don't hand-roll CSS. - MIGRATION RELAXATION (antd → Astryx): the className=/style={{…}} part of the SELF-CHECK is relaxed for files carried over from the antd era, which are still full of
className/ inlinestyleandtheme.useToken()reads. Do not rewrite those wholesale — convert a file's idioms when you are already changing it for another reason. A style that props/xstyle cannot express goes in a co-located.cssfile the component imports (P17), withvar(--…)Astryx tokens; never a runtime style engine. - BUI INTEGRATION (this repo):
backend.ai-uiis registered as an Astryx integration, soastryx component,astryx searchandastryx component --listcover theBAI*wrappers next to core's primitives, andastryx docs backend-ai-uiexplains the layer. Thecomponent --listcount in the generated line below is core's own —astryx initcounts only what core discovers — so the live catalog is larger than the number printed there; run the command to see it. When aBAI*component and a core primitive both fit, use theBAI*one — it carries the project defaults, and it imports frombackend.ai-ui(the Import lineastryx componentprints for it names core — an upstream CLI bug, still present in 0.5.4). A newBAI*component ships a same-stem{Name}.doc.tsbeside its source.
MORE CLI: search "" find any component / hook / doc / template / block component --list 163 components by category template --list page + block recipes docs browser-support, cli-integrations, color, elevation, getting-started, icons, illustrations, internationalization, layout, migration, motion, principles, shape, spacing, styling-libraries, styling, theme, tokens, typography, working-with-ai, backend-ai-ui swizzle eject component source for deep customization upgrade --apply run after any @astryxdesign/core bump
Migration conversion idioms (branch to-astryx)
Some antd patterns have no one-to-one Astryx component and are not allowed
to be dropped ad hoc — they have a standing composition recipe in
.specs/FR-3482-astryx-migration/CONVERSION-IDIOMS.md. Read it before recording a
PILOT-DECISION that gives up a layout capability. Currently:
- antd vertical tabs (
tabPosition/tabPlacement="left" | "start") → the Astryxsettings-sidebartemplate composition (Layout+LayoutPanelnav column ofList/ListItem isSelected+LayoutContentpane), not a horizontalTabList. Runpnpm exec astryx template settings-sidebar. The "discover, don't guess" workflow above includesastryx template --list/astryx search— a component-level lookup alone will wrongly report the capability as missing.