/ios-skills:swiftdata-expert-skillfrom ios-skills
Provides expert guidance on SwiftData persistence: @Model schemas, @Relationship/@Attribute rules, Query/FetchDescriptor access, ModelContainer/ModelContext config, CloudKit sync, SchemaMigrationPlan, ModelActor concurrency, and Core Data adoption.
Ships in 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.
Use this skill to build, review, and harden SwiftData persistence architecture with Apple-documented patterns from iOS 17 through current updates. Prioritize data integrity, migration safety, sync correctness, and predictable concurrency behavior.
#Index, #Unique, HistoryDescriptor, DataStore, inheritance examples).ModelContainer wiring before debugging data issues; without it, inserts fail and fetches are empty.SchemaMigrationPlan when needed.rg "modelContainer\\(|ModelContainer\\(" -nrg "^@Model|#Unique|#Index|@Relationship|@Attribute|@Transient" -nrg "modelContext|mainContext|ModelContext\\(" -nrg "SchemaMigrationPlan|VersionedSchema|MigrationStage|fetchHistory|deleteHistory|historyToken" -nrg "cloudKitDatabase|iCloud|CloudKit|groupContainer|AppGroup|NSPersistentCloudKitContainer" -n.modelContainer(...) modifier or manual ModelContainer(...).save() is required.isUndoEnabled) and whether operations occur on mainContext or custom contexts.automatic, .private(...), .none).references/modeling-and-schema.md.references/model-context-and-lifecycle.md.references/querying-and-fetching.md.references/relationships-and-inheritance.md.references/migrations-and-history.md.references/cloudkit-sync.md.references/core-data-adoption.md.references/concurrency-and-actors.md.references/troubleshooting-and-updates.md.references/implementation-playbooks.md..modelContainer(...) is attached at app or window root and the model type is included.@Attribute(.unique) or #Unique constraints and rely on insert-upsert behavior..cascade vs .nullify) and check for unbounded delete(model:where:).isUndoEnabled: true and that changes are saved via mainContext (not only background context).cloudKitDatabase if multiple containers exist.fetchHistory) with token + author filtering.historyTokenExpired appears:
FetchDescriptor settings.@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
RootView()
}
.modelContainer(for: [Trip.self, Accommodation.self])
}
}
let config = ModelConfiguration(isStoredInMemoryOnly: false)
let container = try ModelContainer(
for: Trip.self,
Accommodation.self,
configurations: config
)
struct TripListView: View {
@Query private var trips: [Trip]
init(searchText: String) {
let predicate = #Predicate<Trip> {
searchText.isEmpty || $0.name.localizedStandardContains(searchText)
}
_trips = Query(filter: predicate, sort: \.startDate, order: .forward)
}
var body: some View { List(trips) { Text($0.name) } }
}
do {
try modelContext.delete(
model: Trip.self,
where: #Predicate { $0.endDate < .now },
includeSubclasses: true
)
try modelContext.save()
} catch {
// Handle delete and save failures.
}
references/modeling-and-schema.mdreferences/model-context-and-lifecycle.mdreferences/querying-and-fetching.mdreferences/relationships-and-inheritance.mdreferences/migrations-and-history.mdreferences/cloudkit-sync.mdreferences/core-data-adoption.mdreferences/concurrency-and-actors.mdreferences/troubleshooting-and-updates.mdreferences/implementation-playbooks.mdfetchLimit, offsets, identifier-only fetches) for scalability.ModelConfiguration for environment-specific behavior (in-memory tests, CloudKit, app groups, read-only stores).cascade, nullify, and others).references/cloudkit-sync.md (opens in a new tab)references/concurrency-and-actors.md (opens in a new tab)references/core-data-adoption.md (opens in a new tab)references/implementation-playbooks.md (opens in a new tab)references/migrations-and-history.md (opens in a new tab)references/model-context-and-lifecycle.md (opens in a new tab)references/modeling-and-schema.md (opens in a new tab)references/querying-and-fetching.md (opens in a new tab)references/relationships-and-inheritance.md (opens in a new tab)references/troubleshooting-and-updates.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
swiftdata, persistence, core-data-migration, cloudkit, ios-development
npx claudepluginhub jordancoin/ios-skills-collection --plugin ios-skills206 skills in this plugin
/aso-appstore-screenshotsGenerate high-converting App Store screenshots by analyzing your app's codebase, discovering core benefits, and creating ASO-optimized screenshot images using Nano Banana Pro./cleanseReview code for readability, then simplify it to be easy to follow and understand. Use this skill when the user wants to simplify code, improve readability, clean up for handoff, make code skimmable, reduce complexity, refactor for clarity, strip boilerplate, prepare code for future maintainers, or make a codebase easier to pick up. Trigger liberally — any request touching readability, simplification, cleanup, or "make this easier to understand" should use this skill. Also trigger when the user says things like "review this", "clean this up", "tidy this", "make this simpler", "reduce complexity", "flatten this", "strip the noise", or "I want to understand this code quickly next time I open it".
/critical-reasoningApply critical rationalist epistemology (Popper, Deutsch) to evaluate reasoning, identify errors, and refine understanding. Use when the user explicitly requests help with reasoning - phrases like "help me think this through", "does this make sense", "any flaws in this", "what am I missing", "critique this", "is this reasoning sound", "stress test this idea", "devil's advocate", or any request to evaluate arguments, identify logical problems, or improve thinking. Also use when errors in reasoning are significant enough to materially affect the user's goals, even if not explicitly requested.Other plugins' skills for the same job