skills/preview/SKILL.md
# Xcode Preview Capture Skill <skill-definition> name: preview description: Build and capture Xcode/SwiftUI previews for visual analysis invocation: /preview </skill-definition> ## Overview This skill allows you to build SwiftUI views and capture screenshots of their rendered output for visual analysis. It supports: - Building standalone Swift files containing SwiftUI views - Building views from existing Xcode projects - Building views from SPM packages - Capturing the current simulator scre
npx skillsauth add iron-ham/xcodepreviews skills/previewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows you to build SwiftUI views and capture screenshots of their rendered output for visual analysis. It supports:
Scripts are located at ${CLAUDE_PLUGIN_ROOT}/scripts/
Auto-detects project type and uses the best approach:
"${CLAUDE_PLUGIN_ROOT}"/scripts/preview \
<path-to-file.swift> \
--output /tmp/preview.png
Capture a screenshot of whatever is currently displayed on the booted simulator.
"${CLAUDE_PLUGIN_ROOT}"/scripts/capture-simulator.sh \
--output /tmp/preview-capture.png
Fast builds by injecting a minimal PreviewHost target (handled automatically by the unified script):
"${CLAUDE_PLUGIN_ROOT}"/scripts/preview \
<path-to-file.swift> \
--project <path.xcodeproj> \
--output /tmp/preview.png
Auto-detected from Package.swift in parent directories:
"${CLAUDE_PLUGIN_ROOT}"/scripts/preview \
<path-to-file.swift> \
--output /tmp/preview.png
Build a standalone Swift file with system frameworks only:
"${CLAUDE_PLUGIN_ROOT}"/scripts/preview \
<path-to-file.swift> \
--output /tmp/preview.png
When the user invokes /preview, follow this workflow:
Identify the target: Determine what needs to be previewed:
Build and capture: Use the appropriate script based on the target
Read and analyze: Use the Read tool to view the captured PNG image
Report findings: Describe what you see in the preview, including:
The user can specify:
file: Path to a Swift file to previewproject: Path to an Xcode projectworkspace: Path to an Xcode workspacescheme: Build scheme namesimulator: Simulator to use (default: "iPhone 17 Pro")wait: Seconds to wait before capture (default: 3)User: /preview ContentView.swift
User: /preview --project MyApp.xcodeproj --scheme MyApp
User: /preview --capture-only
If the build fails:
If no simulator is booted:
After capturing, always:
development
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.
development
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.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.