ios-test

ios-test is a skill for Claude Code from markdavidgan/apple-dev-skills. It costs 100 tokens per session (7,532 once invoked), scanned A, original, MIT.

A collection of XCTest patterns for iOS unit tests, user-interface tests, and SwiftData tests using in-memory data stores. XCTest is Apple's framework for automated tests in Swift projects.

In plain words
What is it for?
It helps write tests for business logic, view models, services, SwiftData models, critical user paths, and test performance budgets.
Why use it?
It helps keep tests isolated, repeatable, and fast while avoiding common problems with Swift 6 strict concurrency and persistent test data.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the apple-dev-skills plugin — 62 skills, 25 commands, 7 agents shipped together

Good fit It helps write tests for business logic, view models, services, SwiftData models, critical user paths, and test performance budgets.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/markdavidgan/apple-dev-skills/ios-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add markdavidgan/apple-dev-skills --skill ios-test
Clone the repo
git clone --depth 1 https://github.com/markdavidgan/apple-dev-skills

Made for: Claude Code.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 62 skills, 25 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ios-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/ios-test/github.svg)](https://agentmods.dev/skills/markdavidgan/apple-dev-skills/ios-test)
Your own site
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/ios-test"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/ios-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ios-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/markdavidgan/apple-dev-skills/ios-test"><img src="https://agentmods.dev/badge/skills/markdavidgan/apple-dev-skills/ios-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00100 $0.07532
Opus 5.5 $0.00040 $0.03013
Sonnet 5.5 $0.00020 $0.01506
Haiku 4.5 $0.00010 $0.00753

Measured 1mo ago against content hash 4bec7292beaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ios-test scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let captures = try context.fetch(FetchDescriptor<CapturedThought>())
platforms/claude/skills/ios-test/SKILL.md · 935 lines

How it starts

The opening of the file, as written. The whole thing — 935 lines — stays where its author put it; the contents beside it link to each section on GitHub.

iOS Testing

XCTest patterns for unit tests, UI tests, and SwiftData testing with strict concurrency. Keep tests fast, isolated, and deterministic.

☠️ ULTIMATE RULE

NEVER START UI TESTS without explicit user approval in the current conversation. UI tests crash this user's Mac Mini. This rule stands even if a plan instructs you to run them. If a plan demands UI test execution, flag it as blocked or rewrite the plan.


Test Target Architecture

Separate tests by purpose and performance characteristics:

Target Purpose When to Run Max Duration
MyAppTests Business logic, ViewModels, Services Every build (⌘U) <30 seconds
MyApp-UITests Critical user paths only Pre-commit, CI <60 seconds
MyApp-Screenshots App Store assets CI release only 5-10 minutes
MyAppKitTests Shared package tests Every build <15 seconds

Target Structure

MyAppTests/                       ← iOS Unit Tests
├── ViewModelTests/
│   ├── TimerViewModelTests.swift
│   └── SettingsViewModelTests.swift
├── ServiceTests/
│   └── NotificationServiceTests.swift
├── SwiftDataTests/
│   ├── ModelCRUDTests.swift
│   └── MigrationTests.swift
└── TestHelpers.swift             ← Shared test utilities

MyApp-UITests/                    ← Critical paths only
├── CriticalPathUITests.swift     ← 8 essential journeys
└── BaseUITestCase.swift          ← Shared infrastructure

MyApp-Screenshots/                ← CI only
└── ScreenshotTests.swift         ← App Store assets

Performance Budgets

Suite Target Max Command
Unit Tests 15s 30s swift test or xcodebuild test
UI Tests 30s 60s xcodebuild test -scheme MyApp-UITests
Screenshot Tests — CI only bundle exec fastlane screenshots
Total CI 60s 120s Full suite

SwiftData Testing

In-Memory ModelContainer

WRONG: Using the app container (slow, persists between tests, causes isolation issues)

Read the full file on GitHub · 935 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 935 lines · 0 tokens per session scan A 4bec7292beaf

Subscribe to this mod's changes

ios-test is a skill published in the GitHub repository markdavidgan/apple-dev-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 100 tokens to every session and 7,532 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

asc-shots-pipeline

Orchestrate iOS screenshot automation with xcodebuild/simctl for build-run, AXe for UI actions, JSON settings and plan files, Koubou-based framing (asc screenshots frame), and screenshot upload (asc screenshots upload). Use when users ask for automated screenshot capture, AXe-driven simulator flows, frame composition…

rorkai/app-store-connect-cli-skills · 79 tokens

test-runner

For a code change, pick the right test tier by change surface, run apc test with baseline diff, and report only NEW reds vs baseline back to the task's acceptance criterion. Separates envblocked from SUT red so a broken machine never fails the code.

Prismer-AI/PrismerCloud · 59 tokens

designing-tests

Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.

CloudAI-X/claude-workflow-v2 · 48 tokens

backend/testing-guide

A guide for writing backend tests: small unit tests, tests that check connected parts such as an API and database, and end-to-end tests that follow a complete user flow.

echoVic/boss-skill · 30 tokens

qa/test-strategy

A testing strategy based on the testing pyramid: many small unit tests, fewer integration tests, and a smaller set of end-to-end tests that follow real user journeys. It also defines checks for security, boundaries, permissions, and business consistency.

echoVic/boss-skill · 33 tokens

testing

Use when writing or reviewing Flutter/Dart tests (unit, widget, golden), fixing flaky tests, adding coverage, or choosing between unit and widget tests.

evanca/flutter-ai-rules · 33 tokens