Figma ios variables detection
Skill mythkiven/figma-ios-codegen/.cursor/skills/figma-ios-variables-detection
Figma to iOS UIKit codegen: deterministic data package + Agent skills (Cursor/Claude) for baseline Swift UI.
npx -y skills add mythkiven/figma-ios-codegen --skill figma-ios-variables-detectionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 25 days oldThe repository was created 25 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Translate Figma Variables multi-mode warnings (already detected by figma-ios-preload-data) into top-of-file Swift comments so dark mode is not silently dropped. Use when generating Swift code from a data package whose summary.has_dark_mode is true.
SKILL.md
1.7 KB, as published. Nobody here has run it
Figma Variables 多 Mode 警告处理(消费数据包)
数据来源
{data_dir}/manifest.json:summary.has_dark_mode(bool) 与warnings[]{data_dir}/variables.json:原始 Variables 数据,含每个 Mode 的 token 值(按需查阅)
处置规则
1. has_dark_mode == true
在生成的 Swift 文件顶部追加 banner 注释:
// ============================================================
// ⚠️ WARNING: Dark Mode 未生成
// ============================================================
// 设计稿在 Figma Variables 中定义了多个 Mode(含暗色模式),
// 当前生成的代码只覆盖了 Light Mode 的颜色 token。
//
// 暗色处理建议:
// 1. 用 UIColor(dynamicProvider:) 包裹关键颜色
// 2. 或基于 traitCollection.userInterfaceStyle 在 traitCollectionDidChange 切换
// 3. 详细 Mode 列表与 token 值见 {data_dir}/variables.json
// ============================================================
2. has_dark_mode == false
不输出任何 dark mode 注释。
3. 其他 warning(如 Token referenced but not resolved)
转为代码顶部 // WARNING: <msg> 单行注释。
自检清单
- 已读
manifest.json -
has_dark_mode==true时已加 banner 注释 - 其他 warnings 已逐条转为代码注释
- 没有调用
detect_figma_variables.py或 MCPget_variable_defs