mastra-frontend
Was er macht
Dieser Skill erklärt, wie du Benutzeroberflächen mit dem Playground-Designsystem von Mastra baust. Er führt den Agenten dazu, vorhandene Komponenten und Layout-Werkzeuge zu nutzen, statt eigene Farben und Größen festzulegen.
Wann du ihn nutzt
- ✓Wenn du eine Seite oder Komponente für eine Mastra-Anwendung baust.
- ✓Wenn du ein einheitliches Erscheinungsbild willst, das zum Mastra-Designsystem passt.
- ✓Wenn du einer App, die die Mastra-Design-Komponenten nutzt, Layout oder Styling hinzufügst.
Link zum Skill
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Baue eine Einstellungsseite für meine Mastra-App mit den vorhandenen Komponenten des Designsystems.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent sucht zuerst nach vorhandenen Komponenten, die zur Aufgabe passen, und ordnet sie dann mit Layout-Werkzeugen an. Handgeschriebene Farben und Schriften vermeidet er, weil das Designsystem das Aussehen liefert.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Building Frontend Interfaces
Every Mastra application UI is assembled from the @mastra/playground-ui design system. Building a screen is composition work: pick existing components, arrange them with layout utilities, and let the design system provide the look. Writing colors, font sizes, shadows, or radii by hand means you have left the happy path. Changing the design system itself (tokens, ds/ components, variants) is a separate, explicitly-approved task. For Tailwind v4 mechanics (renames, dynamic utilities, CSS-first APIs), read the tailwind-v4 skill.
The boundary: look vs layout
- Look — colors, typography, radius, shadows, borders, internal padding — belongs to the design system. Consumers never restyle it.
- Layout — positioning, flex/grid placement,
gap-*, margins, size constraints (w-*,max-w-*,min-h-*,shrink-0) — belongs to the consumer, through Tailwind utilities on your own wrappers and, when needed, directly on DS components.
className on a DS component is fine for layout (<DialogContent size="xl" className="h-[80vh]">, where size picks the width and the class only pins the height) and forbidden for look (<Button className="bg-red-500 text-xs">). If a component's look doesn't fit, use its variants and props; if none fit, escalate for a new variant instead of overriding.
Find what exists — never guess, never rebuild
- Components: browse
packages/playground-ui/src/ds/components/(primitives) andsrc/domains/(feature components). Check the exports and existing usage before building anything new. - Tokens: read the
@themeblocks underpackages/playground-ui/theme/(colors,status,data-viz,surfaces,typography,scale,motion), all imported bypackages/playground-ui/theme.css, which holds the semantic aliases. The namespace tells you the generated utility:--color-x→bg-x/text-x/border-x,--spacing-x→p-x/gap-x/h-x,--text-x→text-x,--shadow-x→shadow-x,--radius-x→rounded-x. Token names drift — confirm them in the file, never use them from memory.
Choosing a class value
Pick the highest rung that fits; each step down needs a reason:
- DS component or variant — the look you need probably already exists.
- Generated theme utility from
theme.css. - Dynamic v4 utility when the value maps to the spacing scale (
min-w-100,size-6,grid-cols-15). - Local CSS custom property consumed via shorthand, for runtime values scoped to one component (
bg-(--row-bg),text-(color:--agent-color-fg)). - Square-bracket arbitrary value only for a justified one-off (
max-h-[calc(100dvh-3rem)]).
Theme contract
theme.cssvariables are API: adding one generates utilities for every consumer. Never modifytheme.css, its layers inpackages/playground-ui/theme/, orpackages/playground-ui/src/ds/tokens/*.tswithout explicit approval. To request a token: document the use case, explain why a local CSS custom property is not enough, and wait for the design team.- Runtime-only or single-component values get a plain CSS custom property (which generates no utility) consumed via
bg-(--var)— not a new@themetoken. - When JavaScript needs a theme value, read the CSS variable (
var(--color-surface4),getComputedStyle) — neverresolveConfigor JS token imports for styling.
Wiring
packages/playground-ui/components.cssis the design system's stylesheet uncompiled:theme.css, the dark variant (@custom-variant dark (&:is(.dark *))), custom utilities, base styles and keyframes.src/index.cssis@import 'tailwindcss'plus that file, for the library build. An app with its own Tailwind build importscomponents.cssandsources.cssinto its sheet instead ofstyle.css.- The palette defaults to dark in
:root;html.lightflips the semantic variables. Theming is automatic through semantic tokens — never writedark:color overrides on semantic tokens; reservedark:for rare structural differences. - Build conditional or merged class strings with
cn()— exported from@mastra/playground-uifor consumers,src/lib/utils.tsinside the package. ItstwMergeis extended with the DS scales (src/lib/tw-merge-config.ts), so DS utilities liketext-body-smmerge correctly; importingtwMergefromtailwind-mergedirectly mis-merges them. - Code inside
packages/playground-uioutsideds/(for examplesrc/domains/) is itself a consumer of theds/
Häufige Fragen
Kann ich die Farben ändern?
Nicht direkt in einer Oberfläche. Aussehen und Gefühl kommen vom Designsystem, Änderungen daran sind eine eigene Aufgabe.
Was, wenn keine Komponente passt?
Der Skill empfiehlt, eine neue Variante anzufragen, statt das bestehende Aussehen zu überschreiben.
Deckt er Tailwind-Styling ab?
Ja. Für das Layout nutzt er Tailwind-Utilities, etwa Abstände und Größen auf deinen eigenen Wrappern.
Details
Originalbeschreibung des Autors
How to build Mastra frontend interfaces with the @mastra/playground-ui design system. This skill should be used when creating or modifying any application UI — pages, components, styling, or tokens — in this repo or in an external consumer of the design system. The docs site has its own styling and is out of scope.
repo: mastra-ai/mastra
Beliebtheit
- GitHub-Sterne
- 29k
- Platz im Ranking
- #9361
- Lizenz
- —
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
debugging-difficult-bugs
29kHilft deinem Agenten, einen schwierigen Bug zu debuggen, indem er das echte Laufzeitverhalten des Programms protokolliert, statt nur aus Tests zu raten.
pr-explainer
29kVerwandelt einen Pull Request in eine klare, eigenständige HTML-Seite, die Reviewern die Änderung erklärt.
pr-splitter
29kZerlegt einen großen, unübersichtlichen Pull Request in kleinere, prüfbare Pull Requests und sichert dabei die ursprüngliche Arbeit.
ralph-plan
29kPlant mit dir in einem kurzen Hin und Her eine klar strukturierte Aufgabe für deinen Agenten, mit klaren Schritten und Prüfungen.
Ähnliche Skills
angular-developer
280kHilft deinem Agenten bei Angular-Code und gibt Tipps zur Projektstruktur. Nützlich für neue Projekte, einzelne Code-Teile sowie Performance und Barrierefreiheit.
frontend-a11y
280kHilft deinem Agenten, Weboberflächen für alle zugänglich zu machen. Sorgt dafür, dass Websites und Apps gut mit Screenreadern und Tastaturnavigation funktionieren.
frontend-patterns
280kLässt deinen Agenten moderne Muster in der Frontend-Entwicklung anwenden. Optimiert Performance, verwaltet State und folgt Best Practices für React und Next.js.