Builds or reviews Core Data persistence including managed objects, fetched results, batch operations, persistent history, staged migration, and concurrency. For apps not adopting SwiftData.
Ships in all-ios-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build and maintain data persistence using Core Data for apps that have not adopted SwiftData. Covers stack setup, concurrency, batch operations, NSFetchedResultsController, persistent history tracking, staged migration, and testing.
Core Data contexts are bound to queues: viewContext runs on the main queue, while background tasks use newBackgroundContext().
context.perform(_:) or context.performAndWait(_:).NSManagedObject instances between contexts or threads; pass NSManagedObjectID and re-fetch via existingObject(with:).automaticallyMergesChangesFromParent = true and configure mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy on viewContext.import CoreData
func updateTrip(id: NSManagedObjectID, name: String) async throws {
let context = CoreDataStack.shared.newBackgroundContext()
try await context.perform {
guard let trip = try context.existingObject(with: id) as? CDTrip else { return }
trip.name = name
if context.hasChanges { try context.save() }
}
}
Drives UI collections from an NSFetchRequest with automatic change tracking:
controller(_:didChangeContentWith:)) on iOS 13+ to animate UI changes.deleteCache(withName:) before changing predicate or sort descriptors, or pass cacheName: nil.NSBatchInsertRequest, NSBatchUpdateRequest, and NSBatchDeleteRequest execute directly at the SQLite level, bypassing managed object contexts.
resultType = .objectIDs / .resultTypeObjectIDs.NSManagedObjectContext.mergeChanges(fromRemoteContextSave:into:).Deny).Track store modifications across app extensions, widgets, and processes:
NSPersistentHistoryTrackingKey: true in store options.NSPersistentHistoryChangeRequest and merge them into local contexts.NSStagedMigrationManager with lightweight and custom stages (NSCustomMigrationStage) for deterministic upgrades. Read references/staged-migration.md.@Attribute(originalName:). Route pure SwiftData work to the swiftdata skill.Use NSInMemoryStoreType for deterministic unit testing. Share a single compiled NSManagedObjectModel instance across tests to prevent duplicate entity runtime errors.
NSManagedObjectID and refetch with existingObject(with:).if context.hasChanges.mergePolicy causes conflict save crashes. Set NSMergeByPropertyObjectTrumpMergePolicy.@unchecked Sendable.NSPersistentContainer created once and shared across the appperform(_:) or performAndWait(_:)NSManagedObject instances cross thread or context boundariesviewContext.automaticallyMergesChangesFromParent is enabledmergePolicy configured on contexts to handle conflicts cleanlymergeChangesNSFetchedResultsController requests include explicit sort descriptorsNSManagedObjectModelWhat SKILL.md sets; muted values are Claude Code's defaults
/all-ios-skills:core-datafrom all-ios-skills
npx claudepluginhub thienqo/ios-skills --plugin all-ios-skills95 skills in this plugin
/accessorysetupkitDiscover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions./activitykitBuild or review Live Activities and Dynamic Island experiences with ActivityKit, including lifecycle, layouts, push updates, and scheduled delivery. Use for time-sensitive Lock Screen or Dynamic Island state; route ordinary widgets to widgetkit./adattributionkitMeasure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.Other plugins' skills for the same job