Agent skill · Testing & QA

snapshot-test-setup

Set up SwiftUI visual regression testing with swift-snapshot-testing. Generates snapshot test boilerplate and CI configuration. Use for UI regression prevention.

rshankrasgithub.com/rshankrasGitHub ↗
claude-codecan modify filesMIT
Install
npx skills add rshankras/claude-code-apple-skills --skill snapshot-test-setup --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Allowed tools: ReadWriteEditGlobGrepBashAskUserQuestion
Path: skills/testing/snapshot-test-setup/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 589
Language: Swift

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Snapshot Test Setup Generate SwiftUI snapshot/visual regression tests using Point-Free's swift-snapshot-testing library. Catches unintended UI changes by comparing rendered views against reference images. ## When This Skill Activates Use this skill when the user: - Wants "snapshot tests" or "visual regression tests" - Says "I want to catch UI regressions" - Asks about "screenshot testing" or "preview testing" - Wants to verify SwiftUI views don't change unexpectedly - Mentions "swift-snapshot-testing" or "Point-Free" ## Why Snapshot Tests ``` Without snapshots: With snapshots: Change a modifier Change a modifier → Looks fine locally → Snapshot test fails → Push to main → Shows exact visual diff → User reports UI bug → Fix before merging → Embarrassing → Confidence in UI changes ``` ## Pre-Setup Checks ### 1. Project Context ``` Glob: **/Package.swift or **/*.xcodeproj Grep: "swift-snapshot-testing" (already added?) Grep: "SnapshotTesting" in test files ``` ### 2. Configuration Questions Ask via AskUserQuestion: 1. **Package manager?** - Swift Package Manager - CocoaPods - Tuist 2. **Platform?** - iOS - macOS - Both 3. **What to test?** - Specific views (user provides names) - All

What's inside
Steps it walks through
  1. When This Skill Activates
  2. Why Snapshot Tests
  3. Pre-Setup Checks
  4. 1. Project Context
  5. 2. Configuration Questions
  6. Setup Process
  7. Step 1: Add Dependency
  8. Step 2: Create Snapshot Test Base
  9. Step 3: Generate Snapshot Tests
  10. Step 4: Recording Reference Images
  11. Step 5: Re-record When Intentional Changes
  12. Gate Wiring (the deterministic UI gate)
  13. What to Snapshot
  14. High Value (Always Snapshot)
Commands it runs
Record all snapshots (first run)
xcodebuild test -scheme YourApp \
ci_scripts/ci_post_xcodebuild.sh
if [ "$CI_XCODEBUILD_ACTION" = "test" ]; then
if [ -d "$CI_DERIVED_DATA_PATH" ]; then
find "$CI_DERIVED_DATA_PATH" -name "Failures" -type d \
fi
More from claude-code-apple-skills
All skills →
About this skill
What does the snapshot-test-setup skill do?

Set up SwiftUI visual regression testing with swift-snapshot-testing. Generates snapshot test boilerplate and CI configuration. Use for UI regression prevention.

How do I install it?

Run `npx skills add rshankras/claude-code-apple-skills --skill snapshot-test-setup --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going