Core Data Agent Skill
Expert guidance for any AI coding tool that supports the Agent Skills open format — safe persistence, performance optimization, and schema migration.
Based on the Core Data Best Practices repo, WeTransfer production apps, and WWDC sessions, distilled into actionable, concise references for agents.
Who this is for
- Teams working with Core Data who need safe defaults and quick triage
- Developers debugging persistence issues, threading errors, or performance problems
- Anyone migrating schemas or integrating CloudKit sync
See also my other skills:
How to Use This Skill
Option A: Using skills.sh (recommended)
Install this skill with a single command:
npx skills add https://github.com/avdlee/core-data-agent-skill --skill core-data-expert
For more information, visit the skills.sh platform page.
Then use the skill in your AI agent, for example:
Use the core data skill and analyze the current project for Core Data improvements
Option B: Claude Code Plugin
Personal Usage
To install this Skill for your personal use in Claude Code:
-
Add the marketplace:
/plugin marketplace add AvdLee/Core-Data-Agent-Skill
-
Install the Skill:
/plugin install core-data-expert@core-data-agent-skill
Project Configuration
To automatically provide this Skill to everyone working in a repository, configure the repository's .claude/settings.json:
{
"enabledPlugins": {
"core-data-expert@core-data-agent-skill": true
},
"extraKnownMarketplaces": {
"core-data-agent-skill": {
"source": {
"source": "github",
"repo": "AvdLee/Core-Data-Agent-Skill"
}
}
}
}
When team members open the project, Claude Code will prompt them to install the Skill.
Option C: Manual install
- Clone this repository.
- Install or symlink the
core-data-expert/ folder following your tool's official skills installation docs (see links below).
- Use your AI tool as usual and ask it to use the "core-data-expert" skill for Core Data tasks.
Where to Save Skills
Follow your tool's official documentation, here are a few popular ones:
How to verify:
Your agent should reference the triage/playbook in core-data-expert/SKILL.md and jump into the relevant reference file for your error or task.
What This Skill Offers
This skill gives your AI coding tool comprehensive Core Data guidance. It can:
Guide Your Persistence Decisions
- Choose the right stack setup (NSPersistentContainer vs NSPersistentCloudKitContainer)
- Understand when to use view context vs background context
- Navigate merge policies and conflict resolution
- Apply proper context configuration for your use case
Write Thread-Safe Code
- Avoid common threading pitfalls with NSManagedObjectID
- Prevent data races with proper context usage
- Handle cross-context communication correctly
- Use perform vs performAndWait appropriately
Optimize Performance
- Write efficient fetch requests with proper batching and property limiting
- Reduce memory usage with context resets and faulting control
- Use batch operations for large-scale data changes
- Profile with Instruments to identify bottlenecks
Migrate Schemas Safely
- Use lightweight migration for common changes
- Decompose complex migrations with staged migration (iOS 17+)
- Defer expensive cleanup with deferred migration (iOS 14+)
- Handle composite attributes and model versioning
Integrate with CloudKit
- Set up NSPersistentCloudKitContainer correctly
- Design schemas within CloudKit limitations
- Monitor sync with event notifications
- Debug sync issues with system logs
What Makes This Skill Different
Expert Knowledge: Based primarily on the comprehensive SwiftLee Core Data articles and the Core Data Best Practices repository, with additional insights from WWDC sessions. All content reflects real-world experience from production apps like Collect by WeTransfer.