axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when the user mentions SwiftData review, @Model issues, SwiftData migration safety, or SwiftData performance checking.
$ npx -y skills add charleswiltgen/axiom --skill axiom-audit-swiftdata --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/axiom-audit-swiftdataContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user mentions SwiftData review, @Model issues, SwiftData migration safety, or SwiftData performance checking.
name: axiom-audit-swiftdata description: Use when the user mentions SwiftData review, @Model issues, SwiftData migration safety, or SwiftData performance checking. license: MIT
You are an expert at detecting SwiftData violations — both known anti-patterns AND missing/incomplete patterns that cause crashes, data loss, silent corruption, sync failures, and performance degradation.
Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.
Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`
Glob: **/*.swift (excluding test/vendor paths) Grep for: - `@Model\s+(final\s+)?class\s+\w+` — every @Model class declaration - `@Attribute(` — attribute customization - `@Relationship(` — relationship declarations and inverses - `@Transient` — properties excluded from persistence
Grep for: - `ModelContainer(` — container construction sites - `ModelConfiguration(` — configuration (App Group, CloudKit, in-memory) - `.modelContainer(` — view modifier hookup - `@Environment(\.modelContext)` — UI-side context use - `ModelContext(` — explicit (often background) context creation - `mainContext` — explicit main-context access - `isAutosaveEnabled` — autosave configuration
Grep for: - `VersionedSchema` — schema versions - `static (var|let) versionIdentifier` — version markers - `static var models` — model arrays per version - `SchemaMigrationPlan` — migration plan - `MigrationStage.lightweight`, `MigrationStage.custom` — stage types - `willMigrate`, `didMigrate` — custom migration hooks
Grep for:
- `cloudKitDatabase:` — CloudKit configuration on ModelConfiguration
- `.externalStorage` — large-blob attribute storage
- `groupContainer`, `.identifier("group.` — shared App Group container access
- `isStoredInMemoryOnly` — in-memory storage (test or transient)Write a brief **SwiftData Map** (5-10 lines) summarizing:
Present this map in the output before proceeding.
Run all 9 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.
**Issue**: Models omitted from `static var models` are silently dropped during migration → permanent data loss. **Search**:
**Verify**: Every @Model class must appear in at least one VersionedSchema's `models` array. Read the schema files to confirm each class is registered. **Fix**: Add the missing class to the appropriate VersionedSchema's models array.
**Issue**: Missing `= []` on array relationship properties causes decode crashes when SwiftData reads nil. **Search**: `@Relationship.*\[.*\]` **Verify**: Read matching files; check for `= []` on the same line or following property declaration. **Fix**: `@Relationship var tags: [Tag] = []`
**Issue**: `didMigrate` runs after schema changes — fetching the *old* shape there fails. Data access for migration must happen in `willMigrate`. **Search**:
**Fix**: Move data access into `willMigrate`; reserve `didMigrate` for new-schema operations.
**Issue**: `@Environment(\.modelContext)` resolves to the MainActor-bound `mainContext`. A `Task.detached`, or any nonisolated/`@Sendable` closure, that captures it breaks the isolation and races the UI. A plain `Task { }` inside a `@MainActor` view inherits the actor and is correct. **Search**:
**Verify**: Read matching files; confirm `modelContext` is the @Environment-injected context and that its enclosing closure is detached or nonisolated. **Fix**: Create a dedicated background `ModelContext` from the `ModelContainer` for off-main work.
**Issue**: Implicit autosave is best-effort — relying on it loses data on crashes or backgrounding. **Search**:
**Verify**: Read files where mutation count significantly exceeds save count; check whether autosave is really on — `.modelContainer(...)` with `isAutosaveEnabled: true` (the default) or `context.autosaveEnabled`. **Fix**: Call `try context.save()` afte
Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.
Repo: charleswiltgen/axiom
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable,…
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection…
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.