Skillpedia
الواجهات (UI/UX)101k · #990

token-map

ما الذي تفعله

تساعد هذه المهارة على تنظيم الأنماط البصرية للتصميم، كالألوان والخطوط، لتعمل بتناسق مع نظام التصميم الموجود. تقارن أنماط تصميمك بالأنماط المحددة في نظام التصميم، وتنشئ خريطة تضمن تطابقها بثبات.

متى تستخدمها

  • ✓عند نقل تصميم من Figma إلى الكود.
  • ✓عند تحديث تصميم قائم ليستخدم نظام تصميم جديدًا.
  • ✓عندما تريد التأكد من أن جميع الأنماط البصرية (الألوان والخطوط والمسافات) متسقة بين التصميم ونظام التصميم.

رابط المهارة

https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/token-map/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/token-map/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“من فضلك اربط رموز الألوان والطباعة في تصميمي بنظام التصميم النشط.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تحلل هذه المهارة الأنماط البصرية (الرموز) في تصميمك، سواء المستخرجة من Figma أو من الكود. وتحاول تخمين غرض كل نمط، مثلًا هل هو لون أساسي أو عنوان، استنادًا إلى طريقة استخدامه في التصميم. ثم تنشئ ملفًا يوضح مقابل كل نمط في تصميمك نمطًا في نظام التصميم.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Token map

Spec §10 / §21.3.1: every figma-migration / code-migration run crosses the same boundary — "the source has its own tokens; the target uses the active OD design system; we need a deterministic mapping". This atom produces that mapping.

Inputs

  • figma/tokens.json from figma-extract (figma-migration), OR
  • code/tokens.json from design-extract (code-migration).
  • The active design system DESIGN.md (already injected into the prompt; the atom reads from the staged design-system context).

Output

project-cwd/
└── token-map/
    ├── colors.json     # { source: '#hex' | 'tokenName', target: '--ds-token' }[]
    ├── typography.json # font + size + weight pairings
    ├── spacing.json    # spacing scale crosswalk
    ├── unmatched.json  # { source: ..., reason: 'no-target-equivalent' }[]
    └── meta.json       # { sourceKind: 'figma' | 'code', generatedAt, atomDigest }

unmatched.json is the audit list a human reviews; the agent must not invent target tokens silently.

Semantic token inference

Figma often exports anonymous source names such as color-3, paint/17, or raw #5B8DEF. Do not ask the user to rename those before mapping. First infer the semantic role from usage evidence:

  • Node path, component name, instance overrides, variant/state labels, frame name, layer name, and nearby text such as Primary, Selected, Link, Error, Focus, Nav, Button, or CTA.
  • CSS-like position in the rendered tree: background fill, foreground text/icon, border, divider, overlay, shadow tint, focus ring, status badge, chart series, or brand/accent treatment.
  • Contrast relationships: a color paired repeatedly with the main canvas is likely foreground; one paired with foreground inside CTA components is likely primary/accent background; a thin outline around interactive elements is likely border or focus-ring.
  • Reuse topology: a value that appears across primary buttons, selected tabs, and active nav items is stronger evidence for --ds-color-primary than a value that appears once in an illustration.

Use that role evidence to choose among existing active design-system tokens and to decide whether an anonymous token should be renamed or left unmatched before the executable mapping pass. Keep the on-disk token-map contract unchanged: the atom still writes the existing bucket files, unmatched.json, and meta.json only.

For example, this is a useful reasoning note for deciding whether color-3 should map to the active primary token:

{
  "source": "color-3",
  "value": "#5B8DEF",
  "role": "primary",
  "targetCandidates": ["--ds-color-primary", "--ds-color-link"],
  "evidence": [
    "Button/Primary fill",
    "Selected tab indicator",
    "Link text in Settings frame"
  ]
}

Then map to an active design-system token only when the evidence is role-based, not value-only. If the top candidates are too close to call, or if the evidence points to conflicting roles (primary vs link vs focus-ring), leave the source token unmatched using the existing no-target-equivalent reason and include the competing candidates in the hint. This keeps automation useful for common anonymous-token cases while preserving human review for ambiguous brand decisions.

Before / after expectation

Without semantic inference, an anonymous Figma token can only produce an uncertain value-level mapping:

{
  "source": "color-3",
  "value": "#5B8DEF",
  "target": null,
  "reason": "no-target-equivalent"
}

With semantic inference, the same token should carry role evidence before it is accepted:

{
  "source": "color-3",
  "value": "#5B8DEF",
  "target": "--ds-color-primary",
  "via": "name"
}

This deterministic v1 atom does not claim a measured accuracy lift by itself. Treat the expected improvement as coverage of previously manual anonymous-token cases when the Figma tree contains enough role evidence. Real accuracy numbers require a fixture suite with known source tokens, expected semantic roles, and a before/after agent run. See examples/semantic-inference-before-after.json for a deterministic same-token-batch simulation that compares the old value-level output with the semantic inference output.

Convergence

The atom completes when every input token is either mapped or explicitly recorded under unmatched.json with a non-empty reason. The until evaluator reads tokens.unmatched.length === 0

…

الأسئلة الشائعة

ما هي «الرموز» (tokens)؟

الرموز هي اللبنات الأساسية للأنماط البصرية في التصميم، مثل لون محدد (كالأزرق #0000FF) أو حجم خط (كـ16px) أو قيمة مسافة (كـ8px).

ماذا يحدث إذا لم يكن لنمط من تصميمي مقابل في نظام التصميم؟

ستسرد المهارة هذه الأنماط في ملف اسمه «unmatched.json»، وتشرح سبب تعذر مطابقتها. وهكذا تراجعها وتقرر ما تفعله بنفسك، بدلًا من أن تخترع المهارة شيئًا.

كيف تعرف المهارة أي نمط في تصميمي يطابق أي نمط في نظام التصميم؟

تستخدم أدلة من التصميم، مثل أسماء المكونات والسياق الذي يُستخدم فيه النمط (كنص الزر)، وعلاقات الألوان، لاستنتاج غرض النمط وإيجاد أفضل تطابق في نظام التصميم.

التفاصيل

الوصف الأصلي من المؤلف

Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.

repo: nexu-io/open-design

الشعبية

نجوم GitHub
101k
الترتيب
#990
الترخيص
Apache-2.0
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة