mastra-frontend
यह क्या करती है
यह स्किल बताती है कि Mastra playground डिज़ाइन सिस्टम से यूज़र इंटरफ़ेस कैसे बनाएँ। यह एजेंट को अपने रंग और आकार बनाने की जगह मौजूदा कॉम्पोनेंट और लेआउट टूल इस्तेमाल करने का मार्गदर्शन देती है।
कब इस्तेमाल करें
- ✓जब आप Mastra ऐप के लिए कोई पेज या कॉम्पोनेंट बना रहे हों।
- ✓जब आप Mastra डिज़ाइन सिस्टम से मेल खाने वाला एक जैसा रूप चाहें।
- ✓जब आप Mastra डिज़ाइन कॉम्पोनेंट इस्तेमाल करने वाले ऐप में लेआउट या स्टाइलिंग जोड़ रहे हों।
Skill का लिंक
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Mastra ऐप के लिए मौजूदा डिज़ाइन सिस्टम कॉम्पोनेंट से सेटिंग्स पेज बनाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले काम के लिए उपयुक्त मौजूदा कॉम्पोनेंट खोजता है, फिर उन्हें लेआउट टूल से व्यवस्थित करता है। वह हाथ से लिखे रंग और फ़ॉन्ट से बचता है, क्योंकि लुक डिज़ाइन सिस्टम देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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/
अक्सर पूछे जाने वाले सवाल
क्या मैं रंग बदल सकता हूँ?
किसी स्क्रीन में सीधे नहीं। लुक और अनुभव डिज़ाइन सिस्टम से आता है, और उसमें बदलाव एक अलग काम है।
अगर कोई कॉम्पोनेंट फ़िट न हो तो?
स्किल मौजूदा लुक को ओवरराइड करने की जगह नया वेरिएंट माँगने की सलाह देती है।
क्या यह Tailwind स्टाइलिंग कवर करती है?
हाँ। यह अपने रैपर पर स्पेसिंग और आकार के लिए Tailwind यूटिलिटी इस्तेमाल करती है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 29k
- रैंकिंग में स्थान
- #9361
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
debugging-difficult-bugs
29kयह आपके एजेंट को कठिन बग ढूंढने में मदद करती है, असली प्रोग्राम के रनटाइम लॉग से, केवल टेस्ट देखकर अंदाज़ा लगाने की जगह।
pr-explainer
29kयह आपके एजेंट को पुल रिक्वेस्ट को एक साफ़, स्व-निहित HTML पेज में बदलने में मदद करती है, जो रिव्यूअर को बदलाव समझाए।
pr-splitter
29kयह आपके एजेंट को एक बड़ी, उलझी पुल रिक्वेस्ट को छोटी, रिव्यू योग्य पुल रिक्वेस्ट में बांटने में मदद करती है, मूल काम सुरक्षित रखते हुए।
ralph-plan
29kयह आपके एजेंट को कुछ छोटी बातचीत से एक केंद्रित, व्यवस्थित टास्क कमांड की योजना बनाने में मदद करती है, ताकि काम के साफ़ चरण और जांच हों।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।