ios-data

ios-data is a skill for Claude Code, Codex from koshkinvv/ios-agent-skills. It costs 195 tokens per session (2,707 once invoked), scanned A, original, MIT.

A set of rules for choosing where an iOS app should store different kinds of data, such as preferences, passwords, structured records, and large files.

In plain words
What is it for?
It helps choose between Keychain, UserDefaults, iCloud key-value storage, SwiftData, Core Data, SQLite, FileManager, and CloudKit for specific data needs.
Why use it?
It prevents sensitive information from being stored insecurely and avoids using a database or file system when a simpler option fits better.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit It helps choose between Keychain, UserDefaults, iCloud key-value storage, SwiftData, Core Data, SQLite, FileManager, and CloudKit for specific data needs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/koshkinvv/ios-agent-skills/ios-data
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 koshkinvv/ios-agent-skills --skill ios-data
Clone the repo
git clone --depth 1 https://github.com/koshkinvv/ios-agent-skills

Made for: Claude Code, Codex.

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-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-data/github.svg)](https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-data)
Your own site
<a href="https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-data"><img src="https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-data/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-data

Your own site · 80×15
<a href="https://agentmods.dev/skills/koshkinvv/ios-agent-skills/ios-data"><img src="https://agentmods.dev/badge/skills/koshkinvv/ios-agent-skills/ios-data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 195 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,707 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.00195 $0.02707
Opus 5 $0.00097 $0.01354
Sonnet 5 $0.00039 $0.00541
Haiku 4.5 $0.00019 $0.00271

Measured 9d ago against content hash 2f9aa375ad1e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

ios-data 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 9d 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 tasks = try context.fetch(request)
skills/ios-data/SKILL.md · 325 lines

How it starts

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

iOS Data Persistence Skill

Storage Selection Guide

Data Type Storage Why
User preferences UserDefaults / @AppStorage Simple, auto-loaded at launch
Preferences synced across devices NSUbiquitousKeyValueStore Simple iCloud sync, <1MB
Passwords, tokens, API keys Keychain Encrypted, survives reinstall
Structured app data (iOS 17+) SwiftData Modern, declarative, queryable
Structured app data (iOS 16-) Core Data Mature, proven, stable
Large files (images, video, PDFs) FileManager Direct file I/O, no DB overhead
Complex queries, cross-platform SQLite (GRDB) Full SQL control, lightweight
Public/shared CloudKit data Core Data + NSPersistentCloudKitContainer SwiftData only supports private DB

Decision Flowchart

Is the data sensitive (tokens, passwords, keys)?
  YES → Keychain (NEVER UserDefaults)
  NO ↓

Is it a simple user preference (theme, flag, small string)?
  YES → Need sync across devices?
    YES → NSUbiquitousKeyValueStore
    NO  → @AppStorage / UserDefaults
  NO ↓

Is it a large binary file (image, video, PDF)?
  YES → FileManager (store path/URL reference in DB if needed)
  NO ↓

Is it structured/relational data?
  YES → iOS 17+ minimum?
    YES → SwiftData
    NO  → Core Data
  NO ↓

Need full SQL control or cross-platform DB?
  YES → SQLite via GRDB.swift
  NO  → Codable + FileManager (JSON/plist file)

Core Rules

General

  • Use SwiftData for new iOS 17+ projects -- simpler API than Core Data
  • Use Keychain for ALL sensitive data (tokens, passwords, API keys) -- NEVER UserDefaults
  • Use @AppStorage only for simple preferences -- not large data or collections
  • Store large blobs (images, video) on disk via FileManager, keep only the path/URL in DB
  • Always handle persistence errors -- do not force-try in production

SwiftData Rules

  • Always use isStoredInMemoryOnly: true for test ModelContainers
  • Use @ModelActor for background SwiftData operations -- Model objects are NOT Sendable
  • Pass PersistentIdentifier (Sendable) between actors, not model objects
  • Use FetchDescriptor.fetchLimit for pagination -- never fetch all records unbounded
  • CloudKit models: all properties must have defaults or be optional, no .unique
  • Add #Index (iOS 18+) on frequently queried properties for performance
  • Prefer @Transient for computed/cached properties that should not be persisted

Read the full file on GitHub · 325 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 325 lines · 195 tokens per session scan A 2f9aa375ad1e

Subscribe to this mod's changes

ios-data is a skill published in the GitHub repository koshkinvv/ios-agent-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 195 tokens to every session and 2,707 once invoked, about $0.0010 per session on Opus 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-08-31.

Related

Other skills, from other repositories

flutter

Use when building, structuring, testing or optimizing a Flutter app — feature-first layering, Riverpod 3 or Bloc, typed gorouter, freezed models, a dio data layer, Material 3, jank hunting, widget/golden tests. Targets Flutter 3.44 / Dart 3.12. NOT React Native (that is react-native), NOT Compose Multiplatform (that…

ericrisco/rsc-harness · 91 tokens

compose-multiplatform

Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…

ericrisco/rsc-harness · 80 tokens

react-native

Use when writing the JS/TS inside a React Native or Expo app — screens, Expo Router navigation, lists, Reanimated gestures, platform forks, offline state, native modules — or killing jank and render storms. NOT eas build/submit/OTA/config-plugin (that is expo), NOT a Dart app (that is flutter), NOT web React/DOM (that…

ericrisco/rsc-harness · 90 tokens

ios-accessibility

Production-grade iOS accessibility skill covering VoiceOver, Dynamic Type, color contrast, motion, Switch Control, Voice Control, and WCAG 2.2 compliance for both SwiftUI and UIKit. This skill should be used when creating new iOS screens or views, reviewing existing iOS code for accessibility, adding VoiceOver…

rusel95/ios-agent-skills · 253 tokens

ios-localization

Production-grade iOS localization skill covering String Catalogs (.xcstrings), CLDR pluralization, SwiftUI/UIKit localization APIs, RTL layout, date/number/currency formatting, and enterprise patterns (modular apps, white-label, accessibility localization). This skill should be used when creating or editing localized…

rusel95/ios-agent-skills · 265 tokens

ios-logging

Enterprise skill for iOS production error observability and logging (iOS 15+, Swift 5.5+). The trigger is OBSERVABILITY intent — the user wants errors captured and visible in production, not just handled. Use when: adding os.Logger or replacing print() with structured logging; setting up or integrating a crash SDK…

rusel95/ios-agent-skills · 183 tokens