Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generates sample data and a SwiftUI Preview variant matrix covering edge cases, light/dark, Dynamic Type, and RTL.
50% 82%+32 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 11 of 22 without it.
Generate a SwiftUI Canvas preview for `ReceiptView` displaying an expense line item, specifically testing how right-to-left layout and German text fit on screen.
The preview applies a locale environment override using .environment(\.locale, .init(identifier: "de")).
3 of 3 safety checks passed
Generates two tightly-coupled things for a SwiftUI view:
#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.
Use this skill when the user:
@Model and needs an in-memory seeded container for previewsPreviewModifierJust 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.
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 |
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 |
Next to this one in the catalogue, plus more from the same author.