Communitygithub.com

flcker/figma-ui-desktop

Develop desktop UI (Qt Widget / QML / WinUI / Flutter, etc.) from Figma designs, solving poor fidelity from directly copying canvas data. Core: a framework-agnostic data-to-target-framework translation methodology using dual-channel reading (get_figma_data for precise values + download_figma_images for visual reference), mapping canvas concepts to target framework constructs, and validating with actual screenshots.

What is figma-ui-desktop?

This skill provides a comprehensive workflow for translating Figma designs into high-fidelity desktop application user interfaces using the Framelink figma-developer-mcp server. It addresses the common issue of poor fidelity that arises when developers directly copy Figma's absolute coordinates and inline styles without translating them into the target framework's native layout and styling primitives. The core methodology is framework-agnostic: it reads Figma data through two parallel channels—the precise data channel (get_figma_data for exact coordinates, color values, font sizes, and spacing) and the visual channel (download_figma_images for overall layout context)—and explicitly prohibits writing code using only one channel. After analysis, design elements are translated using a comprehensive mapping table covering layouts (e.g., QHBoxLayout, Row, StackPanel, Column), colors, spacing, corner radii, shadows, and component reuse patterns for Qt Widget, QML, WinUI 3, and Flutter. The workflow enforces a four-phase process: coarse reading to understand structure, detailed reading for exact values, framework-aware implementation using standard controls, and a mandatory validation loop where the developer runs the compiled application, takes a screenshot, and compares it against the design screenshot. The skill includes specific anti-laziness rules to prevent the AI from taking shortcuts and a fidelity checklist to systematically verify color, typography, spacing, layout, and assets.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/flcker/agents-skills/tree/HEAD/skills/dev/figma-ui-desktop

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Figma Desktop UI Development Guide (Framelink MCP Edition)

Solves the problem of poor fidelity when developing desktop UI from Figma designs. The root cause is treating Figma's "canvas data" (absolute coordinates, inline color values, pixel-level layer stacks) as "implementation data", directly copying it leading to rigid layouts, inaccurate colors and fonts, and missing assets.

Why use Framelink for desktop instead of the official Figma MCP Server: The official MCP's core tool get_design_context by default only generates Web code (React/Tailwind, with optional Vue/HTML/iOS), does not support Qt Widget / QML / WinUI / Flutter, and requires payment. Framelink's positioning of "only providing framework-agnostic Figma data, leaving translation to the model" — this "shortcoming" is actually an advantage in multi-framework desktop scenarios: the model can translate canvas data into any target framework, rather than being locked into Web.

This skill targets two tools from Framelink figma-developer-mcp:

ToolChannelPurpose
get_figma_dataPrecision ChannelFetches canvas data by fileKey + nodeId: layout, content, visuals, component information
download_figma_imagesVisual ChannelExports SVG/PNG/GIF of nodes to a local directory

If targeting Web frontend (React/Vue/HTML), use figma-ui-web instead of this skill.

Core Principles

  1. Dual-channel parallel, prohibit single-channel coding. The precision channel provides exact values, the visual channel provides overall layout and text. Using only one will inevitably lead to distortion.
  2. Use exact values, do not visually estimate. Colors, font sizes, font weights, spacing, corner radii, borders, shadows — always use the exact values from the design.
  3. Request the design first, do not spontaneously write UI.
  4. Implementation must be verified with a closed loop: Take a screenshot of the actual running program, compare it to the design screenshot → automatically fix detected defects → iterate with manual critique.

Workflow

Phase 1: Coarse Reading (Understand Requirements & Structure)

When the design is large, read it coarsely first to avoid overloading context:

  1. Use get_figma_data to fetch the top-level structure (depth controls traversal, start shallow), understand which pages/sections/controls exist.
  2. Use download_figma_images to export overall interface images, understand layout and text.

Phase 2: Detailed Reading (Get Precise Data Before Implementation)

For the specific section or control to be implemented, call both simultaneously:

  • get_figma_data (with nodeId, read coordinates, color values, font sizes, spacing, corner radii, borders node by node)
  • download_figma_images (export an image of the section to confirm relative positioning)

After obtaining data, perform structural analysis before writing code:

  • Which nodes are repeating patterns (list items, cards, buttons) → extract into custom controls/components of the target framework
  • Which absolute positioning is actually layout (horizontal alignment, centering, space-between, grid) → convert using the mapping table below
  • Which are semantic roles (navigation/form/list) → map to existing control libraries of the target framework
  • Image/icon nodes → use download_figma_images to download original files to the resource directory, do not hand-draw

Phase 3: Implementation (Framework-Agnostic Translation)

Use exact values from the design for colors, font sizes, and spacing. When translating, consult the "Canvas Concept → Target Framework" mapping table below. Do not invent controls — use the target framework's standard layouts/controls when available. Reserve absolute positioning only when "precise pixel-level positioning is truly necessary."

Phase 4: Validation Closed Loop

Desktop environments lack browser automation tools like Playwright. Validation method: Take a screenshot of the actual compiled and running program, compare it side-by-side with the design screenshot. Automatically fix obvious defects; manual critique identifies subtler issues (spacing, font weight, color nuances), proactively feed them to the AI for precise fixes, and proceed to the next iteration.

Canvas Concept → Target Framework Mapping Table

Figma canvas uses absolute coordinates + pixel layers; implementations must translate these into each framework's layout semantics. Consult this table during translation:

Canvas/Design ConceptQt WidgetQML (Qt Quick)WinUI 3 (XAML)Flutter
Horizontal LayoutQHBoxLayoutRowStackPanel (Orientation=Horizontal)Row
Vertical LayoutQVBoxLayoutColumnStackPanel (Orientation=Vertical)Column
Grid LayoutQGridLayoutGrid / GridLayoutGridGridView / Table
Absolute PositioningsetGeometry / moveItem + x/yCanvas + Canvas.Left/TopStack + Positioned
Stacking/OverlayChild widget stacking / raise()z property / StackCanvas.ZIndexStack
Center AlignmentaddStretch / setAlignmentanchors.centerInHorizontalAlignment/VerticalAlignment=CenterCenter / Align
Space-Between AlignmentaddStretch on both sidesanchors.left/right + marginsMargin distributionMainAxisAlignment.spaceBetween
SpacingQSpacerItem / layout spacingspacing propertyMargin / PaddingSizedBox / Padding / Spacer
ColorQPalette / stylesheetTheme / property bindingResource ResourceDictionaryThemeData / ColorScheme
Font Size/FontQFontfont.pixelSizeFontSizeTextStyle.fontSize
Corner Radiusstylesheet border-radiusRectangle radiusCornerRadiusBorderRadius
ShadowQGraphicsDropShadowEffectDropShadowThemeShadow / DropShadowBoxShadow
IconQIcon / ResourceImage / icon fontFontIcon / SymbolIconIcon
Component ReuseCustom QWidget subclassCustom QML ComponentUserControl / Custom ControlWidget
State/VariantEnum + update()State / Property-drivenVisualStateManagersetState / AnimatedWidget

Anti-Laziness Rules

AI tends to use only one channel and then write code. Explicitly require:

  • "Call both get_figma_data and download_figma_images simultaneously to read the design."
  • "Do not write code using only images/screenshots of the design."
  • "Read exact values from get_figma_data line by line, compare colors/font sizes/spacing, do not visually estimate."
  • "Translate into the target framework's standard layouts/controls using the mapping table, do not invent."

Fidelity Self-Checklist

After generation, check each item systematically (more reliable than "does it look similar overall"):

  • Colors (used exact values, not approximations)
  • Font size / Font weight
  • Spacing / Margins / Padding
  • Corner radius / Borders / Shadows
  • Layout (translated into target framework standard layouts, not directly copied absolute coordinates)
  • Hierarchy / Z-order
  • Icons/images used as original files, not hand-drawn
  • Repeatable patterns extracted into components/custom controls

Reference Sources

Methodology is adapted from the official Figma MCP + Playwright UI development workflow (see "Using Figma MCP and Playwright MCP to Improve UI Development and Debugging Efficiency"), core ideas of "dual-channel + validation closed loop + explicit anti-laziness requirements" are retained. Tool names are adapted for Framelink figma-developer-mcp, mapping table expanded to cover multiple desktop frameworks.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Related Skills