cloudkit — Claude Code skill: what it does, how to install
Guides CloudKit and iCloud sync setup in iOS and macOS apps, covering SwiftData, CKSyncEngine, and conflict resolution.
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a claude-codeWhat cloudkit does
This skill supplies patterns for integrating Apple cloud sync in Swift projects. It details container setup across public, private, and shared databases, as well as record operations with CKRecord. You also get workflows for custom record zones, which track changes atomically in private storage.
Querying relies on NSPredicate, with reminders about field encryption limits: encrypted values cannot be filtered or sorted in CKQuery. For modern apps, it covers CKSyncEngine on iOS 17+ alongside background change notifications via CKSubscription.
Each CKRecord caps out at 1 MB excluding CKAsset files. When sync operations fail, the skill explicitly warns against restarting full sync runs, guiding you to inspect the specific CKError instead.
What it helps with
- sync SwiftData models to CloudKit databases
- handle CKError codes and merge conflicting records
- build NSPredicate filters for CKQuery searches
- configure CKSubscription push notifications for silent sync
- implement CKSyncEngine for iOS 17+ state tracking
Example prompts for the agent
- Show how to create and save records in a custom CKRecordZone
- Help me resolve CKError conflict errors during batch sync
- Configure CKSyncEngine to handle remote changes in iOS 17
How to install cloudkit
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a claude-code2Manually: put the files in place
~/.claude/skills/cloudkit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cloudkit/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a codex2Manually: put the files in place
.agents/skills/cloudkit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a cursor2Manually: put the files in place
.cursor/skills/cloudkit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills cloudkit2Manually: put the files in place
.github/skills/cloudkit/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/cloudkitManually: put the files in place
.devin/skills/cloudkit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about cloudkit
How to install cloudkit in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill cloudkit -a claude-code in your terminal.
What does the cloudkit skill do?
It guides developers through implementing CloudKit and iCloud storage across iOS and macOS apps. It provides best practices for record operations, SwiftData sync, and error handling.
What are the limits on encrypted fields in CKQuery?
CloudKit does not allow sorting or querying against encrypted fields. In addition, CKRecord.Reference cannot be encrypted because the server requires plaintext references for graph operations.