figma-ios-component-state-recognition

figma-ios-component-state-recognition is a skill for Cursor from mythkiven/figma-ios-codegen. It costs 90 tokens per session (2,340 once invoked), scanned A, original, MIT.

A guide for detecting visual states in Figma components, such as selected, unselected, enabled, or disabled, and reflecting those states in UIKit code.

In plain words
What is it for?
It helps identify component states, find the default selected state, generate an updateAppearance() method, and switch between state-specific visual assets or styles.
Why use it?
It prevents state changes from missing visual differences in colors, borders, text, fonts, opacity, or images.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit It helps identify component states, find the default selected state, generate an updateAppearance() method, and switch between state-specific visual assets or styles.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-component-state-recognition"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-component-state-recognition.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,340 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.00090 $0.02340
Opus 5 $0.00045 $0.01170
Sonnet 5 $0.00018 $0.00468
Haiku 4.5 $0.00009 $0.00234

Measured 9d ago against content hash 8ac0e0683854, 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-component-state-recognition 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 9d 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-component-state-recognition/SKILL.md · 212 lines

How it starts

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

Figma 组件状态特征提取与代码生成

职责边界

  • ✅ 从数据包 design.json 识别组件有哪些视觉状态(selected/unselected/disabled/enabled)
  • ✅ 提取每种状态的视觉特征(背景色、边框、文字颜色、字体字重)
  • ✅ 生成 updateAppearance() 状态切换代码(Pattern A / Pattern B)
  • ✅ 识别默认选中项
  • ❌ 不识别组件是什么类型(Selector/Stepper/Toggle)→ 见 figma-ios-standard-components
  • ❌ 不处理点击后的交互逻辑 → 见 figma-ios-selection-interaction
  • ❌ 不处理动画效果

⚡ QUICK_REF

⚠️  数据来源:design.json[node_id](fills / strokes / font / iconfont 已规范化)
          assets/ios/manifest.json(状态图)
          comments.json(评论修正状态颜色)
          禁止跨组件颜色复用(不同组件视觉规范可能不同)

同类节点中,主题色特征 = 已选中;灰色/低透明度 = 未选中
状态差异维度:背景色 / 边框 / 文字颜色 / 字体字重(Regular ↔ Medium)
默认选中:背景/边框/文字用了主题色的那个节点
Pattern A(简单图形)→ 代码绘制背景 + updateAppearance()
Pattern B(复杂图形)→ UIImageView + 两张 asset + updateAppearance()
生成后必查:updateAppearance() 覆盖了所有差异维度 + configure() 里调用了它

状态识别规则

规则 0:数据来源

唯一数据来源{data_dir}/design.json(图片状态切换:assets/ios/manifest.json

字段已规范化:

  • node.fills[].color / node.strokes[].colorrgba(...)TEXT 文字色也在 fills,无 text.color
  • node.text(字符串文案)/ node.font.{family,weight,size}
  • node.iconfont.{symbol,color,size_hint}
  • node.corner_radius / node.opacity
  • node.comments[](高优先级覆盖,详见 figma-ios-comments-integration)

阶段 2 不再调 MCP / REST,也不需要判断数据优先级(已在数据包内固化)。

禁止跨组件颜色复用

❌ 禁止:品类 Cell 参考性别按钮的颜色
✅ 允许:在代码注释中标注"⚠️  参考节点 X:Y(设计模式相同)"

如果某节点缺字段

1. 检查 design.json[node_id] 是否存在该节点
2. 仍缺失 → 代码加 TODO 注释 + 用语义默认色,并在 README "待人工确认" 列出

规则 A:同类节点的差异 = 状态差异

对比并列的同类节点,找视觉差异:

特征 已选中(Selected) 未选中(Unselected) 字段
背景色 主题色(如 #FFF606 alpha 0.1) 灰色 / 低透明度 node.fills[].color
边框 主题色边框 0.5~1px 无边框 或 灰色 node.strokes[].color / node.stroke_weight
文字颜色 主题色 白色 80% / 灰色 TEXT 节点 fills[].color
字体字重 Medium / Bold Regular node.font.weight
背景图片 已选中 asset 未选中 asset assets/ios/manifest.json

Read the full file on GitHub · 212 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. 9d ago First seen · 212 lines · 90 tokens per session scan A 8ac0e0683854

Subscribe to this mod's changes

figma-ios-component-state-recognition is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 2mo ago), licensed MIT. It adds 90 tokens to every session and 2,340 once invoked, about $0.0005 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