core-data-expert▌
avdlee/core-data-agent-skill · updated Apr 8, 2026
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 perfo
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
- context involved (view vs background) and whether Swift Concurrency is in use
- exact error message + stack trace/logs
- Branch immediately:
- threading/crash → focus on context confinement +
NSManagedObjectIDhandoff - migration error → identify model versions + migration strategy
- batch ops not updating UI → persistent history tracking + merge pipeline
- threading/crash → focus on context confinement +
Routing map (pick the right reference fast)
- Stack setup / merge policies / contexts →
references/stack-setup.md - Saving patterns →
references/saving.md - Fetch requests / list updates / aggregates →
references/fetch-requests.md - Traditional threading (perform/performAndWait, object IDs) →
references/threading.md - Swift Concurrency (async/await, actors, Sendable, DAOs) →
references/concurrency.md - Batch insert/delete/update →
references/batch-operations.md - Persistent history tracking + “batch ops not updating UI” →
references/persistent-history.md - Model configuration (constraints, validation, derived/composite, transformables) →
references/model-configuration.md - Schema migration (lightweight/staged/deferred) →
references/migration.md - CloudKit integration & debugging →
references/cloudkit-integration.md - Performance profiling & memory →
references/performance.md - Testing patterns →
references/testing.md - Terminology →
references/glossary.md
Common errors → next best move
- “Failed to find a unique match for an NSEntityDescription” →
references/testing.md(sharedNSManagedObjectModel) NSPersistentStoreIncompatibleVersionHashError→references/migration.md(versioning + migration)- Cross-context/threading exceptions (e.g. delete/update from wrong context) →
references/threading.mdand/orreferences/concurrency.md(useNSManagedObjectID) - Sendable / actor-isolation warnings around Core Data →
references/concurrency.md(don’t “paper over” with@unchecked Sendable) NSMergeConflict/ constraint violations →references/model-configuration.md+references/stack-setup.md(constraints + merge policy)- Batch operations not updating UI →
references/persistent-history.md+references/batch-operations.md - CloudKit schema/sync issues →
references/cloudkit-integration.md - Memory grows during fetch →
references/performance.md+references/fetch-requests.md
Verification checklist (when changing Core Data code)
- Confirm the context matches the work (UI vs background).
- Ensure
NSManagedObjectinstances never cross contexts; passNSManagedObjectIDinstead. - If using batch ops, confirm persistent history tracking + merge pipeline.
- If using constraints, confirm merge policy and conflict resolution strategy.
- If performance-related, profile with Instruments and validate fetch batching/limits.
Reference files
references/_index.md(navigation)references/stack-setup.mdreferences/saving.mdreferences/fetch-requests.mdreferences/threading.mdreferences/concurrency.mdreferences/batch-operations.mdreferences/persistent-history.mdreferences/model-configuration.mdreferences/migration.mdreferences/cloudkit-integration.mdreferences/performance.mdreferences/testing.mdreferences/glossary.md
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.8★★★★★59 reviews- ★★★★★William Singh· Dec 28, 2024
Keeps context tight: core-data-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Kiara Chen· Dec 24, 2024
core-data-expert has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Tariq Chawla· Dec 24, 2024
core-data-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Chaitanya Patil· Dec 16, 2024
We added core-data-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Tariq Agarwal· Dec 16, 2024
core-data-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Hiroshi Agarwal· Dec 16, 2024
We added core-data-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★William Menon· Dec 12, 2024
Keeps context tight: core-data-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Kiara Verma· Nov 19, 2024
I recommend core-data-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Amelia White· Nov 15, 2024
Solid pick for teams standardizing on skills: core-data-expert is focused, and the summary matches what you get after install.
- ★★★★★Zara Li· Nov 15, 2024
core-data-expert is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 59