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 skills add rshankras/claude-code-apple-skills --skill preview-data-generatorgit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote 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/rshankras/claude-code-apple-skills/preview-data-generator)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/preview-data-generator"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/preview-data-generator/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.
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/preview-data-generator"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/preview-data-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00012 | $0.02296 |
| Opus 5 | $0.00006 | $0.01148 |
| Sonnet 5 | $0.00002 | $0.00459 |
| Haiku 4.5 | $0.00001 | $0.00230 |
Grade A, and why
preview-data-generator 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 6d 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 — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Preview Data Generator
Generates two tightly-coupled things for a SwiftUI view:
- Sample data tuned for the Xcode canvas — realistic instances plus the visual edge cases that break layouts (empty, one item, huge list, long/overflowing strings, missing images, error and loading states).
- A
#Previewmatrix — the variant blocks you'd otherwise hand-write to prototype and QA a view across light/dark, Dynamic Type, locale/RTL, device sizes, and data states.
This is the design-time counterpart to testing/test-data-factory (which makes fixtures for the test suite). Where a factory already exists, this skill reuses Model.fixture() instead of inventing parallel data.
When This Skill Activates
Use this skill when the user:
- Wants sample/mock data for Xcode previews ("what do I put in the preview?")
- Wants to preview a view in multiple states (empty / loading / error / loaded)
- Is prototyping UI and wants light/dark, Dynamic Type, RTL, or device variants
- Says "add previews", "preview matrix", "preview this in dark mode + large text"
- Has a SwiftData
@Modeland needs an in-memory seeded container for previews - Is on Xcode 16 / iOS 18 and wants shared, cached preview data via
PreviewModifier
Just need fixtures for unit tests? Use testing/test-data-factory instead.
Want screenshot regression tests? Pair this with testing/snapshot-test-setup — the same data + variant matrix feeds snapshot tests.
Reference Files
Load both before generating:
| File | Purpose |
|---|---|
| preview-data-patterns.md | Sample-data design, the edge-case catalog, SwiftData in-memory seeding, PreviewModifier (iOS 18), @Previewable, reusing test-data-factory |
| preview-matrix.md | The variant axes, preview traits:, .environment overrides, deployment-target fallbacks (#Preview vs PreviewProvider), data-state previews |
Pre-Generation Checks
Generators are context-aware. Before writing code, detect:
| Check | How | Why it matters |
|---|---|---|
| Deployment target | Read project/.xcodeproj or Package.swift |
iOS 17+ → #Preview macro; iOS 18+ → PreviewModifier + @Previewable; below 17 → PreviewProvider fallback |
| Target view + its models | Read the view file; Grep its init/properties for model types |
Determines which types need sample data |
| Existing fixtures | Grep "static func fixture|extension .*{ static (let|var) preview" |
Reuse Model.fixture() / existing .preview — never duplicate |
| SwiftData | Grep "@Model" on the model types |
Use the in-memory .modelContainer(inMemory:) seed pattern, not plain structs |
| View shape | Does it take a model, a ViewModel, or fetch its own data? | Drives whether to inject data, a mock VM, or a seeded container |
| Platform | iOS / macOS / multiplatform | Device variants and some traits differ |
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 6d ago First seen · 173 lines · 12 tokens per session scan A 70ace88bf1bb
preview-data-generator is a skill published in the GitHub repository rshankras/claude-code-apple-skills (710 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 2,296 once invoked, about $0.0001 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-09-03.
Other skills, from other repositories
apple-hig-ux
Apple-platform design and UX judgment — what a good iOS/iPadOS/macOS/watchOS/visionOS app FEELS like. Use whenever designing app screens or flows, answering Human Interface Guidelines (HIG) questions, judging "does this feel native", running a UX review of an Apple-platform app, choosing navigation patterns (tabs vs…
swift-accessibility-pro
Use when making SwiftUI/UIKit apps accessible — VoiceOver labels and traits, Dynamic Type, color contrast, Reduce Motion, and accessibility testing.
mobile-design
Mobile UX patterns, touch interactions, gesture design, mobile-first principles, app navigation, and mobile performance.
liquid-glass
Build iOS 26+ SwiftUI interfaces with Apple's Liquid Glass design language. Use when writing SwiftUI for iOS 26 / iPadOS 26 / macOS Tahoe (26) / watchOS 26 / tvOS 26 / visionOS 26, when the user mentions Liquid Glass, .glassEffect, GlassEffectContainer, iOS 26 design, glass material, glass button, or asks to redesign…
android-development
Android development with Kotlin, Jetpack Compose, and modern Android architecture. Use when building Android apps, implementing Material Design, or following Android best practices.
ios-development
Comprehensive guide for building native Apple platform applications.