figma-ios-design-token-mapping

figma-ios-design-token-mapping is a skill for Cursor from mythkiven/figma-ios-codegen. It costs 54 tokens per session (1,414 once invoked), scanned A, original, MIT.

A mapping guide that turns Figma colors and fonts into Swift code using project-provided JSON maps. When a value is not mapped, it uses standard UIKit code as a fallback.

In plain words
What is it for?
Use it when generating Swift UI from Figma nodes with colors or text, including when comments provide corrected color information.
Why use it?
It keeps generated UI code aligned with the project’s existing design tokens and avoids inventing unavailable design-system APIs.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when generating Swift UI from Figma nodes with colors or text, including when comments provide corrected color information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mythkiven/figma-ios-codegen --skill figma-ios-design-token-mapping
Clone the repo
git clone --depth 1 https://github.com/mythkiven/figma-ios-codegen

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for figma-ios-design-token-mapping

README.md
[![agentmods](https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping/github.svg)](https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping)
Your own site
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for figma-ios-design-token-mapping

Your own site · 80×15
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-design-token-mapping.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,414 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.01414
Opus 5 $0.00027 $0.00707
Sonnet 5 $0.00011 $0.00283
Haiku 4.5 $0.00005 $0.00141

Measured 10d ago against content hash 04eda09be051, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

figma-ios-design-token-mapping scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/figma-ios-design-token-mapping/SKILL.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

颜色 / 字体:映射表优先,未命中走标准 UIKit

权威配置.cursor/bindings/color_map.json.cursor/bindings/font_map.json
示例包(MK):.cursor/bindings/examples/mk/
说明:.cursor/bindings/README.md
本 skill 写死任何设计系统类名;宿主 token 只活在映射 JSON 的 value 里。

核心规则(强制)

Figma 颜色/字体
  → 查 bindings 对应 map
  → 命中:原样输出 map 里的代码片段
  → 未命中:用同文件 fallback 模板(标准 UIKit)

禁止:

  • ❌ 无视映射表手写未在 map 中的宿主 API / 臆造 token
  • ❌ 映射未命中时编造不存在的设计系统 API
  • ❌ 把映射 value 再「翻译」一遍(value 已是最终代码)

1. 颜色

数据来源

design.json[node_id].fills[].color(已是 rgba(r,g,b,a) 字符串)。
TEXT 文字色也在 fills[].colortext 字段只是文案字符串,没有 text.color)。
评论色变更:comments.jsonconfidence>=medium 且含 color / color_correction 的评论优先于节点 fills(阶段 1 把颜色写进 design.json,与 iconfont 回写不同)。

查表步骤

  1. .cursor/bindings/color_map.json
  2. 用节点颜色按以下 key 依次尝试(命中即停):
    • 数据包原文,如 rgba(255,255,255,0.9)
    • 规范化:rgba(r,g,b,1) / rgba(r,g,b,0.9)(alpha=1 不写 .0
    • hex:#FFFFFF 或带 alpha #FFFFFFE6
    • 旧式元组:255,255,255,0.9
  3. 命中 → 输出 map[key](本仓示例如 MKUIStyle.mk_c12()
  4. 未命中 → 用 fallback,替换占位符:
占位符 含义
{r} {g} {b} 0–255 整数
{a} 0–1 透明度

默认 fallback:

UIColor(red: {r}/255.0, green: {g}/255.0, blue: {b}/255.0, alpha: {a})

映射文件形状

{
  "schema_version": "1.0.0",
  "fallback": "UIColor(red: {r}/255.0, green: {g}/255.0, blue: {b}/255.0, alpha: {a})",
  "map": {
    "#FFFFFF": "MKUIStyle.mk_c12()",
    "rgba(255,255,255,0.9)": "MKUIStyle.mk_c12_90()"
  }
}

map 为空 = 全部走 UIKit(适合个人开发者)。
接入宿主色板:把「色值 → 一段 Swift 代码」写入 map,或从 examples/mk/ 复制后按需改。详见 bindings/README


2. 字体

数据来源

design.json[node_id].font(含 family / style 或 weight / size)与 text

查表步骤

  1. .cursor/bindings/font_map.json
  2. 构造 key(与 examples/mk 的 font_map 一致):{family},{Weight},{size}
    例:PingFang SC,Medium,14
    亦尝试:{family}|{Weight}|{size}
  3. 命中 → 输出 map[key](本仓示例如 MKUIStyle.mk_f14_m()
  4. 未命中 → 用 fallback

Read the full file on GitHub · 139 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 139 lines · 54 tokens per session scan A 04eda09be051

Subscribe to this mod's changes

figma-ios-design-token-mapping is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 2mo ago), licensed MIT. It adds 54 tokens to every session and 1,414 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

figma-codegen

Generate framework-aware code from a Figma design. Reads the project's stack profile and emits code matching the existing framework (React/Vue/Svelte/Next/etc.) and styling (Tailwind/CSS/CSS-in-JS), reusing existing components and design tokens instead of regenerating from scratch. Triggers whenever the user wants a…

awdr74100/figwright · 145 tokens

figma-build

Build a Figma design from code or a description — the reverse of figma-codegen. Reuses the connected file's existing design system (components, variables, styles) instead of drawing primitives with hardcoded values. Triggers whenever the user wants something created or updated IN Figma from code or a spec — e.g.…

awdr74100/figwright · 180 tokens

app-icon-studio

Apple app icons: create, generate, evaluate, export, install, or debug iOS AppIcon.appiconset and macOS .icns assets for small-size clarity.

Xopoko/build-swift-apps · 40 tokens

macos-window-architect

Use SwiftUI scene/window modifiers first; switch to macos-appkit-bridge only when SwiftUI cannot express the behavior.

Xopoko/build-swift-apps · 46 tokens

ios-liquid-glass-designer

Implement, refactor, or review iOS 26+ SwiftUI Liquid Glass with native glassEffect, GlassEffectContainer, button styles, availability gates, and non-glass fallbacks.

Xopoko/build-swift-apps · 47 tokens

unship

Compare agent-made alternatives in a local browser preview with Unship. Use for comparison setup, iteration, Canvas, selection, cleanup, and Unship installation or update troubleshooting.

mbenhard/unship · 37 tokens