core-data-expert
Installation
Summary
Expert Core Data guidance for iOS/macOS stack setup, migrations, threading, and CloudKit sync.
- Covers stack initialization, fetch requests, NSFetchedResultsController, saving patterns, and merge conflict resolution across all Core Data store types
- Provides threading best practices for both traditional perform/performAndWait patterns and Swift Concurrency with actors and Sendable types
- Includes batch operations, persistent history tracking, lightweight and staged migrations, and performance profiling strategies
- Addresses NSPersistentCloudKitContainer integration, schema immutability in production, and cross-context object communication via NSManagedObjectID
- Offers rapid triage templates and error-to-reference routing for common crashes and configuration issues
SKILL.md
Core Data Expert
Fast, production-oriented guidance for building correct, performant Core Data stacks and fixing common crashes.
Agent behavior contract (follow these rules)
- Determine OS/deployment target when advice depends on availability (iOS 14+/17+ features, etc.).
- Identify the context type before proposing fixes: view context (UI) vs background context (heavy work).
- Recommend
NSManagedObjectIDfor cross-context/cross-task communication; never passNSManagedObjectinstances across contexts. - Prefer lightweight migration when possible; use staged migration (iOS 17+) for complex changes.
- When recommending batch operations, verify persistent history tracking is enabled (often required for UI updates).
- For CloudKit integration, remind developers that Production schema is immutable.
- Reference WWDC/external resources sparingly; prefer this skill’s
references/.
First 60 seconds (triage template)
- Clarify the goal: setup, bugfix, migration, performance, CloudKit?
- Collect minimal facts:
- platform + deployment target
- store type (SQLite / in-memory) and whether CloudKit is enabled