cloud-sync

Implement offline-first CloudKit and iCloud Drive synchronization for iOS and macOS apps.

1.1k|81|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/CharlesWiltgen/Axiom --skill cloud-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloud-sync
Source: https://github.com/CharlesWiltgen/Axiom/tree/main/.claude-plugin/plugins/axiom/skills/cloud-sync
Command: npx skills add https://github.com/CharlesWiltgen/Axiom --skill cloud-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing reliable sync architectures between structured data (CloudKit) and files (iCloud Drive), including offline-first patterns and conflict resolution.

Core Features & Use Cases

  • CloudKit vs iCloud Drive decision logic.
  • Conflict resolution strategies and offline-first implementation.
  • Patterns for incremental sync and sharing.

Quick Start

Implement offline-first sync with a local store and a cloud sync engine; handle conflicts gracefully.

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 or iCloud Drive?

Offline-first sync requires a local data store that operates independently, paired with a cloud sync engine that reconciles changes when connectivity returns. Implement using SwiftData or similar local persistence, CloudKit's CKSyncEngine, or iCloud Drive for file-based workflows, handling conflicts through merge strategies or last-write-wins resolution.

When should I use CloudKit versus iCloud Drive for synchronization?

CloudKit suits structured data with relational queries and fine-grained sync; iCloud Drive works better for file-based workflows and large assets. Choose CloudKit for database-like schemas, multi-user sharing, and incremental updates; choose iCloud Drive for document storage and when file-level versioning suffices.

How do I handle conflicts when the same data is edited across multiple devices?

Conflict resolution strategies include last-write-wins, merge-based reconciliation, or user-prompted selection. Track modification timestamps and device identifiers; apply CloudKit's CKSyncEngine or custom logic to detect conflicts and resolve them consistently, optionally logging conflicts for audit or recovery.

Can I use offline-first sync patterns with NSUbiquitousKeyValueStore?

NSUbiquitousKeyValueStore provides basic cloud sync for small key-value data but lacks fine-grained conflict control and incremental sync. It suits simple preference syncing; for structured data or complex conflict resolution, CloudKit or SwiftData with CKSyncEngine offer greater control and reliability.

What happens to unsynced data during network failures in an offline-first architecture?

Offline-first architectures persist all changes locally during network failures, queuing them for upload when connectivity resumes. Your local store remains readable and writable; sync engines replay queued changes, detect conflicts against server state, and reconcile using your chosen strategy without data loss.

Do I need to implement incremental sync, or can I sync all data at once?

Full sync works for small datasets but scales poorly with large assets or frequent changes. Incremental sync tracks modifications via timestamps or version tokens, reducing bandwidth and latency. CloudKit's CKSyncEngine and iCloud Drive both support incremental patterns; choose based on data volume and update frequency.