guide-swiftdata

guide-swiftdata is a skill for Claude Code, Codex from Prisma-Labs-Dev/apple-skills. It costs 38 tokens per session (476 once invoked), scanned A, original, MIT.

A pattern guide for SwiftData, Apple's framework for storing and querying app data. It covers autosave, relationships, predicates, CloudKit limits, indexing, and model inheritance.

In plain words
What is it for?
Use it when writing, reviewing, or debugging SwiftData models, predicates, autosave behavior, CloudKit-backed storage, indexes, or inherited model classes.
Why use it?
It helps avoid unsupported queries, broken relationships, synchronization problems, and data-model choices that cause issues at runtime.

Skill for Claude CodeCodex

Part of the apple-skills plugin — 36 skills shipped together

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.

agentmods
npx agentmods add skills/prisma-labs-dev/apple-skills/guide-swiftdata
Any agent
npx skills add Prisma-Labs-Dev/apple-skills --skill guide-swiftdata
Clone the repo
git clone --depth 1 https://github.com/Prisma-Labs-Dev/apple-skills

Made for: Claude Code, Codex.

Or install apple-skills, the plugin that ships this one along with the rest of its 36 skills.

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 guide-swiftdata

README.md
[![agentmods](https://agentmods.dev/badge/skills/prisma-labs-dev/apple-skills/guide-swiftdata.svg)](https://agentmods.dev/skills/prisma-labs-dev/apple-skills/guide-swiftdata)
Your own site
<a href="https://agentmods.dev/skills/prisma-labs-dev/apple-skills/guide-swiftdata"><img src="https://agentmods.dev/badge/skills/prisma-labs-dev/apple-skills/guide-swiftdata.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 476 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00038 $0.00476
Opus 5 $0.00019 $0.00238
Sonnet 5 $0.00008 $0.00095
Haiku 4.5 $0.00004 $0.00048

Measured 5d ago against content hash 517426661483, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

guide-swiftdata scanned grade A with 0 findings 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 5d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/guide-swiftdata/SKILL.md · 41 lines

What it actually says

Guide Skill — This is an expert workflow/pattern guide, not API reference documentation. Originally from twostraws/SwiftData-Agent-Skill by Paul Hudson. MIT License.

SwiftData Patterns

Write and review SwiftData code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems — do not nitpick or invent issues.

Core Instructions

  • Target Swift 6.2 or later, using modern Swift concurrency.
  • Prefer SwiftData across the board. Do not suggest Core Data unless the feature cannot be solved with SwiftData.
  • Do not introduce third-party frameworks without asking first.

Review Process

  1. Check for core SwiftData issues using references/core-rules.md.
  2. Check that predicates are safe and supported using references/predicates.md.
  3. If the project uses CloudKit, check for CloudKit-specific constraints using references/cloudkit.md.
  4. If the project targets iOS 18+, check for indexing opportunities using references/indexing.md.
  5. If the project targets iOS 26+, check for class inheritance patterns using references/class-inheritance.md.

If doing partial work, load only the relevant reference files.

References

Topic Reference
Autosave, relationships, delete rules, @Query restrictions, #Unique, @Transient references/core-rules.md
Supported predicates, dangerous patterns that crash at runtime, unsupported methods references/predicates.md
CloudKit constraints: no #Unique, optional requirements, eventual consistency references/cloudkit.md
Database indexing (iOS 18+), single and compound property indexes references/indexing.md
Model subclassing (iOS 26+), @available requirements, predicate filtering references/class-inheritance.md
Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 41 lines · 38 tokens per session scan A 517426661483

Subscribe to this mod's changes

guide-swiftdata is a skill published in the GitHub repository Prisma-Labs-Dev/apple-skills (323 stars, last pushed 25d ago), licensed MIT. It adds 38 tokens to every session and 476 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kotlin-exposed-patterns

JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

hashgraph-online/awesome-codex-plugins · 36 tokens

apply-upstream-migration

Apply a new upstream Actual migration to Aktual — update MigrateDatabase.kt, SQLDelight .sq files, Adapters, model types, and the migration test. Triggered when last-known-migration.txt is updated.

jonapoul/aktual · 50 tokens

bmob-database-swift

Use when implementing Bmob NoSQL database CRUD with the pure Swift BmobSwiftSDK for iOS 15+ / macOS 12+ using Swift Package Manager or CocoaPods, import BmobSDK, async/await, Bmob.initialize(appKey:), BmobObject, BmobQuery, BmobUser, BmobFile, BmobPointer, BmobRelation, BmobGeoPoint, BmobACL, CloudFunction. NOT for…

bmob/agent-skills · 190 tokens

postgres-nio

Expert guidance on using PostgreSQL with Swift. Use when developers mention: (1) PostgreSQL or Postgres in Swift, (2) postgres-nio library, (3) SQL queries in Swift, (4) PostgreSQL connection pooling, (5) prepared statements, (6) type-safe database access, (7) bulk loading or COPY FROM, (8) PostgresClient or…

wendylabsinc/claude-skills · 87 tokens

swift-valkey

Expert guidance on using Valkey and Redis with Swift. Use when developers mention: (1) Valkey or Redis in Swift, (2) valkey-swift library, (3) RESP protocol or RESP3, (4) Redis cluster routing or hash slots, (5) pub/sub or subscriptions, (6) Redis transactions or MULTI/EXEC, (7) caching with Redis.

wendylabsinc/claude-skills · 84 tokens

kotlin-backend-jpa-entity-mapping

Model Kotlin persistence code correctly for Spring Data JPA and Hibernate. Covers entity design, identity and equality, uniqueness constraints, relationships, fetch plans, and common ORM (Object-Relational Mapping) traps specific to Kotlin. Use when creating or reviewing JPA (Java Persistence API) entities, diagnosing…

JetBrains/skills · 104 tokens