Synthèse automatique
Guide la construction d'interfaces dans un dépôt Backstage en expliquant quand utiliser le nouveau design system bui (@backstage/ui) plutôt que les couches héritées core-components et Material UI v4.
Points forts
- Clarifie la coexistence de trois couches UI (bui, core-components, MUI v4) avec une règle de priorité explicite
- Documente la configuration déjà en place (dépendance backstage:^, import global du CSS, absence de BUIProvider)
- Renvoie vers les sources fiables (Storybook Backstage, wrapper InfoCard partagé, skill tables) au lieu de laisser deviner les props
Limites
- Fortement spécifique au dépôt Giantswarm/Backstage décrit, peu réutilisable ailleurs
- Le fichier fourni est tronqué : la section sur la lecture du code source Storybook est incomplète
- Ne liste pas les props détaillées des composants bui, renvoyant à une vérification externe
À utiliser dès qu'on crée ou modifie une page, carte, mise en page, bouton ou autre composant frontend dans ce dépôt Backstage.
À éviter pour un projet frontend qui n'utilise ni Backstage ni ce design system bui, ou pour du travail de table en profondeur qui relève du skill tables.
Analyse de sécurité
SûrThe skill is documentation for frontend UI conventions. Its curl examples only fetch public Backstage Storybook/GitHub source read-only; there are no destructive commands, secret exfiltration, obfuscated payloads, or safety-disabling instructions.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Add a cluster status card to the gs plugin using the shared InfoCard wrapper built on @backstage/ui, with a header action button.This page currently uses only @backstage/core-components and MUI v4 — which parts can I move to @backstage/ui and which must stay legacy?Does bui have a Menu component and what props does MenuItem take? Help me confirm against the Backstage Storybook source.name: ui description: How to build UI in this repo — the bui (@backstage/ui) design system vs legacy @backstage/core-components + MUI v4, which to reach for, and how to read Backstage Storybook component/story source. Use when creating or changing pages, cards, layouts, buttons, or any frontend component.
The three UI layers in this repo
| Layer | Import from | Status |
| --- | --- | --- |
| bui — the new Backstage design system | @backstage/ui (aka "Backstage UI", "BUI") | Preferred for new work. The direction we're migrating toward. |
| core-components — classic Backstage components | @backstage/core-components | Legacy but still required where bui has no equivalent (e.g. feature-rich Table, Page/Header/Content scaffolding, Link with route refs). |
| Material UI v4 | @material-ui/core | Legacy primitives + makeStyles. Used for styling and gaps bui doesn't cover. MUI v4 docs. |
Rule of thumb: reach for bui first. Fall back to core-components / MUI v4 only
when bui lacks the piece you need. Mixing all three in one file is normal and
expected during the migration — see ClusterAboutCard.tsx, which imports Grid
from bui, Link from core-components, and Box/Tooltip from MUI v4 together.
@backstage/ui is currently 0.16.0 — a young, fast-moving package. APIs change
between releases and it is not a full replacement for core-components yet.
When unsure whether a bui component exists or what props it takes, check the
Storybook source (see below) rather than guessing.
bui setup (already done)
- The plugin's
package.jsonmust declare"@backstage/ui": "backstage:^"(already present ings,ui-react,ai-chat, andapp). - The global stylesheet is imported once in
packages/app/src/index.tsx:import '@backstage/ui/css/styles.css';. Don't re-import it per component. - We do not wrap the app in
BUIProvider— bui components render against the existing app theme + the global CSS. (Storybook recipes useBUIProviderbecause they render in isolation; the real app doesn't need it.)
bui components we actually use
Common primitives already in the codebase (import from @backstage/ui):
- Layout:
Flex,Grid,Box,Container - Surfaces:
Card,CardHeader,CardBody,CardFooter - Typography:
Text(e.g.<Text as="h3" variant="title-x-small" weight="bold">) - Controls:
Button,ButtonIcon,Switch,Link - Overlay/menu:
Tooltip,TooltipTrigger,MenuTrigger,Menu,MenuItem - Data display:
Table+Cell/CellText/ColumnConfig,List,ListRow,Avatar - Page chrome:
PluginHeader,Header(the two-tier header pattern — plugin-levelPluginHeaderabove an entity-levelHeader). NFS page headers andSubPageBlueprinttabs are rendered by the customGSPageLayoutswappable component, not directly — see "Page headers and tabs" indocs/ui.mdbefore building a tabbed page.
Cards: use the shared InfoCard wrapper
@giantswarm/backstage-plugin-ui-react exports an InfoCard built on bui's
Card/CardHeader/CardBody/CardFooter with our standard title styling and
header/footer action slots. Prefer it over hand-rolling a bui Card or the
core-components InfoCard for new cards. Source:
plugins/ui-react/src/components/InfoCard/InfoCard.tsx.
Tables: see the tables skill
The bui Table (data-driven columnConfig + data, cells must return
Cell/CellText) and the feature-rich core-components Table are both
documented in depth in the tables skill, including the choice matrix and
gotchas (loading skeleton needs data={undefined}). Read that skill for anything
table-related; don't duplicate it here.
Reading Backstage Storybook source
The Backstage Storybook renders components
from the upstream backstage/backstage monorepo — stories are .stories.tsx
files colocated with their components. There is no separate storybook repo,
and we do not run a local storybook. To learn a pattern (how a page/card is
composed, what props a bui component takes), read the story + component source
directly.
The reliable technique: index.json → importPath → GitHub raw
Every Storybook deployment publishes a machine-readable index at
https://backstage.io/storybook/index.json. Each entry carries the exact source
paths:
{
"id": "recipes-pluginheader-and-header--with-tabs",
"title": "Recipes/PluginHeader and Header",
"importPath": "./packages/ui/src/recipes/PluginHeaderAndHeader.stories.tsx",
"componentPath": "./packages/ui/src/components/PluginHeader/PluginHeader.tsx"
}
Then fetch the raw source from GitHub (strip the leading ./):
BASE=https://raw.githubusercontent.com/backstage/backstage/master
curl -sfL "$BASE/packages/ui/src/recipes/PluginHeaderAndHeader.stories.tsx"
curl -sfL "$BASE/packages/ui/src/components/PluginHeader/PluginHeader.tsx"
To find the story ID for a Storybook URL: the ?path=/story/<id> query param
is the entry id. Story IDs can drift between releases (the "Recipes/..."
example also now exists as "Backstage UI/PluginHeader") — search index.json by
title or a keyword rather than trusting an old URL. Quick lookup:
curl -sfL https://backstage.io/storybook/index.json \
| jq '.entries | to_entries[] | select(.value.title|test("PluginHeader";"i")) | .value | {id,importPath,componentPath}'
Live inspection with Chrome DevTools
Use the chrome-devtools MCP when you want to inspect the rendered result
(DOM, computed styles, a11y tree) or grab index.json without CORS friction:
new_page/navigate_pagetohttps://backstage.io/storybook/evaluate_scriptrunningfetch('https://backstage.io/storybook/index.json')(same-origin, so no CORS block) to pull the index or any raw story texttake_snapshotfor the a11y tree of a rendered story
Note: the chrome-devtools MCP has its own filesystem roots — it can't write into
the session scratchpad. Fetch text via evaluate_script and return it inline, or
just curl the GitHub raw URL from Bash instead.
Related skills
tables— buiTablevs core-componentsTable, columns, filtering, faceted sidebars.components— component directory structure, named exports, barrel files.upstream-search— searching a local clone ofbackstage/backstage(needsBACKSTAGE_UPSTREAM_DIRset; the Storybook technique above needs no clone).
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/ui-development-in-backstage-mrwak8ze' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/ui-development-in-backstage-mrwak8ze/download' --output '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md.part' && mv '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md.part' '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && test -s '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ui' && cp -R '.skill-downloads/ui-development-in-backstage-mrwak8ze' '.claude/skills/ui'Cursor
test -f '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && test -s '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/ui' && cp -R '.skill-downloads/ui-development-in-backstage-mrwak8ze' '.cursor/skills/ui'Codex
test -f '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && test -s '.skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/ui' && cp -R '.skill-downloads/ui-development-in-backstage-mrwak8ze' '.agents/skills/ui'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/ui-development-in-backstage-mrwak8ze'openskills read 'ui-development-in-backstage-mrwak8ze'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/ui-development-in-backstage-mrwak8ze/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.