Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)29 mil · #9361

mastra-frontend

Qué hace

Esta skill explica cómo crear interfaces de usuario con el sistema de diseño del playground de Mastra. Guía al agente para usar los componentes y las herramientas de diseño existentes en lugar de colores y tamaños personalizados.

Cuándo usarla

  • ✓Cuando estás creando una página o un componente para una aplicación de Mastra.
  • ✓Cuando quieres un aspecto coherente que coincida con el sistema de diseño de Mastra.
  • ✓Cuando añades diseño o estilos a una app que usa los componentes de diseño de Mastra.

Link de la skill

https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Crea una página de ajustes para mi app de Mastra usando los componentes del sistema de diseño existente.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente busca primero los componentes existentes que encajen con la tarea y después los organiza con las utilidades de diseño. Evita colores y fuentes escritos a mano, porque el sistema de diseño ya aporta el aspecto.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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) and src/domains/ (feature components). Check the exports and existing usage before building anything new.
  • Tokens: read the @theme blocks under packages/playground-ui/theme/ (colors, status, data-viz, surfaces, typography, scale, motion), all imported by packages/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:

  1. DS component or variant — the look you need probably already exists.
  2. Generated theme utility from theme.css.
  3. Dynamic v4 utility when the value maps to the spacing scale (min-w-100, size-6, grid-cols-15).
  4. Local CSS custom property consumed via shorthand, for runtime values scoped to one component (bg-(--row-bg), text-(color:--agent-color-fg)).
  5. Square-bracket arbitrary value only for a justified one-off (max-h-[calc(100dvh-3rem)]).

Theme contract

  • theme.css variables are API: adding one generates utilities for every consumer. Never modify theme.css, its layers in packages/playground-ui/theme/, or packages/playground-ui/src/ds/tokens/*.ts without 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 @theme token.
  • When JavaScript needs a theme value, read the CSS variable (var(--color-surface4), getComputedStyle) — never resolveConfig or JS token imports for styling.

Wiring

  • packages/playground-ui/components.css is the design system's stylesheet uncompiled: theme.css, the dark variant (@custom-variant dark (&:is(.dark *))), custom utilities, base styles and keyframes. src/index.css is @import 'tailwindcss' plus that file, for the library build. An app with its own Tailwind build imports components.css and sources.css into its sheet instead of style.css.
  • The palette defaults to dark in :root; html.light flips the semantic variables. Theming is automatic through semantic tokens — never write dark: color overrides on semantic tokens; reserve dark: for rare structural differences.
  • Build conditional or merged class strings with cn() — exported from @mastra/playground-ui for consumers, src/lib/utils.ts inside the package. Its twMerge is extended with the DS scales (src/lib/tw-merge-config.ts), so DS utilities like text-body-sm merge correctly; importing twMerge from tailwind-merge directly mis-merges them.
  • Code inside packages/playground-ui outside ds/ (for example src/domains/) is itself a consumer of the ds/
Preguntas frecuentes

¿Puedo cambiar los colores?

No directamente en una pantalla. El aspecto viene del sistema de diseño, y los cambios en él son una tarea aparte.

¿Qué pasa si ningún componente encaja?

La skill recomienda pedir una variante nueva en lugar de sobrescribir el aspecto existente.

¿Cubre los estilos con Tailwind?

Sí. Usa utilidades de Tailwind para el diseño, como el espaciado y el tamaño en tus propios envoltorios.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
29 mil
Posición en el ranking
#9361
Licencia
—
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas