mastra-frontend
하는 일
이 스킬은 Mastra 플레이그라운드 디자인 시스템으로 사용자 인터페이스를 만드는 방법을 설명합니다. 사용자 정의 색상과 크기 대신 기존 컴포넌트와 레이아웃 도구를 쓰도록 안내합니다.
사용하는 경우
- ✓Mastra 애플리케이션의 페이지나 컴포넌트를 만들 때.
- ✓Mastra 디자인 시스템과 맞는 일관된 모양을 원할 때.
- ✓Mastra 디자인 컴포넌트를 쓰는 앱에 레이아웃이나 스타일을 추가할 때.
스킬 링크
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/mastra-frontend/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“기존 디자인 시스템 컴포넌트를 사용해 내 Mastra 앱의 설정 페이지를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 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
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
debugging-difficult-bugs
29k에이전트가 추측이 아니라 실제 프로그램이 실행될 때의 로그를 남겨 어려운 버그를 디버그하도록 돕습니다.
pr-explainer
29k에이전트가 풀 리퀘스트를 리뷰어가 이해할 수 있도록 독립적인 HTML 페이지로 설명해 줍니다.
pr-splitter
29k에이전트가 크고 복잡한 풀 리퀘스트를 원본 작업을 안전하게 지키면서 더 작고 리뷰하기 쉬운 풀 리퀘스트로 나누도록 돕습니다.
ralph-plan
29k에이전트가 짧은 대화를 통해 집중된 구조화 작업 명령을 계획하도록 돕습니다. 작업에 명확한 단계와 점검이 있도록 합니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.