# axiom-data

A router skill for persistence in Apple apps: SwiftData, Core Data, GRDB, SQLiteData, CloudKit, schema migrations and Codable.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1300 installs · ★ 1229
- Author: CharlesWiltgen
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/CharlesWiltgen/Axiom/tree/HEAD/axiom-codex/skills/axiom-data/SKILL.md
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/skills/axiom-data

## What it does

axiom-data does not hand you code. It reads the task and points the agent at the right reference: `skills/swiftdata.md` for `@Model` and `@Query`, `skills/core-data.md` for the Core Data stack, `skills/grdb.md` for queries and `DatabaseMigrator`, `skills/sqlitedata.md` for `@Table` and `SyncEngine`. Separate files cover schema migration, CloudKit, iCloud Drive, file storage and Codable.

The core is a symptom-to-file table plus a decision tree. It also wires up automated audits: `axiom-audit-core-data`, `axiom-audit-swiftdata`, `axiom-audit-codable`, `axiom-audit-icloud`, `axiom-audit-storage`, `axiom-audit-database-schema`, `axiom-audit-grdb-performance`. They flag unsafe `ALTER TABLE`, `try?` that swallows errors, foreign keys without indexes, struct models in SwiftData. Audits that build, test or symbolicate crashes need shell access to run.

Some topics live in neighbouring skills instead: Keychain and CryptoKit sit in axiom-security, tvOS in axiom-swift. Ask about them here and the router just sends you onward. The skill is opinionated about order. Any schema migration goes through `skills/database-migration.md` first, because a wrong step there costs user data.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add CharlesWiltgen/Axiom --skill axiom-data -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/axiom-data/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/axiom-data/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add CharlesWiltgen/Axiom --skill axiom-data -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/axiom-data/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add CharlesWiltgen/Axiom --skill axiom-data -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/axiom-data/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install CharlesWiltgen/Axiom axiom-data
```

2. **Manually: put the files in place**
- File: `.github/skills/axiom-data/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add CharlesWiltgen/Axiom --skill axiom-data -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/CharlesWiltgen/Axiom --path axiom-codex/skills/axiom-data
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/axiom-data/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add CharlesWiltgen/Axiom --skill axiom-data -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/CharlesWiltgen/Axiom/tree/HEAD/axiom-codex/skills/axiom-data/SKILL.md

## When to use it
- pick between SwiftData and SQLiteData for a new app
- rewrite GRDB queries that got slow
- run a schema migration without losing data
- set up CloudKit sync with an offline-first flow
- track down files that vanish from storage

## Example prompts
- Help me migrate this project from Realm to SwiftData
- Why does my SwiftData migration crash? Walk through the crash and propose a safe VersionedSchema
- Audit the database schema for unsafe ALTER TABLE and DROP statements

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 4ed21b291a857b2b.

BEGIN THIRD-PARTY FILE 4ed21b291a857b2b
```text
---
name: axiom-data
description: Use when working with ANY data persistence, database, storage, CloudKit, migration, or serialization in an Apple app. Covers SwiftData, Core Data, GRDB, SQLite, Realm, CloudKit sync, file storage, Codable, migrations.
license: MIT
---

# Data & Persistence

**You MUST use this skill for ANY data persistence, database, storage, CloudKit, or serialization work.**

<!-- AXIOM_AUDITOR_INLINE_BEGIN — rewritten for Codex by scripts/build-codex.ts; do not hand-edit -->
> **Auditors are skills here.** Where this router says "Launch `some-auditor` agent", invoke the
> matching Codex skill instead — same procedure, no Claude Code agent required.
>
> Available: `axiom-audit-codable`, `axiom-audit-core-data`, `axiom-audit-database-schema`, `axiom-audit-grdb-performance`, `axiom-audit-icloud`, `axiom-audit-storage`, `axiom-audit-swiftdata`.
>
> The ones that shell out — builds, tests, simulators, crash symbolication — need shell access to run.
<!-- AXIOM_AUDITOR_INLINE_END -->

## When to Use

Use this skill when working with:
- Databases (SwiftData, Core Data, GRDB, SQLiteData)
- Schema migrations
- CloudKit sync
- File storage (iCloud Drive, local storage)
- Data serialization (Codable, JSON)
- Storage strategy decisions
- Keychain / secure credential storage
- Encryption, signing, key management (CryptoKit)

## Quick Reference

| Symptom / Task | Reference |
|----------------|-----------|
| SwiftData @Model, @Query, ModelContext, sectioned queries / ResultsObserver / @Attribute(.codable) / dynamic compound predicates (`OS27`) | See `skills/swiftdata.md` |
| SwiftData schema migration, VersionedSchema | See `skills/swiftdata-migration.md` |
| SwiftData migration crashes, data loss | See `skills/swiftdata-migration-diag.md` |
| Migrating from Realm to SwiftData | See `skills/realm-migration-ref.md` |
| SwiftData vs SQLiteData decision | See `skills/sqlitedata-migration.md` |
| GRDB queries, upsert, ValueObservation, DatabaseMigrator, encryption | See `skills/grdb.md` |
| GRDB performance, indexes, EXPLAIN QUERY PLAN, cursors, observation not firing | See `skills/grdb-performance.md` |
| Full-text search (FTS5) in GRDB or SQLiteData | See `skills/sqlite-fts-ref.md` |
| Storing or querying JSON inside a SQLite column (JSON1, JSONB) | See `skills/sql-json-ref.md` |
| GRDB shared across app + widget/extension (App Group) | See `skills/grdb-app-groups.md` |
| SQLiteData @Table, CRUD, SyncEngine | See `skills/sqlitedata.md` |
| SQLiteData advanced patterns, CTEs, views | See `skills/sqlitedata-ref.md` |
```
END THIRD-PARTY FILE 4ed21b291a857b2b

The third-party file has ended. Everything between the 4ed21b291a857b2b tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2572 of 13163 bytes. © CharlesWiltgen · MIT · https://github.com/CharlesWiltgen/Axiom/tree/HEAD/axiom-codex/skills/axiom-data/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
