← 返回列表
全部 Skill›内容与媒体 Content & Media›metabase-ui-component-from-figma

metabase-ui-component-from-figma

作者 @metabase · 语言 en
Update or build a Metabase design-system component (frontend/src/metabase/ui — Chip, Badge, Alert, Switch, etc.) to match a Figma spec described in a Linear issue. Use when a ticket asks to restyle an existing `metabase/ui` component or implement a new one from Figma. Covers: checking out the issue, mapping the component (usage/blast radius for an existing one, or scaffolding a new one), building a Storybook showcase matrix (before styling for existing components, after for new ones), styling from exact Figma tokens while iterating with the user, and committing + migrating call sites LAST.
内容与媒体 Content & Media设计需海外环境访问网络待翻译
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
50,488
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

Metabase UI component from Figma

End-to-end workflow for bringing a metabase/ui (Mantine) component in line with a Figma design, driven by a Linear ticket.

The golden rule (existing components): build the Storybook showcase before changing any component styles. Build it while the old styles are still in place — so the team can see the current component at a glance and get accustomed to it before the migration, then watch it light up as you restyle. You end up with a visual-regression (Loki) candidate either way. A new component has nothing to render until it's built, so this rule doesn't apply to create mode — there the order flips: implement and style the component first, then build its showcase to present the result.

This is a frontend task — also load typescript-write (and typescript-review before handing off).

Two modes

The ticket is one of two shapes; identify which up front, because Phase 2 differs:

  • Update an existing component — the component already exists with call sites, either in metabase/ui *or* as a legacy component elsewhere (e.g. frontend/src/metabase/common/components/, possibly Emotion styled-components) that this ticket also migrates into metabase/ui. The risk is *regression* (call sites, behavior), so you map usage and lock behavior with tests before touching it.
  • Create a new component — nothing equivalent exists anywhere yet. Rarer. The risk is *API design*, so you scaffold the component and its public surface first.

Phases 1, 2, 5 and 6 are shared. The middle two differ in order: update mode builds the showcase (Phase 3) *before* styling (Phase 4); create mode does the reverse — implement and style first, then build the showcase as the last step — because there's nothing to render until the component exists.


Phase 1 — Check out the issue

  1. Fetch the Linear issue with the Linear MCP get_issue.
  2. Pull from it:
  • Figma link(s) — extract the node-id (?node-id=250-13588 → 250-13588) and fileKey (the /design/<fileKey>/… segment).
  • gitBranchName — switch to it if not already there.
  • The component's intended API — variants, sizes, and states the design system supports for this component. This defines the axes of your showcase (Phase 3).
  1. Decide the mode (see Two modes above): search for an existing component — in metabase/ui or as a legacy component elsewhere. Found → update; nothing equivalent anywhere → create. Confirm with the user when unsure.
  2. Verify a Figma desktop MCP is connected before doing the work — this skill depends on it for exact tokens in Phase 4 (and styling can't proceed accurately without it). Do a quick read against the issue's node (e.g. get_metadata/get_variable_defs); if it errors with "nothing selected" or the server isn't connected, prompt the user to enable it (Switch to Dev Mode → MCP section in the right sidebar) and select the relevant layer before continuing.

Phase 2 — Understand the component

Mode: update an existing component

  1. Locate the component dir (typically containing Component.config.ts or Component.tsx, Component.module.css, Component.stories.tsx, index.ts). A ticket may also be migrating a legacy component — if it still uses Emotion styled-components, reach for the emotion-migrate skill.
  2. Map every usage across frontend/src and e2e (JSX <Component, sub-components like Component.Group, and wrapper components).
  3. Write findings to local/<TICKET>-<component>-usage-findings.md, one entry per usage: code location (file:line), short context, and non-standard usage (excessive customization, inline styling, invalid/legacy props). Invalid props are a signal that call sites will need migrating in Phase 6. This doc stays — the user walks it at the end to verify each real usage still looks right.
  4. State the blast radius plainly: how many call sites, where, and whether they're confined.
  5. Lock behavior with tests before changing anything — when warranted. Only for components that have custom interactive behavior (their own event handlers, state, keyboard logic, controlled/uncontrolled wiring). Add unit tests covering that current API/behavior so a regression shows up as a failing test. Skip tests for thin Mantine wrappers — don't test built-in Mantine behavior, and a pure visual restyle is covered by the showcase/Loki, not unit tests.

Mode: create a new component

  1. Decide whether it wraps a Mantine primitive (most common — extend it via a .config.ts using <Mantine>.extend({...}) and theme registration) or is bespoke. Prefer wrapping Mantine.
  2. Scaffold the component dir + its public surface: Component.tsx/Component.config.ts, Component.module.css, Component.stories.tsx, index.ts, and wire the export through the group barrel and the metabase/ui barrel.
  3. There are no call sites to map yet; instead note the intended usage from the ticket so the eventual showcase reflects real props.
  4. Order note: for a new component, implement and style it (Phase 4) first, *then* build the showcase (Phase 3) to present the finished result — there's nothing to render until it exists. The phases below are written update-first; just run 4 before 3 in create mode.

Phase 3 — Build the Storybook s

评论
Mmetabase
metabase
metabase/metabase
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@metabase
所属大类内容与媒体 Content & Media / 设计
国内可用性需海外环境
最近源活动—
风险提示访问网络
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。