Agent skill · Data & Analytics

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.

rshankrasgithub.com/rshankrasGitHub ↗
claude-codecan modify filesMIT
Install
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.

Facts
Files in the skill folder: 8
SKILL.md size: 7 KB
Bundled scripts: none
Allowed tools: ReadWriteEditGlobGrepBashAskUserQuestion
Path: skills/generators/persistence-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

# 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

What's inside
Steps it walks through
  1. When This Skill Activates
  2. Pre-Generation Checks (CRITICAL)
  3. 1. Project Context Detection
  4. 2. Framework Selection
  5. 3. Conflict Detection
  6. Configuration Questions
  7. Generation Process
  8. Step 1: Create Core Files
  9. Step 2: Read Templates
  10. Step 3: Customize for Project
  11. Step 4: Integration
  12. iCloud Sync Setup
  13. Required Capabilities (Xcode)
  14. Required Entitlements
Ships with 7 files
  • persistence-patterns.md
  • templates/CloudKitConfiguration.swift
  • templates/ExampleModel.swift
  • templates/PersistenceController.swift
  • templates/Repository.swift
  • templates/SwiftDataRepository.swift
  • templates/SyncStatus.swift
Commands it runs
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
More from claude-code-apple-skills
All skills →
About this skill
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.

Keep going