guide-swiftdata

guide-swiftdata is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it when writing, reviewing, or debugging SwiftData models, predicates, autosave behavior, CloudKit-backed storage, indexes, or inherited model classes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/prisma-labs-dev/apple-skills/guide-swiftdata
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 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.

Or install apple-skills, the plugin that ships this one along with the rest of its 34 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/github.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/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 guide-swiftdata

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 20
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
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.00038 $0.00476
Opus 5.5 $0.00015 $0.00190
Sonnet 5.5 $0.00008 $0.00095
Haiku 4.5 $0.00004 $0.00048

Measured 1mo ago against content hash 517426661483, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (347 stars, last pushed 26d ago), licensed MIT. It adds 38 tokens to every session and 476 once invoked, about $0.0002 per session on Opus 5.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

cratis-arc-spring-data-kotlin

Use Spring Data JPA or MongoDB with Kotlin or Java Arc read models — repository-backed queries and paging, command current-state resolution, observable snapshots, concept converters, certified tenant storage and explicit transaction opt-ins. Use when wiring JVM Arc persistence or database-backed observations. Do not…

Cratis/AI · 86 tokens

jpa-spring-data-kotlin-mapper

Model Kotlin persistence code correctly for Spring Data JPA and Hibernate, including entity design, relationships, fetch plans, repository queries, lazy loading, and common performance traps. Use when creating or reviewing entities and repositories, diagnosing N+1 or LazyInitializationException, placing indexes and…

JetBrains/skills · 91 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

bmob-database-swift

Use when implementing Bmob NoSQL database CRUD or realtime data listening 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…

bmob/agent-skills · 212 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