figma-ios-vector-vs-code

figma-ios-vector-vs-code is a skill for Cursor from mythkiven/figma-ios-codegen. It costs 65 tokens per session (8,684 once invoked), scanned A, original, MIT.

A guide for deciding whether a Figma vector should be drawn with iOS code or downloaded as an image asset. It keeps text, components, icons, and list-like content as separate, editable elements when needed.

In plain words
What is it for?
Use it when converting Figma shapes, icons, masks, and illustrations into iOS views or image assets while preserving editable text and interactions.
Why use it?
It prevents interactive or changeable design content from being trapped inside a single static image.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when converting Figma shapes, icons, masks, and illustrations into iOS views or image assets while preserving editable text and interactions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code
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-vector-vs-code
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-vector-vs-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code/github.svg)](https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code)
Your own site
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code/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-vector-vs-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,684 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.00065 $0.08684
Opus 5.5 $0.00026 $0.03474
Sonnet 5.5 $0.00013 $0.01737
Haiku 4.5 $0.00006 $0.00868

Measured 2mo ago against content hash 8d8cf2c26001, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

figma-ios-vector-vs-code 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 2mo 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-vector-vs-code/SKILL.md · 909 lines

How it starts

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

Figma 矢量图形处理策略

⛔ 红线规则(最高优先级,覆盖所有下文)

含「语义子节点」的容器节点,即使被 figma-ios-preload-data 标记为 is_export_asset=true,也禁止整组用切图替代,必须按子节点逐一生成代码。

判定:什么是「语义子节点」

只要节点的子树(含跨层)中任意一个节点满足以下任一条件,该节点就含语义子节点:

条件 说明 例
type == "TEXT" 含可读文本 "STEP.1"、"找人试音"、"绝地求生"
type == "INSTANCE" 含组件实例(按钮/标签/图标 …) 品类卡片、段位标签、性别 pill
_role.is_iconfont == true 含 iconfont next/query/check 图标
_role.is_iconfont_library 含 iconfont 集合容器 iconfont_24
_role.is_list_container 含横向 / 纵向列表容器 可滚动、Tag 集合

设计师在 Figma 上勾导出(export)经常是出于"备份给开发"目的,不代表这个组应该当成一张静态图。把"步骤条整组""5 个品类整组"做成切图,会直接导致:① 文字写死、改不了;② 状态切换不可能(选中/未选中);③ 国际化失败;④ 视觉看似 OK 实则功能完全缺失。这是历史上多次出现的高发陷阱,必须强制规避。

决策伪代码(先于"代码绘制 vs 下载图片"决策)

def can_use_export_asset(node):
    if not (node.get("export") or {}).get("is_export_asset"):
        return False
    # 判定是否含语义子节点
    for child in walk_subtree(node):
        if child["type"] in ("TEXT", "INSTANCE"):
            return False
        role = child.get("_role") or {}
        if role.get("is_iconfont") or role.get("is_iconfont_library"):
            return False
        if role.get("is_list_container"):
            return False
    return True   # 子树纯几何/矢量,整组切图安全

允许整组切图的典型场景(白名单)

  • 纯位图节点(fills[].type == "IMAGE")
  • BOOLEAN_OPERATION 美术字 / Logo(无 TEXT 子节点)
  • 纯矢量装饰(背景插画、底纹)
  • 单个 imageset 的图标(无子节点)

红线违反后的处置

如果你已经写出 UIImageView(image: UIImage(named: "img_xxx")) 来代替一个含 TEXT/INSTANCE 的节点,回退该实现,改为:

  1. 把这个 GROUP/FRAME 当作 UIView 容器;
  2. 它的子节点逐一生成对应的 UILabel / UIButton / UIView / iconfont UILabel;
  3. 不需要切图(因为切图是为了避免重写美术字之类的 BOOLEAN_OPERATION,与文字/图标无关)。

例外:节点确实是「设计师做的截屏占位图」(如设计稿里贴了一张"竞品截图"用作后续修改参考),且团队明确要先按图占位的 → 在代码顶部加 // TODO(阶段2): 拆解 <node_id> <name> 为子节点实现,并在 README 列出,不允许直接当阶段 2 交付。


本 Skill 的职责

规定在 Figma → iOS 代码生成时:

  • 哪些矢量图形必须下载为图片 Assets
  • 哪些矢量图形应该用代码绘制(UIView + CALayer + UIBezierPath)
  • 如何判断和决策

决策流程图

Figma 矢量节点
    ↓
┌──────────────────────────────────────┐
│ 1. 是否为简单几何形状?               │
│   - 矩形、圆角矩形、圆形、椭圆       │
│   - 纯色填充或简单渐变               │
│   - 无复杂路径或布尔运算             │
└──────────────────────────────────────┘
    ↓ 是                    ↓ 否
 用代码绘制            继续判断
                            ↓
┌──────────────────────────────────────┐
│ 2. 是否为复杂矢量图形?               │
│   - 贝塞尔曲线路径(≥3个)           │
│   - 布尔运算(UNION/SUBTRACT/EXCLUDE)│
│   - 美术字体、Logo、特殊图标         │
└──────────────────────────────────────┘
    ↓ 是                    ↓ 否
 下载为图片             用代码绘制

Read the full file on GitHub · 909 lines

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. 2mo ago First seen · 909 lines · 65 tokens per session scan A 8d8cf2c26001

Subscribe to this mod's changes

figma-ios-vector-vs-code is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 3mo ago), licensed MIT. It adds 65 tokens to every session and 8,684 once invoked, about $0.0003 per session on Opus 5.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

sleek-design-mobile-apps

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

sleekdotdesign/agent-skills · 30 tokens

compose-ui

Writes and reviews composables for Compose and CMP: the Route/Screen/leaf split, state-read placement and stability, loading/empty/error UX states, LazyColumn lists and grids, animation choice, accessibility and semantics, design-system tokens, CMP Res resources, Coil images, and keyboard/focus. Use when touching…

Meet-Miyani/compose-skill · 148 tokens

cometchat-flutter-v6-customization

Theme and brand the Flutter v6 UI Kit — light/dark mode, the CometChatColorPalette / CometChatTypography / CometChatSpacing theme extensions, per-widget style objects, and view slots. Triggers: 'change chat colors flutter', 'dark mode chat flutter', 'match my brand flutter', 'customize cometchat theme flutter'…

cometchat/cometchat-skills · 89 tokens

Audit Apple-platform UI work against Human Interface Guidelines with HIG Doctor

Run a repeatable HIG compliance audit over app code before shipping UI changes, then use the findings to guide remediation.

agentskillexchange/skills · 38 tokens