CtrlK
BlogDocsLog inGet started
Tessl Logo

figma-design

Figma design-to-code workflows, design token extraction, component inspection, and asset export. Use when translating Figma designs into code, extracting design tokens, or referencing component specs.

100

Quality

100%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Advisory

Suggest reviewing before use

SKILL.md
Quality
Evals
Security
<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->

Figma Design

For project-specific design system details, see the frontend-design skill.

MCP Tools

ToolPurpose
figma/get_fileRetrieve full Figma file structure
figma/get_file_nodesGet specific nodes/frames
figma/get_imagesExport nodes as images
figma/get_commentsRead design review comments
figma/get_stylesExtract color/text/effect styles
figma/get_componentsList reusable components

Example MCP invocations

// figma/get_file — full file structure
{ "file_key": "a1b2C3d4E5", "depth": 2 }
// figma/get_file_nodes — specific frames
{ "file_key": "a1b2C3d4E5", "node_ids": ["123:45"] }
// figma/get_images — export as PNG at 2x
{ "file_key": "a1b2C3d4E5", "ids": ["123:45"], "format": "png", "scale": 2 }

Design-to-Code Workflow

  1. Identify the frame — obtain the Figma file key or node ID from the task input.
  2. Inspect nodes — call figma/get_file_nodes for the target node IDs and extract bounding boxes, fills, text styles, and auto-layout info.
  3. Extract tokens — map returned styles to token files (colors, typography, spacing) and commit tokens to src/styles/tokens.css or a token JSON.
  4. Implement component — scaffold a framework component that consumes tokens and matches layout properties (gap, padding, width). Import tokens (CSS variables or JSON) and attach a data-testid for programmatic verification.
// src/components/ui/Card.tsx — consumes tokens, matches Figma layout
import '../styles/tokens.css';
interface CardProps { title: string; description?: string }
export function Card({ title, description }: CardProps) {
  return (
    <div data-testid="card" className="card">
      <span className="card-title">{title}</span>
      {description && <p>{description}</p>}
    </div>
  );
}
  1. Verify programmatically — run a visual diff or DOM-attribute check:
  • Render in Storybook and compare DOM bounding boxes against Figma node metrics.
  • Acceptance: differences <= 4px for spacing and matching token colors; fonts must match family and weight.
  1. Feedback loop — if implementation deviates beyond thresholds, update token mapping or request design clarification and repeat from step 2.

See REFERENCE.md for a verification script and Figma→CSS translation rules.

Repository
monkilabs/opencastle
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.