figma-ios-vertical-layout-safearea

figma-ios-vertical-layout-safearea is a skill for Cursor from mythkiven/figma-ios-codegen. It costs 120 tokens per session (4,048 once invoked), scanned A, original, MIT.

A guide for placing vertically arranged iOS views from Figma designs while respecting different iPhone sizes and the safe area. The safe area is the part of the screen that avoids system elements such as the status bar and home indicator.

In plain words
What is it for?
Use it when generating UIKit constraints for screen tops, bottoms, heights, scrolling containers, sticky elements, and safe-area insets from Figma measurements.
Why use it?
It prevents vertical layouts from drifting across devices by forbidding incorrect width-based scaling and unsupported spacing adjustments.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when generating UIKit constraints for screen tops, bottoms, heights, scrolling containers, sticky elements, and safe-area insets from Figma measurements.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-vertical-layout-safearea"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-vertical-layout-safearea.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,048 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.00120 $0.04048
Opus 5 $0.00060 $0.02024
Sonnet 5 $0.00024 $0.00810
Haiku 4.5 $0.00012 $0.00405

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

Security

Grade A, and why

figma-ios-vertical-layout-safearea 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 10d 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-vertical-layout-safearea/SKILL.md · 446 lines

How it starts

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

Figma 垂直布局与安全区识别规范

版本: v2.1 最后更新: 2026-04-20


⛔ 红线规则(最高优先级)

1. 禁止用宽度比例 scale 缩放垂直方向

// ❌ 严重错误:把宽度比例用在 y / height
let scale = /* host.utils.screen_width */ / 375.0
view.snp.makeConstraints { make in
    make.top.equalTo(...).offset(49 * scale)        // ❌
    make.height.equalTo(111 * scale)                 // ❌
    make.bottom.equalToSuperview().offset(-34 * scale) // ❌
}

垂直方向只允许以下三种写法:

场景 写法
相对相邻元素的固定 gap make.top.equalTo(prev.snp.bottom).offset(figma_gap)
相对 safeArea make.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom).offset(-figma_gap)
元素本身的 height/width make.height.equalTo(figma_h)(直接用 Figma 实测值,不乘 scale

理由:scale = 屏宽 / 375 仅反映横向像素缩放。如果把它用在 y / height,iPhone SE(375)和 iPhone 16 Pro Max(430)会产生 ~14% 的纵向偏差,严重时按钮会被吃掉、内容跑出 safeArea。设计稿的 y / height 是固定 pt,不应随屏宽缩放。

2. 禁止把 safeArea.top 当导航栏底

如果设计稿没有原生导航栏(直接是吸顶卡片),用 view.safeAreaLayoutGuide.snp.top 即可;如果有导航栏,用 host.jsonutils.status_bar_nav_height 的表达式,不要混用

3. 禁止凭空给容器加 padding/margin

任何 offset 都要能从 Figma frame.absolute / frame.relative 推出来,禁止"看着别扭加 12pt"。如果数据不对,先回 design.json 找根因,不要在代码里加补丁。

4. Scroll 容器的顶/底必须锚定邻居,禁止硬编码 y/height ⭐️

如果页面上存在 _role.is_sticky_top / is_sticky_bottom 节点(见 audit.json.sticky_keyword_hits,关键字:吸顶 / 吸底 / sticky_top / sticky_bottom),它们之间的 scroll 承载区必须把顶/底约束到这些 sticky 节点上:

// ❌ 错误:scroll 容器用绝对 y/height(已在 341:313 '垂直滚动' 事故中出现)
formScrollView.snp.makeConstraints { make in
    make.top.equalToSuperview().offset(195)
    make.height.equalTo(407)   // iPhone 8 上直接盖掉底部吸底按钮
}

// ✅ 正确:顶对 sticky_top.bottom,底对 sticky_bottom.top
formScrollView.snp.makeConstraints { make in
    make.leading.trailing.equalToSuperview()
    make.top.equalTo(stepStripContainer.snp.bottom).offset(figma_gap_top)
    make.bottom.equalTo(bottomBarContainer.snp.top).offset(-figma_gap_bottom)
}

判定依据:audit.json 里 sticky_keyword_hits[].sibling_rule 会明确列出本规则。


⚡ 核心原则

Read the full file on GitHub · 446 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. 10d ago First seen · 446 lines · 120 tokens per session scan A 06b043921c4c

Subscribe to this mod's changes

figma-ios-vertical-layout-safearea is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 2mo ago), licensed MIT. It adds 120 tokens to every session and 4,048 once invoked, about $0.0006 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