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.
npx agentmods add skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-codenpx skills add mythkiven/figma-ios-codegen --skill figma-ios-vector-vs-codegit clone --depth 1 https://github.com/mythkiven/figma-ios-codegenWrote 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.
[](https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-vector-vs-code)<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="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00065 | $0.08684 |
| Opus 5 | $0.00032 | $0.04342 |
| Sonnet 5 | $0.00013 | $0.01737 |
| Haiku 4.5 | $0.00006 | $0.00868 |
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 4d 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.
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 的节点,回退该实现,改为:
- 把这个 GROUP/FRAME 当作
UIView容器; - 它的子节点逐一生成对应的
UILabel/UIButton/UIView/ iconfontUILabel; - 不需要切图(因为切图是为了避免重写美术字之类的 BOOLEAN_OPERATION,与文字/图标无关)。
例外:节点确实是「设计师做的截屏占位图」(如设计稿里贴了一张"竞品截图"用作后续修改参考),且团队明确要先按图占位的 → 在代码顶部加
// TODO(阶段2): 拆解 <node_id> <name> 为子节点实现,并在 README 列出,不允许直接当阶段 2 交付。
本 Skill 的职责
规定在 Figma → iOS 代码生成时:
- 哪些矢量图形必须下载为图片 Assets
- 哪些矢量图形应该用代码绘制(
UIView+CALayer+UIBezierPath) - 如何判断和决策
决策流程图
Figma 矢量节点
↓
┌──────────────────────────────────────┐
│ 1. 是否为简单几何形状? │
│ - 矩形、圆角矩形、圆形、椭圆 │
│ - 纯色填充或简单渐变 │
│ - 无复杂路径或布尔运算 │
└──────────────────────────────────────┘
↓ 是 ↓ 否
用代码绘制 继续判断
↓
┌──────────────────────────────────────┐
│ 2. 是否为复杂矢量图形? │
│ - 贝塞尔曲线路径(≥3个) │
│ - 布尔运算(UNION/SUBTRACT/EXCLUDE)│
│ - 美术字体、Logo、特殊图标 │
└──────────────────────────────────────┘
↓ 是 ↓ 否
下载为图片 用代码绘制
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.
- 4d ago First seen · 909 lines · 65 tokens per session scan A 8d8cf2c26001
figma-ios-vector-vs-code is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 8,684 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.
Other skills, from other repositories
liquid-glass
Implement, refactor, or review modern macOS SwiftUI UI for the new design system and Liquid Glass. Use when adopting Liquid Glass, updating NavigationSplitView, toolbars, search, sheets, and controls, removing custom backgrounds that fight system materials, or building custom glass surfaces with glassEffect…
figma-typings-audit
Upgrade @figma/plugin-typings and absorb what the new version exposes. Diffs the .d.ts between the installed and the target version (that package ships no changelog), sorts the changes into breakage / new API / silently-added fields, maps each onto the sandbox handlers, the hand-written Zod mirrors in shared, and the…
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…
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.…
ios-rocketsim-operator
RocketSim iOS Simulator UI: inspect and control accessibility state, gestures, typing, hardware buttons, and CLI automation.
swiftui-animation-match
Match UI/UX interaction needs to proven SwiftUI animation patterns from curated open-source catalogs. Use when planning or building iOS/macOS screens where an interaction should feel alive - loaders, likes, toggles, card decks, reveals, shaders - or when asked which animation fits a moment. Recommends system-first…