cloudkit-ref

Describe CloudKit sync patterns for SwiftData, CKSyncEngine, and raw APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive CloudKit reference and modern sync patterns to help developers implement iCloud data syncing with reduced guesswork and complexity. It guides the choice between SwiftData+CloudKit, CKSyncEngine, and raw CloudKit APIs, and covers conflict resolution and debugging workflows.

Core Features & Use Cases

  • Comprehensive CloudKit reference for database APIs and modern sync patterns (SwiftData+CloudKit, CKSyncEngine, raw CloudKit)
  • Guidance on configuring public/private/shared databases and conflict resolution
  • Debugging CloudKit sync issues and performance considerations

Quick Start

Prompt: "Show me a CKSyncEngine setup for a private CloudKit database with basic conflict handling."

Frequently Asked Questions about cloudkit-ref

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

FAQPage Schema
How do I sync data between Apple devices using CloudKit?

CloudKit sync enables iCloud data synchronization across iOS, iPadOS, and macOS by storing structured data in private, public, or shared databases. Choose between SwiftData+CloudKit for automatic integration, CKSyncEngine for manual control, or raw CloudKit APIs for custom workflows. Each approach handles conflict resolution differently based on your app's architecture.

What's the difference between SwiftData+CloudKit, CKSyncEngine, and raw CloudKit APIs?

SwiftData+CloudKit provides automatic sync with minimal setup; CKSyncEngine offers explicit conflict handling and sync state management; raw CloudKit APIs give full control over database operations and custom logic. Select based on complexity needs: SwiftData for simple apps, CKSyncEngine for structured sync requirements, raw APIs for specialized scenarios.

How do I handle conflicts when syncing CloudKit data across devices?

CloudKit conflict resolution strategies depend on your sync approach. CKSyncEngine and raw CloudKit APIs support server-wins, client-wins, and custom merge logic. Implement handlers that detect version mismatches, apply business rules to conflicting records, and persist the resolved state to maintain consistency across private, public, and shared databases.

Can I use CloudKit with private, public, and shared databases simultaneously?

Yes. CloudKit supports three database types: private (per-user iCloud), public (app-wide), and shared (user-initiated collaboration). Configure appropriate entitlements and access controls for each database type. CKSyncEngine and raw APIs handle multi-database sync workflows, managing permissions and conflict resolution independently per database.

How do I debug CloudKit sync performance issues?

Monitor sync state, track record change timestamps, and analyze network activity to identify bottlenecks. CKSyncEngine exposes sync progress and error details; raw CloudKit APIs provide operation callbacks. Check for excessive record sizes, unindexed queries, rate limits, and misconfigured entitlements that degrade sync speed across devices.

What entitlements and configuration do I need for CloudKit syncing?

Enable iCloud capability, configure CloudKit container entitlements, and set up database schemas and indexes in CloudKit Dashboard. SwiftData+CloudKit automates schema mapping; CKSyncEngine and raw APIs require manual record type and field definitions. Verify sandbox and production environment settings match your app's deployment target.