axiom-swiftdata-migration-diag

axiom-swiftdata-migration-diag is a skill for Claude Code, Codex from ComeOnOliver/skillshub. It costs 49 tokens per session (4,650 once invoked), scanned A, original, MIT.

A troubleshooting guide for SwiftData migrations, which update an app's stored data after its models change. It focuses on crashes, missing data, broken relationships, and differences between simulators and real devices.

In plain words
What is it for?
Use it to diagnose schema-version mismatches, missing models, relationship inverse errors, and migration paths that were not tested on real devices.
Why use it?
It helps identify configuration and testing mistakes that can make a migration fail or appear to work only in development. This reduces the risk of production crashes and data loss.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to diagnose schema-version mismatches, missing models, relationship inverse errors, and migration paths that were not tested on real devices.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ComeOnOliver/skillshub --skill axiom-swiftdata-migration-diag
Clone the repo
git clone --depth 1 https://github.com/ComeOnOliver/skillshub

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for axiom-swiftdata-migration-diag

README.md
[![agentmods](https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag/github.svg)](https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag)
Your own site
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for axiom-swiftdata-migration-diag

Your own site · 80×15
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration-diag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,650 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.04650
Opus 5 $0.00024 $0.02325
Sonnet 5 $0.00010 $0.00930
Haiku 4.5 $0.00005 $0.00465

Measured 8d ago against content hash fa18c695daee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

axiom-swiftdata-migration-diag scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let postMigrationCount = try context.fetch(FetchDescriptor<Note>()).count
skills/CharlesWiltgen/Axiom/axiom-swiftdata-migration-diag/SKILL.md · 593 lines

How it starts

The opening of the file, as written. The whole thing — 593 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SwiftData Migration Diagnostics

Overview

SwiftData migration failures manifest as production crashes, data loss, corrupted relationships, or simulator-only success. Core principle 90% of migration failures stem from missing models in VersionedSchema, relationship inverse issues, or untested migration paths—not SwiftData bugs.

Red Flags — Suspect SwiftData Migration Issue

If you see ANY of these, suspect a migration configuration problem:

  • App crashes on launch after schema change
  • "Expected only Arrays for Relationships" error
  • "The model used to open the store is incompatible with the one used to create the store"
  • "Failed to fulfill faulting for [relationship]"
  • Migration works in simulator but crashes on real device
  • Data exists before migration, gone after
  • Relationships broken after migration (nil where they shouldn't be)
  • FORBIDDEN "SwiftData migrations are broken, we should use Core Data"
    • SwiftData handles millions of migrations in production apps
    • Schema mismatches and relationship errors are always configuration, not framework
    • Do not rationalize away the issue—diagnose it

Critical distinction Simulator deletes the database on each rebuild, hiding schema mismatch issues. Real devices keep persistent databases and crash immediately on schema mismatch. MANDATORY: Test migrations on real device with real data before shipping.

Mandatory First Steps

ALWAYS run these FIRST (before changing code):

// 1. Identify the crash/issue type
// Screenshot the crash message and note:
//   - "Expected only Arrays" = relationship inverse missing
//   - "incompatible model" = schema version mismatch
//   - "Failed to fulfill faulting" = relationship integrity broken
//   - Simulator works, device crashes = untested migration path
// Record: "Error type: [exact message]"

// 2. Check schema version configuration
// In your migration plan:
enum MigrationPlan: SchemaMigrationPlan {
    static var schemas: [any VersionedSchema.Type] {
        // ✅ VERIFY: All versions in order?
        // ✅ VERIFY: Latest version matches container?
        [SchemaV1.self, SchemaV2.self, SchemaV3.self]
    }

    static var stages: [MigrationStage] {
        // ✅ VERIFY: Migration stages match schema transitions?
        [migrateV1toV2, migrateV2toV3]
    }
}

// In your app:
let schema = Schema(versionedSchema: SchemaV3.self)  // ✅ VERIFY: Matches latest in plan?
let container = try ModelContainer(
    for: schema,
    migrationPlan: MigrationPlan.self  // ✅ VERIFY: Plan is registered?
)
// Record: "Schema version: latest is [version]"

// 3. Check all models included in VersionedSchema
enum SchemaV2: VersionedSchema {
    static var models: [any PersistentModel.Type] {
        // ✅ VERIFY: Are ALL models listed? (even unchanged ones)
        [Note.self, Folder.self, Tag.self]
    }
}
// Record: "Missing models? Yes/no"

// 4. Check relationship inverse declarations
@Model
final class Note {
    @Relationship(deleteRule: .nullify, inverse: \Folder.notes)  // ✅ VERIFY: inverse specified?
    var folder: Folder?

    @Relationship(deleteRule: .nullify, inverse: \Tag.notes)  // ✅ VERIFY: inverse specified?
    var tags: [Tag] = []
}
// Record: "Relationship inverses: all specified? Yes/no"

// 5. Enable SwiftData debug logging
// In Xcode scheme, add argument:
// -com.apple.coredata.swiftdata.debug 1
// Run and check Console for SQL queries
// Record: "Debug log shows: [what you see]"

Read the full file on GitHub · 593 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 593 lines · 49 tokens per session scan A fa18c695daee

Subscribe to this mod's changes

axiom-swiftdata-migration-diag is a skill published in the GitHub repository ComeOnOliver/skillshub (63 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 4,650 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

status

Verify gnosis-mcp server connectivity, schema integrity, and corpus health. Use when MCP calls fail, return empty, or return unexpected data.

nicholasglazer/gnosis-mcp · 31 tokens

reproduce-bug

Reproduce a reported bug in googleapis/mcp-toolbox and decide whether it is real, delivering an evidence-backed verdict: confirmed, already fixed, misconfiguration, client-side, works as intended, not reproducible, or blocked. Use whenever a maintainer asks you to reproduce, verify, confirm, or investigate a bug…

googleapis/mcp-toolbox · 130 tokens

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

codex-log-guard

Diagnose excessive Codex local SQLite diagnostic log writes with read-only evidence by default. Use when a user mentions logs2.sqlite, logs2.sqlite-wal, blockloginserts, SSD/TBW wear, or explicitly asks to protect, clean up, verify, or restore Codex diagnostic logging.

majiayu000/spellbook · 68 tokens

better-drizzle

Expert guidance for better-drizzle repository work. Use whenever the user is building, refactoring, reviewing, debugging, documenting, or migrating code that uses better-drizzle, Drizzle delegates, plugins, transactions, pagination, filters, raw SQL, or performance-sensitive repository helpers. Also use when the task…

almeidazs/better-drizzle · 78 tokens

dx-audit

Audits libraries, CLIs, and SDKs using 38 rules for public contracts, package exports, piped output, errors, and configuration. Use when asked to "audit my CLI", "review my SDK", "make this agent-friendly", or diagnose package type resolution. For agentic product trust use ax-audit; for docs use docs-writing.

mblode/agent-skills · 76 tokens