Skip to content
Skills Library
Programming · Testing

xcode-preview-capture

/xcode-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.

Licence
MIT
Last repository change
06.07.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
0
Deprecation

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

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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.

Original author description

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.

How it works

  1. Prerequisites
  2. Primary Command
  3. Capture Current Simulator
  4. Workflow
  5. Troubleshooting
Original SKILL.md headings · 48 lines, 165 words
SKILL.md preview
---
name: xcode-preview-capture
description: 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.
---

# Xcode Preview Capture (Codex)

Use this skill to build SwiftUI previews and inspect screenshots.

## Prerequisites

- Xcode + iOS Simulator installed
- Swift toolchain (preview-tool auto-builds on first run)
- `PREVIEW_BUILD_PATH` set to this repository root
  - Example: `export PREVIEW_BUILD_PATH=/absolute/path/to/XcodePreviews`

## Primary Command

Use the unified entry point first:

```bash
"${PREVIEW_BUILD_PATH}"/scripts/preview \
  "<path-to-file.swift>" \
  --output /tmp/preview.png
```

The script auto-detects:
- Xcode project with `#Preview` -> dynamic target injection
- Swift Package -> SPM preview workflow
- Standalone Swift file -> minimal host build

## Capture Current Simulator

```bash
"${PREVIEW_BUILD_PATH}"/scripts/preview \
  --capture \
  --output /tmp/preview.png
```

## Workflow

1. Run `scripts/preview` with the requested file or `--capture`.
2. Confirm the output path exists.
3. Open `/tmp/preview*.png` and analyze the rendered UI.
4. Report structure, styling, and visible issues (alignment, clipping, contrast, etc.).

## Troubleshooting

- No simulator booted: run `sim-manager.sh boot "iPhone 17 Pro"`.
- Build failure: surface the error and suggest targeted fixes.
- Wrong project detected: pass `--project` or `--workspace` explicitly.

Versions

RepositoryScoreLicence
This page · iron-ham/xcodepreviews100MIT
JordanCoin/ios-skills-collection95MIT

Database snapshot: 13.11.2026 · package version 67d66eb63fd8 (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

  • 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.
  • 100local-ios-simulator-browser-a2eb8e2c
    Mirror an iOS Simulator into the Codex in-app browser and render SwiftUI previews from importable Swift packages in that simulator with hot reload. Use when a user wants to watch or interact with an iOS app in the browser, see a SwiftUI preview outside Xcode Canvas, iterate live…
  • 100swiftui-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…
  • 100macos-apps
    Build professional native macOS apps in Swift with SwiftUI and AppKit. Full lifecycle - build, debug, test, optimize, ship. CLI-only, no Xcode. Use when asked to: create macOS apps, build Swift apps, develop SwiftUI interfaces, fix macOS app issues, add macOS app features, or…
  • 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…
  • 100xcode
    Expert Xcode assistance covering Swift/SwiftUI development, iOS/macOS simulators, Xcode Cloud CI/CD, Instruments profiling, and Swift Package Manager (SPM). Use when configuring Xcode projects, debugging iOS apps with LLDB, profiling with Instruments, or managing Apple Developer signing.

Feedback and reports

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