axiom-swiftdata-migration

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

Guidance for safely changing the structure of data stored by SwiftData, Apple's persistence framework for Swift apps. It covers custom migrations when existing records need conversion or relationships need restructuring.

In plain words
What is it for?
Use it to write and test VersionedSchema and SchemaMigrationPlan migrations, including property type changes, required fields, relationship changes, and data transformations.
Why use it?
It helps prevent lost data or broken relationships when an app's models change between releases. It also explains SwiftData's limits during migration so the steps can be planned correctly.

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 write and test VersionedSchema and SchemaMigrationPlan migrations, including property type changes, required fields, relationship changes, and data transformations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/comeonoliver/skillshub/axiom-swiftdata-migration
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
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

README.md
[![agentmods](https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration/github.svg)](https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration)
Your own site
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/comeonoliver/skillshub/axiom-swiftdata-migration"><img src="https://agentmods.dev/badge/skills/comeonoliver/skillshub/axiom-swiftdata-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,383 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.00061 $0.06383
Opus 5 $0.00030 $0.03191
Sonnet 5 $0.00012 $0.01277
Haiku 4.5 $0.00006 $0.00638

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

Security

Grade A, and why

axiom-swiftdata-migration 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 7d 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 v1Notes = try context.fetch(FetchDescriptor<SchemaV1.Note>())
skills/CharlesWiltgen/Axiom/axiom-swiftdata-migration/SKILL.md · 963 lines

How it starts

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

SwiftData Custom Schema Migrations

Overview

SwiftData schema migrations move your data safely when models change. Core principle SwiftData's willMigrate sees only OLD models, didMigrate sees only NEW models—you can never access both simultaneously. This limitation shapes all migration strategies.

Requires iOS 17+, Swift 5.9+ Target iOS 26+ (features like propertiesToFetch)

When Custom Migrations Are Required

Lightweight Migrations (Automatic)

SwiftData can migrate automatically for:

  • ✅ Adding new optional properties
  • ✅ Adding new required properties with default values
  • ✅ Removing properties
  • ✅ Renaming properties (with @Attribute(originalName:))
  • ✅ Changing relationship delete rules
  • ✅ Adding new models

Custom Migrations (This Skill)

You need custom migrations for:

  • ❌ Changing property types (StringAttributedString, IntString)
  • ❌ Making optional properties required (must populate existing nulls)
  • ❌ Complex relationship restructuring
  • ❌ Data transformations (splitting/merging fields)
  • ❌ Deduplication when adding unique constraints

Example Prompts

These are real questions developers ask that this skill is designed to answer:

1. "I need to change a property from String to AttributedString. How do I migrate existing data with relationships intact?"

→ The skill shows the two-stage migration pattern that works around the willMigrate/didMigrate limitation

2. "My model has a one-to-many relationship with cascade delete. How do I preserve this during a type change migration?"

→ The skill explains relationship prefetching and maintaining inverse relationships across schema versions

3. "I have a many-to-many relationship between Tags and Notes. The migration is failing with 'Expected only Arrays for Relationships'. What's wrong?"

→ The skill covers explicit inverse relationship requirements and iOS 17.0 alphabetical naming bug

4. "I need to rename a model but keep all its relationships intact."

→ The skill shows @Attribute(originalName:) patterns for lightweight migration

Read the full file on GitHub · 963 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. 7d ago First seen · 963 lines · 61 tokens per session scan A d9761db57e3f

Subscribe to this mod's changes

axiom-swiftdata-migration is a skill published in the GitHub repository ComeOnOliver/skillshub (63 stars, last pushed 2mo ago), licensed MIT. It adds 61 tokens to every session and 6,383 once invoked, about $0.0003 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.