persistence-setup
Generates SwiftData or CoreData persistence layer with optional iCloud sync. Use when user wants to add local storage, data persistence, or cloud sync.
npx skills add rshankras/claude-code-apple-skills --skill persistence-setup --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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: ```bash # 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 ta
- When This Skill Activates
- Pre-Generation Checks (CRITICAL)
- 1. Project Context Detection
- 2. Framework Selection
- 3. Conflict Detection
- Configuration Questions
- Generation Process
- Step 1: Create Core Files
- Step 2: Read Templates
- Step 3: Customize for Project
- Step 4: Integration
- iCloud Sync Setup
- Required Capabilities (Xcode)
- Required Entitlements
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
What does the persistence-setup skill do?
Generates SwiftData or CoreData persistence layer with optional iCloud sync. Use when user wants to add local storage, data persistence, or cloud sync.
How do I install it?
Run `npx skills add rshankras/claude-code-apple-skills --skill persistence-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.
