swiftdata-pro — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited swiftdata-pro (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Model, query, and persist data with SwiftData correctly and efficiently.
@Model types and relationships.@Query / fetching in views.ModelContainer, migrations, or CloudKit sync.Trigger: /swiftdata-pro.
@Model classes are reference types managed by a ModelContext..modelContainer(for:).@Query; write through the modelContext.ModelContext for bulk work.@Model
final class Trip {
var name: String
var startDate: Date
@Relationship(deleteRule: .cascade) var stops: [Stop] = []
init(name: String, startDate: Date) {
self.name = name
self.startDate = startDate
}
}deleteRule on relationships — don't rely on defaults for ownership.@Attribute(.unique) for natural keys.@Attribute(.externalStorage).❌ No delete rule on an owning relationship
var stops: [Stop] = [] // orphans Stop rows when a Trip is deleted✅
@Relationship(deleteRule: .cascade) var stops: [Stop] = []@main
struct TripsApp: App {
var body: some Scene {
WindowGroup { ContentView() }
.modelContainer(for: Trip.self)
}
}Use @Query with sort/filter in the view; don't fetch-all then filter in Swift.
❌
@Query private var trips: [Trip]
var upcoming: [Trip] { trips.filter { $0.startDate > .now } } // loads everything✅
@Query(filter: #Predicate<Trip> { $0.startDate > Date.now },
sort: \Trip.startDate)
private var upcoming: [Trip]@Environment(\.modelContext) private var context
func add(_ trip: Trip) {
context.insert(trip)
// SwiftData autosaves; call try? context.save() only when you need it now.
}Delete with context.delete(trip).
For imports/bulk writes, use a separate context off the main actor and save in batches:
let context = ModelContext(container)
for row in rows { context.insert(Item(row)) }
try context.save()Don't do thousands of inserts on the main-actor context — it blocks the UI.
SchemaMigrationPlan with versioned schemas and migrationstages. Define VersionedSchema types; never silently mutate a shipped model.
@Attribute(.unique) (CloudKit can't enforce it).ModelConfiguration using a CloudKit container identifier.❌ (breaks CloudKit)
@Attribute(.unique) var code: String✅
var code: String = ""deleteRule on owning relationships.#Predicate in @Query..unique or non-optional properties on a CloudKit-synced model.Per issue: file:line, rule, before/after. Lead with data-loss / migration risks.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.