File contents 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 NSManagedObjectID for cross-context/cross-task communication; never pass NSManagedObject instances 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 + NSManagedObjectID handoff
migration error → identify model versions + migration strategy
batch ops not updating UI → persistent history tracking + merge pipeline
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 (shared NSManagedObjectModel)
NSPersistentStoreIncompatibleVersionHashError → references/migration.md (versioning + migration)
Cross-context/threading exceptions (e.g. delete/update from wrong context) → references/threading.md and/or references/concurrency.md (use NSManagedObjectID)
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 NSManagedObject instances never cross contexts; pass NSManagedObjectID instead.
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.md
references/saving.md
references/fetch-requests.md
references/threading.md
references/concurrency.md
references/batch-operations.md
references/persistent-history.md
references/model-configuration.md
references/migration.md
references/cloudkit-integration.md
references/performance.md
references/testing.md
references/glossary.md
Source: AvdLee/Core-Data-Agent-Skill — distributed by TomeVault .
1 --- 2 name: avdlee-core-data-agent-skill-core-data-agent-skill 3 description: Core Data Expert 4 --- 5 # Core Data Expert 6 7 Fast, production-oriented guidance for building **correct**, **performant** Core Data stacks and fixing common crashes. 8 9 ## Agent behavior contract (follow these rules) 10 11 1. Determine OS/deployment target when advice depends on availability (iOS 14+/17+ features, etc.). 12 2. Identify the context type before proposing fixes: **view context (UI)** vs **background context (heavy work)**. 13 3. Recommend `NSManagedObjectID` for cross-context/cross-task communication; **never pass `NSManagedObject` instances** across contexts. 14 4. Prefer lightweight migration when possible; use staged migration (iOS 17+) for complex changes. 15 5. When recommending batch operations, verify persistent history tracking is enabled (often required for UI updates). 16 6. For CloudKit integration, remind developers that **Production schema is immutable**. 17 7. Reference WWDC/external resources sparingly; prefer this skill’s `references/`. 18 19 ## First 60 seconds (triage template) 20 21 - **Clarify the goal**: setup, bugfix, migration, performance, CloudKit? 22 - **Collect minimal facts**: 23 - platform + deployment target 24 - store type (SQLite / in-memory) and whether CloudKit is enabled 25 - context involved (view vs background) and whether Swift Concurrency is in use 26 - exact error message + stack trace/logs 27 - **Branch immediately**: 28 - threading/crash → focus on context confinement + `NSManagedObjectID` handoff 29 - migration error → identify model versions + migration strategy 30 - batch ops not updating UI → persistent history tracking + merge pipeline 31 32 ## Routing map (pick the right reference fast) 33 34 - **Stack setup / merge policies / contexts** → `references/stack-setup.md` 35 - **Saving patterns** → `references/saving.md` 36 - **Fetch requests / list updates / aggregates** → `references/fetch-requests.md` 37 - **Traditional threading (perform/performAndWait, object IDs)** → `references/threading.md` 38 - **Swift Concurrency (async/await, actors, Sendable, DAOs)** → `references/concurrency.md` 39 - **Batch insert/delete/update** → `references/batch-operations.md` 40 - **Persistent history tracking + “batch ops not updating UI”** → `references/persistent-history.md` 41 - **Model configuration (constraints, validation, derived/composite, transformables)** → `references/model-configuration.md` 42 - **Schema migration (lightweight/staged/deferred)** → `references/migration.md` 43 - **CloudKit integration & debugging** → `references/cloudkit-integration.md` 44 - **Performance profiling & memory** → `references/performance.md` 45 - **Testing patterns** → `references/testing.md` 46 - **Terminology** → `references/glossary.md` 47 48 ## Common errors → next best move 49 50 - **“Failed to find a unique match for an NSEntityDescription”** → `references/testing.md` (shared `NSManagedObjectModel`) 51 - **`NSPersistentStoreIncompatibleVersionHashError`** → `references/migration.md` (versioning + migration) 52 - **Cross-context/threading exceptions** (e.g. delete/update from wrong context) → `references/threading.md` and/or `references/concurrency.md` (use `NSManagedObjectID`) 53 - **Sendable / actor-isolation warnings around Core Data** → `references/concurrency.md` (don’t “paper over” with `@unchecked Sendable`) 54 - **`NSMergeConflict` / constraint violations** → `references/model-configuration.md` + `references/stack-setup.md` (constraints + merge policy) 55 - **Batch operations not updating UI** → `references/persistent-history.md` + `references/batch-operations.md` 56 - **CloudKit schema/sync issues** → `references/cloudkit-integration.md` 57 - **Memory grows during fetch** → `references/performance.md` + `references/fetch-requests.md` 58 59 ## Verification checklist (when changing Core Data code) 60 61 - Confirm the context matches the work (UI vs background). 62 - Ensure `NSManagedObject` instances never cross contexts; pass `NSManagedObjectID` instead. 63 - If using batch ops, confirm persistent history tracking + merge pipeline. 64 - If using constraints, confirm merge policy and conflict resolution strategy. 65 - If performance-related, profile with Instruments and validate fetch batching/limits. 66 67 ## Reference files 68 69 - `references/_index.md` (navigation) 70 - `references/stack-setup.md` 71 - `references/saving.md` 72 - `references/fetch-requests.md` 73 - `references/threading.md` 74 - `references/concurrency.md` 75 - `references/batch-operations.md` 76 - `references/persistent-history.md` 77 - `references/model-configuration.md` 78 - `references/migration.md` 79 - `references/cloudkit-integration.md` 80 - `references/performance.md` 81 - `references/testing.md` 82 - `references/glossary.md` 83 84 --- 85 > Source: [AvdLee/Core-Data-Agent-Skill](https://github.com/AvdLee/Core-Data-Agent-Skill) — distributed by [TomeVault](https://tomevault.io). 86 <!-- tomevault:4.0:skill_md:2026-06-20 -->
tomevault-io/skills-registry/tree/main/avdlee--core-data-agent-skill--core-data-agent-skill commit b7a027e873
Frequently asked questions How do I install the Avdlee Core Data Agent Skill Core Data Agent Skill skill? Run npx skillmds@latest add tomevault-io/avdlee-core-data-agent-skill-core-data-agent-skill in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Avdlee Core Data Agent Skill Core Data Agent Skill skill do? Core Data Expert It is listed under AI & ML on SkillMD.
Is Avdlee Core Data Agent Skill Core Data Agent Skill safe to use? This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Avdlee Core Data Agent Skill Core Data Agent Skill? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Avdlee Core Data Agent Skill Core Data Agent Skill free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Avdlee Core Data Agent Skill Core Data Agent Skill? tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.