preview-data-generator

preview-data-generator is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 12 tokens per session (2,296 once invoked), scanned A, original, MIT.

A sample-data and preview setup for SwiftUI views in Xcode. It creates realistic examples and edge cases such as empty, loading, error, long-text, and large-list states.

In plain words
What is it for?
Use it to build Xcode preview variants for light and dark mode, large text, different device sizes, right-to-left languages, and common data states.
Why use it?
It makes it easier to see how a screen behaves across different data and display conditions before connecting it to real data.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Good fit Use it to build Xcode preview variants for light and dark mode, large text, different device sizes, right-to-left languages, and common data states.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/preview-data-generator
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 rshankras/claude-code-apple-skills --skill preview-data-generator
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

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 preview-data-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/preview-data-generator/github.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/preview-data-generator)
Your own site
<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.

agentmods 80×15 button for preview-data-generator

Your own site · 80×15
<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>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,296 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00012 $0.02296
Opus 5 $0.00006 $0.01148
Sonnet 5 $0.00002 $0.00459
Haiku 4.5 $0.00001 $0.00230

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

Security

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.

skills/generators/preview-data-generator/SKILL.md · 173 lines

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:

  1. 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).
  2. A #Preview matrix — 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 @Model and 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

Read the full file on GitHub · 173 lines

Files

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.

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. 6d ago First seen · 173 lines · 12 tokens per session scan A 70ace88bf1bb

Subscribe to this mod's changes

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.

Related

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…

Dev869/swift-tothemax · 164 tokens

swift-accessibility-pro

Use when making SwiftUI/UIKit apps accessible — VoiceOver labels and traits, Dynamic Type, color contrast, Reduce Motion, and accessibility testing.

laxrajpurohit/swift-skills-pro · 33 tokens

mobile-design

Mobile UX patterns, touch interactions, gesture design, mobile-first principles, app navigation, and mobile performance.

manutej/luxor-claude-marketplace · 23 tokens

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…

heyparsadev/liquid-glass-skill · 105 tokens

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.

travisjneuman/.claude · 33 tokens

ios-development

Comprehensive guide for building native Apple platform applications.

travisjneuman/.claude · 43 tokens