iron-ham/xcodepreviews/preview
Claude Code and agent skill by iron-ham/xcodepreviews
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install iron-ham/xcodepreviews/previewSKILL.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 screen
- Analyzing the captured screenshots
Installation Path
Scripts are located at ${CLAUDE_PLUGIN_ROOT}/scripts/
Available Commands
Unified Preview (Recommended)
Auto-detects project type and uses the best approach:
Quick Capture (Current Simulator)
Capture a screenshot of whatever is currently displayed on the booted simulator.
Xcode Project with #Preview
Fast builds by injecting a minimal PreviewHost target (handled automatically by the unified script):
SPM Package Preview
Auto-detected from Package.swift in parent directories:
Standalone Swift File
Build a standalone Swift file with system frameworks only:
Workflow
When the user invokes /preview, follow this workflow:
- Identify the target: Determine what needs to be previewed:
- A specific Swift file
- An Xcode project/workspace with a scheme
- The current simulator state
- 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:
- Layout and structure
- Colors and styling
- Any potential issues (alignment, overflow, etc.)
- Suggestions for improvement
Parameters
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)
Example Usage
Error Handling
If the build fails:
- Show the build error output
- Suggest fixes based on the error messages
- Offer to try again after fixes are applied
If no simulator is booted:
- List available simulators
- Offer to boot one
Output
After capturing, always:
- Confirm the screenshot was saved
- Read the image using the Read tool
- Provide analysis of what's visible
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/preview/SKILL.md
Popularity
- Repository stars
- 146
- Repository forks
- 7
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/iron-ham/xcodepreviews/preview)