figma-ios-selection-interaction

figma-ios-selection-interaction is a skill for Cursor from mythkiven/figma-ios-codegen. It costs 85 tokens per session (6,163 once invoked), scanned A, original, MIT.

A guide for generating Swift code for selection controls from prepared Figma design data. It supports single selection, multiple selection, toggles, segmented controls, and keeping the selected data in sync with the screen.

In plain words
What is it for?
Use it when building iOS collection views or buttons from Figma designs that need single-choice, multi-choice, or on/off selection behavior, including optional RxSwift integration.
Why use it?
It turns the visual selected and unselected states in a design into working interaction code, while leaving unrelated business logic separate.

Skill for Cursor

Written for Cursor: installed under .cursor/. Also seen: positional $N argument.

Good fit Use it when building iOS collection views or buttons from Figma designs that need single-choice, multi-choice, or on/off selection behavior, including optional RxSwift integration.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-selection-interaction.svg)](https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-selection-interaction)
Your own site
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-selection-interaction"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-selection-interaction.svg" alt="Measured on agentmods" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,163 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.00085 $0.06163
Opus 5 $0.00043 $0.03082
Sonnet 5 $0.00017 $0.01233
Haiku 4.5 $0.00009 $0.00616

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

Security

Grade A, and why

figma-ios-selection-interaction 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 8d 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-selection-interaction/SKILL.md · 797 lines

How it starts

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

Figma 选择交互逻辑生成

职责范围

  • ✅ 从 figma-ios-preload-data 数据包(design.json)自动识别选择交互模式(单选/多选/Toggle)
  • ✅ 生成选中态变化逻辑(更新数据模型、刷新 UI)
  • ✅ 生成 didSelectItemAt(列表统一 UICollectionView;不用 UITableView / didSelectRowAt
  • ✅ 生成单个按钮 Toggle 逻辑
  • ✅ 集成 RxSwift 交互模式(按 host.interaction;默认也可 target-action,见 rxswift skill)
  • ✅ 保持数据模型与 UI 同步
  • ❌ 不处理业务逻辑(网络请求、页面跳转等,留 TODO 注释)
  • ❌ 不处理动画效果(由其他 Skill 负责)
  • 从 Figma MCP / REST 再拉数据;视觉差异读 design.json(或已由 figma-ios-component-state-recognition 提取的状态)
  • 替代 figma-ios-component-state-recognition(外观 / updateAppearance)与 figma-ios-uicollectionview-codegen(CV 骨架)

适用场景

场景 Figma 特征 生成代码
ListView 单选 多个同类节点,只有 1 个选中 didSelectItemAt + 单选互斥逻辑
ListView 多选 多个同类节点,多个选中 didSelectItemAt + Toggle 逻辑
单个按钮 Toggle 单个节点有选中态 RxSwift tap + Toggle 逻辑
SegmentedControl 多个并列按钮,1 个选中 按钮组 + 单选互斥逻辑

识别规则

规则 1:ListView 单选模式

触发条件(必须全部满足):

def is_single_selection_listview(figma_nodes):
    """
    判断是否为单选 ListView
    """
    # 1. 节点数量 ≥ 2
    if len(figma_nodes) < 2:
        return False
    
    # 2. 有选中态视觉差异(读 design.json 的 fills/strokes/font,见 component-state-recognition)
    if not has_selection_state(figma_nodes):
        return False
    
    # 3. 只有 1 个节点处于选中态
    selected_count = count_selected_nodes(figma_nodes)
    if selected_count != 1:
        return False
    
    # 4. 是 ListView(本仓统一 UICollectionView;见 listview-recognition)
    if not is_listview(figma_nodes):
        return False
    
    return True

识别结果:

{
    'interaction_mode': 'single_selection',
    'default_index': 0,  # 默认选中第一个("绝地求生")
    'ui_component': 'UICollectionView',
    'refresh_mode': 'reload_all'  # 刷新所有 Cell
}

规则 2:ListView 多选模式

触发条件(必须全部满足):

def is_multiple_selection_listview(figma_nodes):
    """
    判断是否为多选 ListView
    """
    # 1. 节点数量 ≥ 2
    if len(figma_nodes) < 2:
        return False
    
    # 2. 有选中态视觉差异
    if not has_selection_state(figma_nodes):
        return False
    
    # 3. 多个节点处于选中态(≥ 2)
    selected_count = count_selected_nodes(figma_nodes)
    if selected_count < 2:
        return False
    
    # 4. 是 ListView
    if not is_listview(figma_nodes):
        return False
    
    return True

Read the full file on GitHub · 797 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. 8d ago First seen · 797 lines · 85 tokens per session scan A b27ab8e9ba64

Subscribe to this mod's changes

figma-ios-selection-interaction is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 1mo ago), licensed MIT. It adds 85 tokens to every session and 6,163 once invoked, about $0.0004 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

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