Agent skill

Xcode Preview Capture

by Iron-Ham in Iron-Ham/XcodePreviews

Build and capture SwiftUI previews for visual analysis in Codex.

MITAuto-check passedMobile

Install Xcode Preview Capture

skills CLI
$ npx skills add Iron-Ham/XcodePreviews --skill xcode-preview-capture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Iron-Ham/XcodePreviews xcode-preview-capture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Iron-Ham/XcodePreviews.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/xcode-preview-capture .claude/skills/xcode-preview-capture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
xcode-preview-capture
GitHub stars
152
Token cost
~376 tokens
SKILL.md length
129 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Build and capture SwiftUI previews for visual analysis in Codex.

  • Works in 4 steps: Run scripts/preview with the requested… → Confirm the output path exists. → Open /tmp/preview*.png and analyze the… → …
  • Asked to preview a Swift file
  • SKILL.md covers Prerequisites, Primary Command, Capture Current Simulator and Workflow, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Xcode Preview Capture is an agent skill from Iron-Ham/XcodePreviews. 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.

Its SKILL.md is about 380 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile, covering iOS development. It works with Xcode and SwiftUI. The licence is MIT.

When your agent uses it

  • Asked to preview a Swift file
  • Capture simulator UI
  • Inspect visual output from SwiftUI views

Example prompts

  • “/xcode-preview-capture”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  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.).

What it can do on your machine

Read from SKILL.md and the folder at commit a44a29c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Xcode Preview Capture loads about 376 tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 129 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~376

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Iron-Ham/XcodePreviews at commit a44a29c, republished under its MIT licence (© Iron-Ham). 129 words, ~376 tokens.

Download SKILL.mdSave it as .claude/skills/xcode-preview-capture/SKILL.md (or your agent's skills folder).
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.

© Iron-Ham, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/xcode-preview-capture of Iron-Ham/XcodePreviews.

Open the folder on GitHubat commit a44a29c

Compare with similar skills

Xcode Preview Capture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Xcode Preview Capture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xcode Preview Capture this skillIron-Ham/XcodePreviews152—~376Automated safety check: PassMIT
Update Swiftui APIsAvdLee/SwiftUI-Agent-Skill3.7k—~1.2kAutomated safety check: PassMIT
SetupShpigford/chops1.9k—~980Automated safety check: PassCustom licence
SwiftUI Design SkillWholiver/swiftui-design-skill210—~2.8kAutomated safety check: PassMIT
Audit Xcode Security Settingssuperagents-lab/xcode27-skills338—~4.6kAutomated safety check: PassNone
iOS Marketing CaptureParthJadhav/ios-marketing-capture262—~6.1kAutomated safety check: PassMIT

Similar skills

  • Update Swiftui APIs

    AvdLee/SwiftUI-Agent-Skill

    Scan Apple's SwiftUI documentation for deprecated APIs and update the SwiftUI Expert Skill with modern replacements.

    3.7k GitHub stars~1.2k tokensUpdated yesterday
    MobileAuto-check passed
  • Setup

    Shpigford/chops

    Get a new developer up and running with the Chops codebase — prerequisites, build, architecture, and common tasks.

    1.9k GitHub stars~980 tokensUpdated 1 mo ago
    MobileAuto-check passed
  • SwiftUI Design Skill

    Wholiver/swiftui-design-skill

    Guides the agent to design distinctive SwiftUI interfaces for iOS and macOS, with six anti-generic rules, a design direction workflow and a five-dimension review.

    210 GitHub stars~2.8k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Audit Xcode Security Settings

    superagents-lab/xcode27-skills

    Audit and enable security-oriented Xcode build settings. An agent skill from superagents-lab/xcode27-skills.

    338 GitHub stars~4.6k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • iOS Marketing Capture

    ParthJadhav/ios-marketing-capture

    A skill your agent uses when the user wants to automate capture of marketing screenshots for a SwiftUI iOS app across multiple locales, devices, or appearances.

    262 GitHub stars~6.1k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Write AI Doc

    samuelhe52/AniShelf

    Create and maintain curated AniShelf docs-ai/ records for substantial features and non-trivial, decision-shaping fixes (numbered entries with 000-plan.md before implementation and 001-action.md…

    140 GitHub stars~1.8k tokensUpdated today
    MobileAuto-check passed

More from Iron-Ham/XcodePreviews

  • Preview Build

    Iron-Ham/XcodePreviews

    Build and capture SwiftUI previews for visual analysis. An agent skill from Iron-Ham/XcodePreviews.

    152 GitHub stars~782 tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Xcode Preview Capture

What does Xcode Preview Capture do?

Build and capture SwiftUI previews for visual analysis in Codex. Xcode Preview Capture is an agent skill from Iron-Ham/XcodePreviews. Build and capture SwiftUI previews for visual analysis in Codex.

When should I use Xcode Preview Capture?

Xcode Preview Capture fits situations like: asked to preview a Swift file; capture simulator UI; inspect visual output from SwiftUI views.

How do I install Xcode Preview Capture in Claude Code?

Run `npx skills add Iron-Ham/XcodePreviews --skill xcode-preview-capture -a claude-code`. Or copy the skill folder (.codex/skills/xcode-preview-capture in Iron-Ham/XcodePreviews) into .claude/skills/xcode-preview-capture in your project. Claude Code loads it when a task matches its description.

How do I install Xcode Preview Capture in Codex?

Run `npx skills add Iron-Ham/XcodePreviews --skill xcode-preview-capture -a codex`. Or copy the skill folder (.codex/skills/xcode-preview-capture in Iron-Ham/XcodePreviews) into .agents/skills/xcode-preview-capture in your project. Codex loads it when a task matches its description.

Can I use Xcode Preview Capture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Iron-Ham/XcodePreviews --skill xcode-preview-capture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xcode-preview-capture, .gemini/skills/xcode-preview-capture, .github/skills/xcode-preview-capture and .opencode/skills/xcode-preview-capture in your project.

What does Xcode Preview Capture need to run?

SKILL.md names no scripts, command-line tools or credentials: Xcode Preview Capture is instructions for the agent only.

Does Xcode Preview Capture access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Xcode Preview Capture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Xcode Preview Capture use?

Xcode Preview Capture is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Xcode Preview Capture use?

About 376 tokens (SKILL.md is roughly 1.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Xcode Preview Capture?

Skills that share tags, products or a category with Xcode Preview Capture: Update Swiftui APIs (AvdLee/SwiftUI-Agent-Skill, 3.7k stars), Setup (Shpigford/chops, 1.9k stars), SwiftUI Design Skill (Wholiver/swiftui-design-skill, 210 stars) and Audit Xcode Security Settings (superagents-lab/xcode27-skills, 338 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Xcode Preview Capture?

Iron-Ham (a GitHub user) maintains it in Iron-Ham/XcodePreviews, which has 152 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on July 6, 2026.

Source: Iron-Ham/XcodePreviews on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.