core-data-patterns — community core-data-patterns, agile-maestro, community, ide skills

v1.0.0

À propos de ce Skill

Parfait pour les agents de développement d'applications macOS nécessitant des modèles de persistance de Core Data avancés. Core Data persistence patterns for macOS apps. Stack setup, CRUD operations, relationships, migrations.

brdohman brdohman
[2]
[0]
Updated: 3/14/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 7/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
7/11
Quality Score
33
Canonical Locale
en
Detected Body Locale
en

Parfait pour les agents de développement d'applications macOS nécessitant des modèles de persistance de Core Data avancés. Core Data persistence patterns for macOS apps. Stack setup, CRUD operations, relationships, migrations.

Pourquoi utiliser cette compétence

Permet aux agents de gérer le stockage et la récupération de données en utilisant NSPersistentContainer et des acteurs Swift, en fournissant un guide de configuration pour une intégration et une persistance de Core Data efficaces.

Meilleur pour

Parfait pour les agents de développement d'applications macOS nécessitant des modèles de persistance de Core Data avancés.

Cas d'utilisation exploitables for core-data-patterns

Configuration de NSPersistentContainer pour les applications macOS
Mise en œuvre d'acteurs Swift pour la persistance des données
Débogage des problèmes de persistance de Core Data dans les applications macOS

! Sécurité et Limitations

  • Nécessite un environnement de développement macOS
  • Limité aux modèles de persistance de Core Data
  • Le langage de programmation Swift est requis

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is core-data-patterns?

Parfait pour les agents de développement d'applications macOS nécessitant des modèles de persistance de Core Data avancés. Core Data persistence patterns for macOS apps. Stack setup, CRUD operations, relationships, migrations.

How do I install core-data-patterns?

Run the command: npx killer-skills add brdohman/agile-maestro/core-data-patterns. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for core-data-patterns?

Key use cases include: Configuration de NSPersistentContainer pour les applications macOS, Mise en œuvre d'acteurs Swift pour la persistance des données, Débogage des problèmes de persistance de Core Data dans les applications macOS.

Which IDEs are compatible with core-data-patterns?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for core-data-patterns?

Nécessite un environnement de développement macOS. Limité aux modèles de persistance de Core Data. Le langage de programmation Swift est requis.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add brdohman/agile-maestro/core-data-patterns. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use core-data-patterns immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

core-data-patterns

Install core-data-patterns, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before rollout.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Core Data Skill

Overview

Core Data persistence patterns for macOS apps.

Stack Setup

swift
1actor PersistenceController { 2 static let shared = PersistenceController() 3 4 let container: NSPersistentContainer 5 6 init(inMemory: Bool = false) { 7 container = NSPersistentContainer(name: "AppModel") 8 9 if inMemory { 10 container.persistentStoreDescriptions.first?.url = URL(fileURLWithPath: "/dev/null") 11 } 12 13 container.loadPersistentStores { _, error in 14 if let error { 15 fatalError("Core Data failed: \(error)") 16 } 17 } 18 19 container.viewContext.automaticallyMergesChangesFromParent = true 20 container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy 21 } 22 23 var viewContext: NSManagedObjectContext { 24 container.viewContext 25 } 26 27 func newBackgroundContext() -> NSManagedObjectContext { 28 container.newBackgroundContext() 29 } 30}

Entity Pattern

swift
1@objc(Item) 2public class Item: NSManagedObject { 3 @NSManaged public var id: UUID 4 @NSManaged public var title: String 5 @NSManaged public var createdAt: Date 6 @NSManaged public var updatedAt: Date 7} 8 9extension Item { 10 @nonobjc public class func fetchRequest() -> NSFetchRequest<Item> { 11 NSFetchRequest<Item>(entityName: "Item") 12 } 13 14 static func create(in context: NSManagedObjectContext, title: String) -> Item { 15 let item = Item(context: context) 16 item.id = UUID() 17 item.title = title 18 item.createdAt = Date() 19 item.updatedAt = Date() 20 return item 21 } 22}

Fetch Requests

swift
1// Basic fetch 2let request = Item.fetchRequest() 3request.predicate = NSPredicate(format: "title CONTAINS[cd] %@", searchText) 4request.sortDescriptors = [NSSortDescriptor(keyPath: \Item.createdAt, ascending: false)] 5request.fetchLimit = 50 6request.fetchBatchSize = 20 7 8let items = try context.fetch(request)

SwiftUI Integration

swift
1struct ItemListView: View { 2 @FetchRequest( 3 sortDescriptors: [SortDescriptor(\.createdAt, order: .reverse)], 4 animation: .default 5 ) 6 private var items: FetchedResults<Item> 7 8 var body: some View { 9 List(items) { item in 10 Text(item.title) 11 } 12 } 13}

Background Operations

swift
1func importData(_ data: [ImportItem]) async throws { 2 let context = PersistenceController.shared.newBackgroundContext() 3 4 try await context.perform { 5 for item in data { 6 let entity = Item(context: context) 7 entity.id = UUID() 8 entity.title = item.title 9 } 10 try context.save() 11 } 12}

Migrations

  1. Create new model version in Xcode
  2. Set as current version
  3. Enable automatic migration:
swift
1description.shouldMigrateStoreAutomatically = true 2description.shouldInferMappingModelAutomatically = true

Testing

swift
1final class CoreDataTests: XCTestCase { 2 var controller: PersistenceController! 3 4 override func setUp() { 5 controller = PersistenceController(inMemory: true) 6 } 7}

CloudKit Container (DA-4)

For iCloud sync, use NSPersistentCloudKitContainer instead of NSPersistentContainer:

swift
1let container = NSPersistentCloudKitContainer(name: "AppModel") 2// CloudKit sync is automatic after setup 3// Conflict resolution uses NSMergeByPropertyObjectTrumpMergePolicy (local wins)

CloudKit schema migration: CloudKit schemas are additive only — you can add fields/entities but never remove or rename them. Plan schema carefully.

Derived Attributes (DA-5)

Use derived attributes for denormalized counts/aggregates to avoid expensive fetch requests:

In the Xcode model editor: select attribute > Data Model Inspector > Derived > set derivation expression.

// Count of children: "children.@count"
// Latest date: "children.@max.createdAt"

Derived attributes are computed by Core Data automatically on save. They avoid N+1 query problems.

Abstract Entity Patterns (DA-6)

Use abstract entities for shared attributes across entity types:

AbstractBaseEntity (abstract)
  ├── id: UUID
  ├── createdAt: Date
  ├── updatedAt: Date
  │
  ├── TaskEntity (concrete)
  │   └── title: String
  │
  └── NoteEntity (concrete)
      └── body: String

When to use: Multiple entities share 3+ identical attributes. Avoid when: Only id/createdAt/updatedAt are shared (just add them to each entity directly — the inheritance complexity isn't worth it for 3 fields).

Core Data Debugging (DA-7)

Launch arguments for diagnostics:

ArgumentWhat It Shows
-com.apple.CoreData.SQLDebug 1SQL queries executed
-com.apple.CoreData.SQLDebug 3SQL + bind variables
-com.apple.CoreData.MigrationDebug 1Migration steps
-com.apple.CoreData.ConcurrencyDebug 1Thread violations
-com.apple.CoreData.CloudKitDebug 1CloudKit sync activity

Add in Xcode: Edit Scheme > Run > Arguments > Arguments Passed On Launch.

Instruments Core Data template: Shows fetch counts, fault counts, save durations. Use when debugging performance. High fault count = objects being accessed that weren't prefetched.

Data Integrity Constraints (DA-8)

Unique Constraints

Set in Xcode model editor: select entity > Data Model Inspector > Constraints. Prevents duplicate entries on the constrained fields.

// Entity: Tag
// Unique constraints: name
// → Two Tags with the same name will merge instead of creating duplicates

Validation Rules

Add in model editor per attribute: Min Value, Max Value, Regex for strings.

swift
1// Programmatic validation (for complex rules) 2override func validateForInsert() throws { 3 try super.validateForInsert() 4 guard title.count >= 1 else { 5 throw ValidationError.titleRequired 6 } 7}

Fetch Request Validation

Always validate predicates against the model at development time:

swift
1// Use typed key paths instead of string-based predicates where possible 2request.predicate = NSPredicate(format: "%K == %@", #keyPath(Item.status), "active")

Compétences associées

Looking for an alternative to core-data-patterns or another community skill for your workflow? Explore these related open-source skills.

Voir tout

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

widget-generator

Logo of f
f

Générez des plugins de widgets personnalisables pour le système de flux prompts.chat

flags

Logo of vercel
vercel

Le Cadre de Réaction

138.4k
0
Navigateur

pr-review

Logo of pytorch
pytorch

Tenseurs et réseaux neuronaux dynamiques en Python avec une forte accélération GPU

98.6k
0
Développeur