cloud-sync

Design CloudKit and iCloud Drive sync strategies with SwiftData and CKSyncEngine.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/derKlinke/codex-config --skill cloud-sync-derklinke
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloud-sync
Source: https://github.com/derKlinke/codex-config/tree/main/skills/ios-cloud-sync
Command: npx skills add https://github.com/derKlinke/codex-config --skill cloud-sync-derklinke

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineering teams design and implement data synchronization strategies for Apple platforms, ensuring reliable cross-device sync and correct data state between CloudKit and iCloud Drive.

Core Features & Use Cases

  • Offline-first patterns: write locally and sync in the background to CloudKit or iCloud Drive.
  • Architecture decisions: choose between CloudKit structured data vs iCloud Drive file-based storage, with appropriate conflict resolution.
  • Use Case: a note-taking app that stores notes locally and syncs across devices, keeping changes consistent even when offline.

Quick Start

Configure a basic sync scenario by enabling iCloud at the project level, selecting a data model for CloudKit, and performing a local write followed by a background sync to CloudKit or iCloud Drive.

Frequently Asked Questions about cloud-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement offline-first sync with CloudKit and SwiftData?

Offline-first sync with CloudKit and SwiftData requires writing data locally first, then performing a background sync to ensure cross-device data consistency. This pattern guarantees app availability even when network connectivity is unavailable.

When should I choose CloudKit structured data over iCloud Drive documents for sync?

Choose CloudKit structured data for relational records requiring CKSyncEngine integration, and iCloud Drive documents for file-based storage. Selecting the correct architecture ensures appropriate conflict resolution and optimal offline-first data flow for your specific app requirements.

How does CKSyncEngine handle conflict resolution for cross-device data?

CKSyncEngine handles conflict resolution by managing state changes between local SwiftData writes and remote CloudKit updates, ensuring cross-device data consistency by applying actionable resolution rules during the background synchronization process.

Can I use iCloud Drive for offline-first file synchronization in a note-taking app?

Yes, you can use iCloud Drive for offline-first file synchronization in a note-taking app by writing notes locally and syncing documents in the background, maintaining consistent changes across devices even when offline.

What is the best way to design data synchronization strategies for Apple platforms?

The best way to design data synchronization strategies for Apple platforms is to evaluate offline-first patterns, choosing between CloudKit and iCloud Drive based on your data model, ensuring reliable cross-device sync and correct state management.