Skip to content

dpearson2699/swift-ios-skills / skills/core-data

core-data

Verified

Build, review, or improve Core Data persistence in apps that have not adopted SwiftData. Use when working with NSManagedObject subclasses, NSFetchedResultsController for list-driven UI, NSBatchInsertRequest / NSBatchDeleteRequest / NSBatchUpdateRequest for bulk operations, NSPersistentHistoryChangeRequest for persistent history tracking and multi-target sync, NSStagedMigrationManager for staged schema migrations (iOS 17+), NSCompositeAttributeDescription for composite attributes (iOS 17+), or when integrating Core Data threading with Swift Concurrency. For Core Data + SwiftData coexistence or migration, see the swiftdata skill instead.

FileKindSize
SKILL.mdskill md16.2 KB
evals/evals.jsonconfig3.4 KB
references/persistent-history.mdmarkdown1.9 KB
references/staged-migration.mdmarkdown2.2 KB

evals/evals.json

View on GitHub
{
  "skill_name": "core-data",
  "evals": [
    {
      "id": 1,
      "prompt": "Review this Core Data staged migration plan for an iOS 26 app: the team creates NSLightweightMigrationStage([\"ModelV1\", \"ModelV2\"]), constructs NSManagedObjectModelReference(named: \"ModelV2\", in: .main), and expects NSStagedMigrationManager to run without wiring it into the persistent store description. Give concise corrected guidance with Swift where useful.",
      "expected_output": "A review that corrects staged migration checksum usage, NSManagedObjectModelReference initializer requirements, and store-description wiring.",
      "files": [],
      "assertions": [
        "States that NSLightweightMigrationStage takes version checksums, not human-readable model names.",
        "Uses NSManagedObjectModelReference(name:in:versionChecksum:) or an equivalent initializer with a versionChecksum.",
        "Includes source and destination model references for an NSCustomMigrationStage.",
        "Shows or describes setting NSPersistentStoreStagedMigrationManagerOptionKey before loading the persistent stores."
      ]
    },
    {
      "id": 2,
      "prompt": "Review this Core Data multi-target sync plan: a widget and app share a SQLite store, batch inserts and deletes run on background contexts, the viewContext never merges SQL-level changes, no persistent history token is stored, and objects are passed directly to detached tasks. Explain what to fix.",
      "expected_output": "A review that fixes batch-operation merging, persistent history tracking, token storage, and object/thread boundaries.",
      "files": [],
      "assertions": [
        "Explains that batch inserts, updates, and deletes bypass normal managed-object context change tracking and must be merged or consumed through persistent history.",
        "Recommends enabling NSPersistentHistoryTrackingKey for multi-target or multi-process stores.",
        "Recommends observing NSPersistentStoreRemoteChange notifications when remote-change delivery is needed.",
        "States that each target or consumer should persist its own persistent history token.",
        "States that NSManagedObject instances must not cross context or thread boundaries; pass NSManagedObjectID and re-fetch.",
        "Mentions that batch delete bypasses validation beyond basic delete rules and is incompatible with the Deny delete rule."
      ]
    },
    {
      "id": 3,
      "prompt": "A team asks for a Core Data plan, but the real request is to run Core Data and SwiftData side by side against the same existing SQLite store and then migrate new screens to @Model. How should the agent route the work and what high-level boundary guidance should it give?",
      "expected_output": "A boundary answer that identifies Core Data + SwiftData coexistence/migration as SwiftData-owned while giving only high-level handoff guidance.",
      "files": [],
      "assertions": [
        "States that Core Data + SwiftData coexistence or migration should use the swiftdata skill.",
        "Avoids turning the Core Data skill into a full SwiftData migration guide.",
        "Gives high-level boundary guidance such as matching store URL, entity names, property names, and schema.",
        "Mentions using @Attribute(originalName:) or equivalent rename mapping for renamed properties.",
        "Preserves standalone Core Data guidance for apps that have not adopted SwiftData."
      ]
    }
  ]
}
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall