swiftdata-pro

swiftdata-pro is a skill for Claude Code, Codex from twostraws/SwiftData-Agent-Skill. It costs 34 tokens per session (819 once invoked), scanned A, original, MIT.

A SwiftData coding guide reviews and improves SwiftData code, Apple's framework for storing app data in Swift. It checks general usage, queries, CloudKit constraints, and some version-specific practices.

In plain words
What is it for?
Writing or reviewing SwiftData models, predicates, CloudKit-backed storage, indexes, and newer SwiftData patterns.
Why use it?
It catches genuine correctness and compatibility problems while following modern Swift and project conventions.

Skill for Claude CodeCodex

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/twostraws/swiftdata-agent-skill/swiftdata-pro
Any agent
npx skills add twostraws/SwiftData-Agent-Skill --skill swiftdata-pro
Clone the repo
git clone --depth 1 https://github.com/twostraws/SwiftData-Agent-Skill

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/twostraws/swiftdata-agent-skill/swiftdata-pro.svg)](https://agentmods.dev/skills/twostraws/swiftdata-agent-skill/swiftdata-pro)
Your own site
<a href="https://agentmods.dev/skills/twostraws/swiftdata-agent-skill/swiftdata-pro"><img src="https://agentmods.dev/badge/skills/twostraws/swiftdata-agent-skill/swiftdata-pro.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 819 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00034 $0.00819
Opus 5 $0.00017 $0.00409
Sonnet 5 $0.00007 $0.00164
Haiku 4.5 $0.00003 $0.00082

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

Security

Grade A, and why

swiftdata-pro 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 4d 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.

try modelContext.fetch(FetchDescriptor<Destination>())
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

swiftdata-pro/SKILL.md · 103 lines

How it starts

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

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.

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.

Core Instructions

  • Target Swift 6.2 or later, using modern Swift concurrency.
  • The user strongly prefers to use SwiftData across the board. Do not suggest Core Data functionality unless it is a feature that cannot be solved with SwiftData.
  • Do not introduce third-party frameworks without asking first.
  • Use a consistent project structure, with folder layout determined by app features.

Output Format

If the user asks for a review, organize findings by file. For each issue:

  1. State the file and relevant line(s).
  2. Name the rule being violated.
  3. Show a brief before/after code fix.

Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.

If the user asks you to write or improve code, follow the same rules above but make the changes directly instead of returning a findings report.

Example output:

Destination.swift

Line 8: Add an explicit delete rule for relationships.

// Before
var sights: [Sight]

// After
@Relationship(deleteRule: .cascade, inverse: \Sight.destination) var sights: [Sight]

Line 22: Do not use isEmpty == false in predicates – it crashes at runtime. Use ! instead.

// Before
#Predicate<Destination> { $0.sights.isEmpty == false }

// After
#Predicate<Destination> { !$0.sights.isEmpty }

Read the full file on GitHub · 103 lines

Files

What ships with it

8 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. 4d ago First seen · 103 lines · 34 tokens per session scan A 79164f3bc494

Subscribe to this mod's changes

swiftdata-pro is a skill published in the GitHub repository twostraws/SwiftData-Agent-Skill (402 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 819 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-08-30.

Related

Other skills, from other repositories

android-data-layer

Guidance on implementing the Data Layer using Repository pattern, Room (Local), and Retrofit (Remote) with offline-first synchronization.

new-silvermoon/awesome-android-agent-skills · 29 tokens

boutique-store

Create and use Boutique Store for Swift data persistence, including initialization, @Stored controllers, CRUD operations, operation chaining, and granular event monitoring. Use when persisting arrays of items, building data controllers, or working with Boutique's Store type.

mergesort/Boutique · 52 tokens

boutique-stored-values

Persist individual values with Boutique's @StoredValue (UserDefaults) and @SecurelyStoredValue (Keychain), including set, reset, toggle, bindings, keypath setters, array and dictionary helpers, and async observation. Use when storing preferences, settings, feature flags, or sensitive data like auth tokens.

mergesort/Boutique · 68 tokens

android-development

Android/Kotlin development: Jetpack Compose, Room database, Gradle builds, emulator management, and Play Store submission.

CoWork-OS/CoWork-OS · 27 tokens

datastore

Use when persisting key-value preferences or small typed settings on Android or KMP with Jetpack DataStore — Preferences vs Typed (Proto/JSON) vs Room selection, the IOException and corruption-recovery error traps, serializers with corruption handlers, and the KMP factory with per-platform file paths. Triggers on…

rcosteira79/android-skills · 98 tokens

core-data-expert

Expert Core Data guidance (iOS/macOS): stack setup, fetch requests & NSFetchedResultsController, saving/merge conflicts, threading & Swift Concurrency, batch operations & persistent history, migrations, performance, and NSPersistentCloudKitContainer/CloudKit sync.

AvdLee/Core-Data-Agent-Skill · 58 tokens