Skip to main content

figma-to-code

Bridge Figma MCP output to Stellar Lab code conventions. Invoke after calling get_design_context to translate Figma's reference code into project-appropriate components, classes, and patterns.

معلومات المصدر

المستودع
stellar/laboratory
آخر نشاط في المصدر
٢٢ أبريل ٢٠٢٦ في ١٩:١٨
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١١٢
التفرعات
١٢٢

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

مستكشف الملفات
2 ملفات

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
figma-to-code
description
Bridge Figma MCP output to Stellar Lab code conventions. Invoke after calling get_design_context to translate Figma's reference code into project-appropriate components, classes, and patterns.
read_files
[".claude/skills/figma-to-code/reference/*.md"]
# Figma to Code ## Purpose The Figma MCP's `get_design_context` returns generic reference code (often plain HTML/CSS). This skill bridges the gap between that output and the project's actual conventions: `@stellar/design-system` components, SCSS with BEM-ish naming, and specific layout patterns. > For the full SDS component catalog, props, SCSS conventions, and usage > examples, invoke `/component-guide`. > For element mapping tables, spacing/layout patterns, and Figma variable > mappings, see `reference/figma-mapping.md` (loaded automatically). ## Workflow ### 1. Get the Figma design context ``` mcp__figma-desktop__get_design_context({ nodeId: "1234:5678", artifactType: "COMPONENT_WITHIN_A_WEB_PAGE_OR_APP_SCREEN", clientFrameworks: "react", clientLanguages: "typescript,scss" }) ``` Also get a screenshot for visual reference: ``` mcp__figma-desktop__get_screenshot({ nodeId: "1234:5678" }) ``` ### 2. Translate the output Do NOT copy the Figma reference code directly. Instead, map each element to the project's conventions using the mapping rules in `reference/figma-mapping.md`. ### 3. Verify against screenshot After implementing, visually compare the rendered component against the Figma screenshot. Focus on: layout, spacing, typography hierarchy, and interactive states. ## Common Pitfalls 1. **Don't copy Figma's HTML structure literally** — Figma groups elements for design purposes, not component architecture. Think about what makes sense as React components. 2. **Don't use arbitrary colors** — Figma may show raw hex values. Map them to SDS color tokens (`--sds-clr-*`). 3. **Don't ignore interactive states** — Figma may show one state. Consider hover, focus, disabled, loading, and error states using design system props.
عرض على GitHub