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.
npx agentmods add skills/rshankras/claude-code-apple-skills/persistence-setupnpx skills add rshankras/claude-code-apple-skills --skill persistence-setupgit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote 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.
[](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/persistence-setup)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/persistence-setup"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/persistence-setup.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.01841 |
| Opus 5 | $0.00018 | $0.00920 |
| Sonnet 5 | $0.00007 | $0.00368 |
| Haiku 4.5 | $0.00004 | $0.00184 |
Grade A, and why
persistence-setup 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 2d 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.
func fetch(predicate: Predicate<T>?, sortBy: [SortDescriptor<T>]) async throws -> [T] How it starts
The opening of the file, as written. The whole thing — 305 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Persistence Setup Generator
Generates a production-ready persistence layer using SwiftData (iOS 17+) or CoreData with optional iCloud (CloudKit) sync.
When This Skill Activates
- User asks to "add persistence" or "set up data storage"
- User mentions "SwiftData", "CoreData", or "local storage"
- User wants to "sync data to iCloud" or "enable cloud sync"
- User asks about "offline storage" or "data models"
Pre-Generation Checks (CRITICAL)
1. Project Context Detection
Before generating, ALWAYS check:
# Check deployment target
cat Package.swift | grep -i "platform"
# Or check project.pbxproj
# Find existing persistence implementations
rg -l "ModelContainer|NSPersistentContainer|@Model|@Entity" --type swift
# Check for existing SwiftData models
rg "@Model" --type swift | head -5
# Check for CoreData stack
rg "NSManagedObjectContext|NSPersistentStore" --type swift | head -5
# Check existing entitlements for iCloud
cat *.entitlements 2>/dev/null | grep -i "icloud"
2. Framework Selection
Use SwiftData if:
- Deployment target is iOS 17+ / macOS 14+
- User explicitly requests SwiftData
- No existing CoreData implementation
Use CoreData if:
- Deployment target < iOS 17
- Existing CoreData stack present
- User explicitly requests CoreData
3. Conflict Detection
If existing persistence found:
- Ask: Extend existing, migrate to SwiftData, or create separate?
Configuration Questions
Ask user via AskUserQuestion:
-
Framework choice?
- SwiftData (iOS 17+, recommended)
- CoreData (older targets)
-
Enable iCloud sync?
- Yes (requires CloudKit entitlement)
- No (local only)
-
Generate example model?
- Yes (with sample Item model)
- No (just infrastructure)
Generation Process
Step 1: Create Core Files
Always generate:
Sources/Persistence/
├── PersistenceController.swift # Container setup
├── Repository.swift # Repository protocol
└── SwiftDataRepository.swift # Concrete implementation
What ships with it
7 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.
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.
- 2d ago First seen · 305 lines · 36 tokens per session scan A 071b9656c622
persistence-setup is a skill published in the GitHub repository rshankras/claude-code-apple-skills (700 stars, last pushed 1mo ago), licensed MIT. It adds 36 tokens to every session and 1,841 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
swiftdata-pro
Use when modeling data with SwiftData (@Model), writing @Query, configuring ModelContainer, performing migrations, or enabling CloudKit sync on iOS 17+.
core-data-pro
Use when working with Core Data — modeling entities, NSPersistentContainer setup, background contexts, fetch requests, batch operations, and migrations.
cloudkit
Implement, review, or improve CloudKit and iCloud sync in iOS/macOS apps. Use when working with CKContainer, CKRecord, CKQuery, CKSubscription, CKSyncEngine, CKShare, NSUbiquitousKeyValueStore, or iCloud Drive file coordination; when syncing SwiftData models via ModelConfiguration with cloudKitDatabase; when handling…
swiftdata
Implement, review, or improve data persistence using SwiftData. Use when defining @Model classes with @Attribute, @Relationship, @Transient, @Unique, or @Index; when querying with @Query, #Predicate, FetchDescriptor, or SortDescriptor; when configuring ModelContainer and ModelContext for SwiftUI or background work…
core-data-expert
Expert Core Data guidance (iOS/macOS): stack setup, fetch requests & NSFetchedResultsController, saving/merge conflicts, threading & Swift Concurrency, batch operations & persistent history, migrations, performance, and NSPersistentCloudKitContainer/CloudKit sync.
gingiris-aso-growth
🇺🇸 ASO & Mobile App Growth Playbook 2026 — Complete App Store Optimization guide. ASO keyword ranking, App Store & Google Play listing optimization, app cold start, UGC creator operations, TikTok/Instagram/YouTube Shorts marketing, AI-matrix content scaling, mobile user acquisition. 🇨🇳 ASO 增长与 App 冷启动权威指南 …