Builds or reviews CloudKit and iCloud synchronization with records, queries, subscriptions, CKSyncEngine, shares, SwiftData CloudKit configuration, key-value storage, or iCloud Drive. Use for sync architecture, conflicts, account state, retries, quota, and offline behavior.
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Sync data across devices using CloudKit, iCloud key-value storage, and iCloud Drive. Covers container setup, record CRUD, queries, subscriptions, CKSyncEngine, SwiftData integration, conflict resolution, and error handling.
CKSyncEngine or change tokens for durable incremental synchronization.CKSyncEngine, SwiftData, key-value storage, iCloud Drive, and error handling.| Mistake | Fix |
|---|---|
| Syncing without an account gate | Check accountStatus() and model .noAccount as a user-visible state. |
| Personal data in the public database | Use private scope for user data; public scope is app-wide content. |
| Timer polling | Use database subscriptions or CKSyncEngine. |
| Immediate retry after throttling | Respect retryAfterSeconds and preserve pending work. |
| Assuming the engine resolves conflicts | Three-way merge failedRecordSaves, then reschedule the save. |
| Starting every fetch with a nil token | Persist tokens/state; reset only on the documented expiry path. |
.noAccount handled gracefullyCKError.serverRecordChanged handled with three-way merge into serverRecordretryAfterSeconds respectedCKDatabaseSubscription or CKSyncEngine used for push-based sync; Remote notifications enabled for background deliverychangeTokenExpired resets and refetches.partialFailure errors inspected per-item via partialErrorsByItemID.userDeletedZone handled by recreating zone and resyncingNSUbiquitousKeyValueStore.didChangeExternallyNotification observedCKRecord.Reference cannot use encryptedValues because CloudKit needs it server-side; no query/sort on encrypted fields; CKAsset is encrypted by defaultCKSyncEngine state serialization persisted across launches (iOS 17+)thienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Sep 6, 2026
since May 22, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.