Langsung ke konten
Skillpedia
Website & UI (frontend)29k Β· #9361

mastra-frontend

Fungsinya

Skill ini menjelaskan cara membangun antarmuka pengguna dengan sistem desain playground Mastra. Skill ini memandu agent untuk memakai komponen dan alat tata letak yang sudah ada, alih-alih warna dan ukuran buatan sendiri.

Kapan dipakai

  • βœ“Saat Anda membangun halaman atau komponen untuk aplikasi Mastra.
  • βœ“Saat Anda ingin tampilan yang konsisten dan sesuai dengan sistem desain Mastra.
  • βœ“Saat Anda menambahkan tata letak atau gaya ke aplikasi yang memakai komponen desain Mastra.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBangun halaman pengaturan untuk aplikasi Mastra saya dengan memakai komponen sistem desain yang sudah ada.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent pertama-tama mencari komponen yang sudah ada dan sesuai dengan tugasnya, lalu menyusunnya dengan utilitas tata letak. Agent menghindari warna dan font yang ditulis sendiri, karena tampilannya sudah disediakan oleh sistem desain.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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/
Pertanyaan umum

Bisakah saya mengubah warnanya?

Tidak langsung di dalam layar. Tampilan berasal dari sistem desain, dan perubahan padanya adalah tugas terpisah.

Bagaimana jika tidak ada komponen yang cocok?

Skill ini menyarankan meminta varian baru, alih-alih menimpa tampilan yang sudah ada.

Apakah mencakup gaya Tailwind?

Ya. Skill ini memakai utilitas Tailwind untuk tata letak, seperti jarak dan ukuran pada pembungkus Anda sendiri.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
29k
Peringkat
#9361
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa