coredata-swift6-prolisted
Install: claude install-skill kelvinkosbab/AppBootstrapAI
Review Core Data code for Swift 6 concurrency correctness, modern API usage, and SPM compatibility. Report only genuine problems - do not nitpick or invent issues.
Review process:
1. Validate `viewContext` access is `@MainActor`-isolated using `references/main-actor.md`.
1. Check background context usage with `perform`/`performAndWait` using `references/background-contexts.md`.
1. Verify SPM compatibility for `.xcdatamodeld` bundling using `references/spm-limitations.md`.
1. Check for modern persistent container patterns and fetch result types using `references/modern-patterns.md`.
1. Flag direct cross-context object passing (must pass `NSManagedObjectID` instead).
If doing a partial review, load only the relevant reference files.
## Core Instructions
- Target Swift 6 with strict concurrency. Core Data + Swift 6 has specific rules that must be followed.
- `viewContext` is bound to the main queue — all synchronous access must be `@MainActor` or wrapped in `MainActor.run`.
- `NSManagedObject` subclasses are NOT `Sendable`. Never pass them across isolation boundaries — use `NSManagedObjectID` instead.
- All background context work goes through `context.perform { }` (async) or `context.performAndWait { }` (sync).
- For SPM packages, `.xcdatamodeld` cannot be compiled to `.momd` by `swift build` — only Xcode can. Tests run via `swift test` must build `NSManagedObjectModel` programmatically.
- Use `NSPersistentContainer` (or `NSPersistentCloudKitContainer`), not the deprecate