agentsclimarketplace

Sqd cloudkit setup

Skill sitapix/sqlitedata-swift-skills/skills/sqd-cloudkit-setup

Agent Skills for SQLiteData (Point-Free's GRDB-based SwiftData replacement with CloudKit sync). Covers @Table, fetch wrappers, queries, migrations, and SyncEngine.

Install
npx -y skills add sitapix/sqlitedata-swift-skills --skill sqd-cloudkit-setup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when setting up or troubleshooting iCloud/CloudKit configuration for SQLiteData sync — covers enabling iCloud capability, CloudKit entitlements, container creation, Remote Notifications background mode, deploying schema from development to production, and resetting the development environment via CloudKit Console.

SKILL.md

4.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

CloudKit Setup for SQLiteData

Complete setup guide for CloudKit sync with SQLiteData — from Xcode capabilities through production deployment.

SQLiteData context: These are the infrastructure steps needed before writing any SyncEngine code. After completing setup here, configure SyncEngine per /skill sqd-cloudkit.

Step 1: Enable iCloud Capability

  1. Add capability: follow Apple's "Adding capabilities to your app" guide
  2. Select iCloud from Xcode's Capabilities library
  3. In the Services section, check CloudKit
  4. Xcode adds these entitlements automatically:
    • com.apple.developer.icloud-services
    • Push Notifications capability (CloudKit uses push to notify of server changes)

Removing the iCloud capability in Xcode does not auto-disable it in your developer account — you must do that manually.

iCloud Services Overview

ServiceUse CaseStorage
Key-value storageSmall data (preferences), up to 1 MB / 1024 pairsNSUbiquitousKeyValueStore
iCloud DocumentsFile-based sync via UIDocument/NSDocumentUbiquity container (on-disk)
CloudKitStructured data with full schema control + sharingCKContainer databases

For SQLiteData apps, enable CloudKit.

Managing Containers

After adding iCloud capability, Xcode fetches existing containers from your developer account.

To create a new container:

  1. Click Add (+) below the containers list
  2. Enter name: must start with iCloud. and use reverse DNS (e.g., iCloud.com.example.myapp)
  3. Click OK

For SQLiteData, pass it to SyncEngine:

$0.defaultSyncEngine = try SyncEngine(
    for: $0.defaultDatabase,
    tables: ...,
    containerIdentifier: "iCloud.com.example.myapp"  // nil = auto from entitlements
)

Step 2: Enable Remote Notifications Background Mode

  1. Select your project in Xcode's Project navigator
  2. Select the app target → Signing & Capabilities
  3. Add Background Modes capability (if not present)
  4. Check Remote notifications

This allows CloudKit to silently notify your app of server-side changes, which SyncEngine uses to trigger incremental sync.

Use sparingly — overuse impacts battery life and device performance.

All Background Modes Reference

ModeInfo.plist ValuePlatforms
Audio, AirPlay, PiPaudioiOS, iPadOS, tvOS, visionOS
Location updateslocationiOS, iPadOS, watchOS
Voice over IPvoipiOS, iPadOS, visionOS, watchOS
External accessoryexternal-accessoryiOS, iPadOS
Bluetooth LE centralbluetooth-centraliOS, iPadOS, visionOS
Bluetooth LE peripheralbluetooth-peripheraliOS, iPadOS
Background fetchfetchiOS, iPadOS, tvOS, visionOS
Remote notificationsremote-notificationiOS, iPadOS, tvOS, visionOS, watchOS
Background processingprocessingiOS, iPadOS, tvOS, visionOS

Step 3: Deploy Schema to Production

During development, you create your schema and test in the development environment. Apps in the App Store access only the production environment. Before publishing, deploy the development schema to production.

Key rules:

  • Every deploy merges additive changes into production
  • You cannot delete record types or fields already in production
  • Apps in development can access either environment

Reset the Development Environment

Resets all records in the development environment. If schema isn't in production, also deletes all record types.

Steps:

  1. Sign in to CloudKit Console
  2. Select CloudKit Database app → your container
  3. Select Reset Environment (left sidebar)
  4. Read the warning, check the box, click Reset

Deploy the Development Schema

Copies record types, fields, and indexes to production — but not records.

Permissions: You need admin privileges. Individual developers are automatically admin.

Steps:

  1. Sign in to CloudKit Console
  2. Select CloudKit Database app → your container
  3. Select Deploy Schema Changes (left sidebar)
  4. Review pending changes, click Deploy

CloudKit Console Access

  • Click CloudKit Console button in Xcode's iCloud capability section
  • Or go directly to icloud.developer.apple.com
  • Use to manage schemas, inspect data, view operation logs, and performance telemetry

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,970. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.