Skip to content
Skills Library
Design & UX · Testing

swiftui-preview

/swiftui-preview

Look at SwiftUI views as images with Prefire. Use after changing a SwiftUI view, to check its layout on iPhone or iPad, in dark mode or with large Dynamic Type, or when the user asks how a screen looks. Renders #Preview blocks to PNG through the prefire MCP server (list_previews, render_previews, build_board) or the `prefire render` CLI, without Xcode Previews.

Repository
prefire ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Look at SwiftUI views as images with Prefire. Use after changing a SwiftUI view, to check its layout on iPhone or iPad, in dark mode or with large Dynamic Type, or when the user asks how a screen looks. Renders #Preview blocks to PNG through the prefire MCP server (list_previews, render_previews, build_board) or the `prefire render` CLI, without Xcode Previews.

Original author description

Look at SwiftUI views as images with Prefire. Use after changing a SwiftUI view, to check its layout on iPhone or iPad, in dark mode or with large Dynamic Type, or when the user asks how a screen looks. Renders #Preview blocks to PNG through the prefire MCP server (list_previews, render_previews, build_board) or the `prefire render` CLI, without Xcode Previews.

How it works

  1. Loop
  2. Reading the result
  3. Setup, when the tools are missing or fail
Original SKILL.md headings · 50 lines, 376 words
SKILL.md preview
---
name: swiftui-preview
description: Look at SwiftUI views as images with Prefire. Use after changing a SwiftUI view, to check its layout on iPhone or iPad, in dark mode or with large Dynamic Type, or when the user asks how a screen looks. Renders #Preview blocks to PNG through the prefire MCP server (list_previews, render_previews, build_board) or the `prefire render` CLI, without Xcode Previews.
---

# Seeing SwiftUI with Prefire

Prefire builds the app and runs its generated snapshot tests in render mode, so every `#Preview`
comes back as a PNG of the current code. Use it to check your own UI changes instead of guessing.

## Loop

1. Call `list_previews` once to learn the preview names and where each is declared.
2. Change the view.
3. Call `render_previews` with only the previews you touched, for example
   `{"previews": ["Sign in"], "devices": ["iPhone 16 Pro"], "color_scheme": "dark"}`.
   A render builds the project, so it takes as long as a test run: ask for few previews.
4. Look at the images. Fix what is off and render again. Say what you checked.

Before calling a UI change done, render it at least once. For layout changes, also check a small
phone (`iPhone SE (3rd generation)`), an `iPad`, `dark`, and `accessibility3` Dynamic Type.

## Reading the result

- The first content block is JSON: each preview with `image` path, size, `device`, `source`
  (`file:line`), `userStory`, `state` and `error`. `notes` lists names that matched nothing and
  devices that were ignored.
- Images beyond `max_images` (default 6) are not attached; read them from their paths.
- `isError: true` with "no snapshot test ran in render mode" means the tests are not set up or
  were generated by an older Prefire: see Setup.
- "xcodebuild exited with 65" means the build or a test failed. Read `xcodebuild.log` in the
  output directory, fix the build, and render again. The last good render is kept.
- An unknown device gets a record with the error and the device names Prefire knows.

## Setup, when the tools are missing or fail

- Install the CLI: `brew install barredewe/prefire/prefire`.
- The project needs Prefire's snapshot tests: the `Prefire` package with `PrefireTestsPlugin` on a
  test target. See https://github.com/BarredEwe/Prefire#-quick-start.
- `.prefire.yml` in the project folder needs a `render_configuration`:

  ```yaml
  render_configuration:
    scheme: MyApp                      # scheme whose tests include the snapshot tests
    project: MyApp.xcodeproj           # or workspace: MyApp.xcworkspace
    destination: platform=iOS Simulator,name=iPhone 16   # platform=macOS for a Mac app
    test_target: MyAppSnapshotTests    # runs only the tests of the previews asked for
  ```

- Without the MCP server, the same works from a shell: `prefire render "Sign in" --device iPad`,
  `prefire render --list`, `prefire board`.

Full guide: https://github.com/BarredEwe/Prefire/blob/main/Documentation/AI.md

Versions

The database has no other skills named swiftui-preview.

Database snapshot: 13.11.2026 · package version 7b84d2f8b639 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100xcode-preview-capture
    Build and capture SwiftUI previews for visual analysis in Codex. Use when asked to preview a Swift file, capture simulator UI, or inspect visual output from SwiftUI views.
  • 100preview-data-generator
    Generate sample data and a multi-variant #Preview matrix for SwiftUI views — empty/loading/error/loaded states, light/dark, Dynamic Type, locales/RTL, and devices. Use when the user says "add previews", "sample data for previews", "preview my view in different states", "preview…
  • 95xcode-preview-capture
    Build and capture Xcode/SwiftUI previews for visual analysis. Use when you need to see rendered UI output, verify layouts, or inspect visual components.
  • 95preview-build
    Build and capture SwiftUI previews for visual analysis. Use when the user asks to preview a SwiftUI view, capture a simulator screenshot, or visually inspect iOS UI components. Supports Xcode projects, SPM packages, and standalone Swift files.
  • 91ios-design
    Apple Human Interface Guidelines for iPhone. Use when building, reviewing, or refactoring SwiftUI/UIKit interfaces for iOS. Triggers on tasks involving iPhone UI, iOS components, accessibility, Dynamic Type, Dark Mode, or HIG compliance.
  • 86ios-design-guidelines
    Apple Human Interface Guidelines for iPhone. Use when building, reviewing, or refactoring SwiftUI/UIKit interfaces for iOS. Triggers on tasks involving iPhone UI, iOS components, accessibility, Dynamic Type, Dark Mode, or HIG compliance.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.