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-uicollectionview-codegennpx skills add mythkiven/figma-ios-codegen --skill figma-ios-uicollectionview-codegengit 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-uicollectionview-codegen)<a href="https://agentmods.dev/skills/mythkiven/figma-ios-codegen/figma-ios-uicollectionview-codegen"><img src="https://agentmods.dev/badge/skills/mythkiven/figma-ios-codegen/figma-ios-uicollectionview-codegen.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.1 | $0.00078 | $0.07443 |
| Opus 5 | $0.00039 | $0.03721 |
| Sonnet 5 | $0.00016 | $0.01489 |
| Haiku 4.5 | $0.00008 | $0.00744 |
Grade A, and why
figma-ios-uicollectionview-codegen 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 5d 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 — 670 lines — stays where its author put it; the contents beside it link to each section on GitHub.
UICollectionView 代码生成
⚡ QUICK_REF(Agent 优先读此处)
核心定位:本 SKILL 提供"流程框架 + 指导原则 + 强制约束",具体如何分析和生成代码由大模型根据实际场景判断。
本 skill 的定位:阶段 2 基础 UI 代码生成(UI + 临时模型 + Mock 数据 + 交互骨架),阶段 3 会用 PRD + 接口文档把 mock 换成真实接口、临时模型换成 API 模型,本 skill 不管阶段 3。
核心流程(6 步):
- 分析 Cell 结构 → 遍历所有子节点,识别布局和元素
- 推断临时模型字段 → 根据语义推断阶段 2 临时 struct(阶段 3 会用真实 API 模型替换)
- 生成 Mock 数据 → 阶段 2 强制(图片走
manifest.json.mock.default_image_url,其他字段语义生成) - 生成 CollectionView → lazy var + layout + DataSource
- 生成 Cell 代码 → 子视图 + 布局(SnapKit)+ configure 方法
- 生成交互逻辑 → didSelectItemAt(有选中态 → toggle;无 → print +
// TODO(阶段3): 补业务跳转/网络请求)
生成内容清单
| 组件 | 说明 | 必须 |
|---|---|---|
| Model 定义 | 根据子元素推断字段 | ✅ |
| Mock 数据 | 从 Figma 提取或生成占位 | ✅ |
| CollectionView | lazy var + layout 配置 | ✅ |
| Cell 定义 | configure(item:) 方法 | ✅ |
| DataSource | numberOfItemsInSection + cellForItemAt | ✅ |
| Delegate | didSelectItemAt 交互逻辑 | ✅ |
| LeftAlignedFlowLayout | 标签集合专用(可选) | ⚠️ |
强制约束(质量保证)
✅ 必须遵守:
- 模型必须包含
id字段 - 必须使用 Model,禁止字符串数组
- 颜色/字体走 bindings map(未命中用 UIKit fallback)
- 布局按 host.layout_engine(默认相对约束;可用 SnapKit 或原生 Auto Layout)
- 交互逻辑:有
isSelected→ toggle + reload;无 → print - 访问级别匹配:DataSource / Delegate 的 extension 访问级别必须等于宿主类。详见下方「访问级别匹配规则」。
❌ 严格禁止:
- 禁止跳过流程步骤
- 禁止硬编码数据(必须从 Figma 提取或根据语义生成)
- 禁止同时使用
estimatedItemSize和sizeForItemAt - 禁止生成不完整的代码
- 禁止
public class配extension(默认 internal)的搭配 —— 必报「Method must be declared public」编译错误。
访问级别匹配规则(强制,避免协议一致性报错)
报错形态(这是本规则要根除的):
Method 'collectionView(_:numberOfItemsInSection:)' must be declared public
because it matches a requirement in public protocol 'UICollectionViewDataSource'
原因:public 类实现 public 协议,方法访问级别必须 ≥ public,但 extension 默认是 internal。
另一常见报错(同文件内独立 UICollectionViewCell 子类 + configure(item:)):
Method must be declared fileprivate because its parameter uses a private type
原因:数据模型写成 private struct FooItem,而 Cell 的 func configure(item: FooItem) 默认为 internal。方法的可见性不能高于签名中出现的类型——private 类型只能出现在 private / fileprivate 成员签名里。
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.
- 5d ago First seen · 670 lines · 78 tokens per session scan A 8bd965018d18
figma-ios-uicollectionview-codegen is a skill published in the GitHub repository mythkiven/figma-ios-codegen (9 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 7,443 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.
Other skills, from other repositories
build-and-run-macos-app
Slash command that creates or updates the project-local macOS script/buildandrun.sh and uses it as the default build/run entrypoint. Invoke explicitly with /build-and-run-macos-app — this skill never self-triggers.
mcp-sdk-audit
Upgrade @modelcontextprotocol/server (the MCP TypeScript SDK v2) and prove the wire contract survived. The SDK is a runtime dependency whose breakage lands on the wire, not in the type checker — so this sorts each release by which SDK source files it touched (Figwright uses only the server + stdio slice of a…
firebase-messaging
Use when setting up Firebase Cloud Messaging, managing permissions and tokens, handling background/foreground notification taps, or dispatching messages server-side (HTTP v1).
firebase-app-check
Use when implementing app attestation, configuring App Check providers, setting up debug tokens, enabling backend enforcement, or managing token refresh.
flutter-app-architecture
Use when scaffolding a project, refactoring into layers, creating view models/repositories, configuring dependency injection, or implementing unidirectional data flow (MVVM).
firebase-crashlytics
Use when implementing crash reporting, capturing fatal/non-fatal errors, recording isolate/async exceptions, customizing reports, or uploading obfuscated symbols.