Skip to content

AvdLee/Core-Data-Agent-Skill / core-data-expert

core-data-expert

Verified

Expert Core Data guidance (iOS/macOS): stack setup, fetch requests & NSFetchedResultsController, saving/merge conflicts, threading & Swift Concurrency, batch operations & persistent history, migrations, performance, and NSPersistentCloudKitContainer/CloudKit sync.

references/project-audit.md

View on GitHub
# Project Audit (Core Data)

Use this checklist to quickly discover how a project uses Core Data and which constraints apply (platform availability, CloudKit, history tracking, etc.).

## Determine platform constraints

- Find the deployment target (iOS/macOS version). Many recommendations depend on this (e.g. staged migration and composite attributes require iOS 17+/macOS 14+).
- Note whether the project is Swift 6 / strict concurrency enabled (Sendable and isolation warnings change the advice).

## Inspect the data model

- Open the model XML (`*.xcdatamodeld/*/contents`) and check:
  - entities, attributes, relationships, constraints
  - versioning setup (multiple model versions)
  - renaming identifiers (for lightweight migration)
  - composite attributes (iOS 17+)

## Identify stack setup

Search for:

- `NSPersistentContainer` vs `NSPersistentCloudKitContainer`
- `loadPersistentStores` configuration
- `persistentStoreDescriptions` (migration options, history tracking, CloudKit options)
- `viewContext` configuration (merge policy, `automaticallyMergesChangesFromParent`, query generations)
- background context creation (`newBackgroundContext`, `performBackgroundTask`)

Then consult:

- `stack-setup.md` for recommended defaults and merge policies
- `cloudkit-integration.md` if CloudKit is enabled

## Check for persistent history tracking (required for some flows)

Search for:

- `NSPersistentHistoryTrackingKey`
- `NSPersistentStoreRemoteChangeNotificationPostOptionKey`
- remote change notifications and history processing/merging

Then consult:

- `persistent-history.md` for the Observer/Fetcher/Merger/Cleaner pattern

## Spot risky concurrency patterns

Search for:

- cross-thread access to managed objects (look for passing `NSManagedObject` into async tasks/closures)
- `performAndWait` usage (risk of deadlocks / UI blocking)
- `@unchecked Sendable` applied to Core Data types (usually hides a real problem)

Then consult:

- `threading.md` and `concurrency.md`

## Useful debugging flags (for repro builds only)

- `-com.apple.CoreData.ConcurrencyDebug 1` (threading violations)
- `-com.apple.CoreData.SQLDebug 1` (SQL logging)
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall