agentleFS
memi-designmemi-design/design-skills/skills/figma-use/SKILL.md

figma-use

Skill7 starsChanged 4 months agoMITView on GitHub

Foundational Figma canvas skill — structure, Auto Layout, variables, MCP tools, self-healing loop

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use figma-design-to-code, figma-swiftui and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    figma-design-to-code

    **MANDATORY prerequisite** — you MUST invoke this skill BEFORE calling the `get_design_context` Figma MCP tool. You MUST trigger this skill whenever the user wants to implement, build, port, or code up a Figma design as code. Example prompts (not exhaustive) are 'implement this Figma design', 'build this screen from Figma', 'turn this Figma into code', 'design to code'. This skill provides critical instructions and steps to the agent on how to correctly implement Figma designs in code and must NOT be skipped.

    Also in 4 projects that use this

  • OpenAISkill

    figma-swiftui

    SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views / screens / tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files / an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.

    Also in 3 projects that use this

  • LLl0k0laDSkill

    using-agent-skills

    Use when starting a session or when you need to discover which skill applies to the current task. This is the meta-skill that governs how all other skills are discovered and invoked.

    Also in 3 projects that use this

  • klauswgSkill

    shadcn-ui

    Expert guidance for integrating and building applications with shadcn/ui components, including component discovery, installation, customization, and best practices.

    Also in 3 projects that use this

  • LLl0k0laDSkill

    shipping-and-launch

    Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.

    Also in 3 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 3 projects that use this

  • +1 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before creating any component, check Code Connect:

    line 109
  2. Distinctive:

    After ANY visual creation or modification:

    line 135
  3. Very specific:

    Always await figma.loadFontAsync() before setting text

    line 159

“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/figma-use — Foundational Figma Canvas Skill

Base skill for all Figma operations. Teaches agents how Figma works — structure, Auto Layout, variables, MCP tools, and the mandatory self-healing loop. Load this before any /figma-* skill.

Freedom Level: High

Agents have full canvas read/write access but must follow the self-healing protocol and never create floating elements.

MCP Tool Decision Tree

This is the most important section. Choose the right tool for the job:

Writing to Canvas

What are you trying to do?

CREATE a design using existing components/tokens:
  → use_figma (Official MCP)
  WHY: It understands your design system, returns Code Connect hints,
  and produces structured output. ALWAYS try this first.

RUN raw Plugin API code (batch ops, custom logic):
  → typed Mémoire Figma actions
  WHY: For operations use_figma doesn't support — complex scripts,
  bulk modifications, conditional logic.

INSTANTIATE an existing component:
  → figma_instantiate_component (Console MCP)
  WHY: Fastest way to create an instance of a known component.
  Call figma_search_components first to get the nodeId.

CREATE variables in bulk:
  → figma_batch_create_variables (Console MCP)
  WHY: 10-50x faster than individual figma_create_variable calls.

SET a single property:
  → figma_set_fills / figma_set_text / figma_resize_node
  WHY: Surgical single-property changes.

Reading from Canvas

What do you need?

Design with code hints + screenshot:
  → get_design_context (Official MCP) ← PREFERRED
  Returns: code, screenshot, Code Connect snippets, annotations

Visual screenshot only:
  → get_screenshot (Official MCP) or figma_take_screenshot (Console)

Node properties and structure:
  → get_metadata (Official MCP)

Design tokens/variables:
  → get_variable_defs (Official) or figma_get_variables (Console)

Component search:
  → figma_search_components (Console) — call at SESSION START
  NOTE: nodeIds are session-scoped, never reuse from previous sessions

Code Connect mappings:
  → get_code_connect_map (Official MCP) — CHECK FIRST before creating

Canvas Principles

Structure Hierarchy

File → Page → Section → Frame → Component/Instance → Layer

Auto Layout Rules

  1. Always use Auto Layout — never absolute positioning unless overlays
  2. Direction: HORIZONTAL or VERTICAL
  3. Spacing: use design token values, never magic numbers
  4. Padding: consistent (use counterAxisSpacing for cross-axis)
  5. Sizing: prefer FILL over fixed width, HUG for content-sized elements
  6. GOTCHA: counterAxisSizingMode only accepts "FIXED" or "AUTO", never "FILL"

Component Architecture (Atomic Design)

LevelFigma StructureExamples
AtomBase component, no nested componentsButton, Badge, Input, Label
Molecule2-5 atom instances composedFormField (Label + Input + HelpText)
OrganismMolecules + atoms with state/logicLoginForm, Sidebar, DataTable
TemplatePage-level layout skeletonDashboardTemplate, AuthTemplate
PageTemplate + real content instancesDashboard, LoginPage

Variables & Tokens

  • Always bind to variables — never use raw hex colors or pixel values
  • Token naming: collection/category/name (e.g., colors/primary/500)
  • Support light/dark modes via variable modes
  • Map to Tailwind: var(--color-primary-500) → text-primary-500

Component Properties

  • Variant properties for visual states (size, variant, state)
  • Boolean properties for toggles (hasIcon, isDisabled)
  • Text properties for editable content (label, placeholder)
  • Instance swap for composable slots (leadingIcon, action)

Code Connect (CHECK FIRST)

Before creating any component, check Code Connect:

1. get_code_connect_map → does this component have a code mapping?
2. If YES → use the mapped codebase component directly
   - Follow the returned prop interface
   - Respect component documentation links
   - Honor design annotations from the designer
3. If NO → create the component, then map it:
   - add_code_connect_map after creation
   - Map Figma properties → React props

Canvas Operations

Creating Elements

1. Check Code Connect → get_code_connect_map
2. Check if component exists → figma_search_components
3. If exists → figma_instantiate_component
4. If new design → use_figma (preferred) or typed Mémoire Figma actions
5. Always place inside a Section or Frame (NEVER floating)
6. Bind all visual properties to variables
7. SCREENSHOT → validate → iterate

Self-Healing Loop (MANDATORY)

After ANY visual creation or modification:

CREATE → SCREENSHOT → ANALYZE → FIX → VERIFY (max 3 rounds)
  1. Execute the design change
  2. Take screenshot with figma_take_screenshot
  3. Analyze for:
    • Elements using "hug contents" instead of "fill container"
    • Inconsistent padding
    • Text/inputs not filling available width
    • Items not centered in their containers
    • Components floating on blank canvas
    • Raw hex values (should be variables)
    • Missing Auto Layout
    • DROP_SHADOW effects missing blendMode: "NORMAL"
  4. Fix issues found
  5. Final screenshot to confirm
  6. Max 3 iterations — if still broken, report to user

Figma API Gotchas

  • counterAxisSizingMode only accepts "FIXED" or "AUTO" (not "FILL")
  • DROP_SHADOW effects require blendMode: "NORMAL"
  • figma.currentPage — set it through typed page-selection helpers; raw JavaScript execution is not part of the default package.
  • layoutGrow only works inside Auto Layout parents
  • Always await figma.loadFontAsync() before setting text

Naming Conventions

ElementConventionExample
ComponentsPascalCaseMetricCard, LoginForm
VariantscamelCase property, PascalCase valuesize=Large
Variableskebab-case pathcolors/primary/500
PagesPascalCaseDashboard, AuthLogin
SectionsTitle CaseHero Section, Navigation

Integration with Mémoire

  • Canvas operations flow through Mémoire's WebSocket bridge (ports 9223-9232)
  • Agent metadata (role, task, status) is broadcast to all connected plugins
  • Design tokens extracted from Figma map to src/figma/tokens.ts
  • Generated components land in generated/ following atomic folder structure
  • Specs are validated against Zod schemas before saving

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.