Swift CLI Preview Tool
Replaces the Ruby-based preview infrastructure with a native Swift CLI (preview-tool), removing the xcodeproj gem dependency entirely.
What's New
preview-toolSwift CLI — Pre-compiled binary handles Xcode project injection, SPM package previews, and declaration-level dependency resolution, all in a single processpreview-spmsubcommand — Creates temporary Xcode projects with local SPM package dependencies for previewing SwiftUI views in SPM packages- Auto-rebuild — The
scripts/previewentry point automatically rebuildspreview-toolwhen source files change (no manual build step needed) - Declaration-level dependency resolver — Resolves only the declarations needed for a preview, not entire files, for faster builds
- 156 unit tests + 56 e2e integration tests
Breaking Changes
- Ruby
xcodeprojgem is no longer required. The only prerequisites are Xcode, iOS Simulator, and the Swift toolchain. scripts/preview-spm.shremoved (replaced bypreview-tool preview-spm)scripts/preview-dynamic.shremoved (replaced bypreview-tool preview)scripts/inject-preview-target.rbremoved (dead code)
Performance
The Swift CLI eliminates ~1.5–2.5 seconds of Ruby/subprocess overhead per preview capture. Actual xcodebuild time is unchanged.
Updated Docs
All instruction files updated and synced: CLAUDE.md, README.md, .claude/commands/preview.md, .cursor/rules/preview.mdc, .cursor/skills/preview/SKILL.md, skills/preview/SKILL.md, .codex/skills/xcode-preview-capture/SKILL.md.