swiftdata-workflow

swiftdata-workflow is a skill for Claude Code, Codex from gaelic-ghost/socket. It costs 74 tokens per session (758 once invoked), scanned A, original, Apache-2.0.

A guide to using SwiftData, Apple’s system for storing app data in models and local databases. It covers schemas, containers, queries, relationships, migrations, concurrency, previews, and tests.

In plain words
What is it for?
Use it to design SwiftData models, manage storage contexts, query and update records, migrate existing data, and prepare preview or test stores.
Why use it?
It helps keep stored data separate from ordinary app values and reduces mistakes when data changes, is shared across views, or is used concurrently.

Skill for Claude CodeCodex

Part of the apple-dev-skills plugin — 65 skills, 2 MCP servers 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/gaelic-ghost/socket/swiftdata-workflow
Any agent
npx skills add gaelic-ghost/socket --skill swiftdata-workflow
Clone the repo
git clone --depth 1 https://github.com/gaelic-ghost/socket

Made for: Claude Code, Codex.

Or install apple-dev-skills, the plugin that ships this one along with the rest of its 65 skills, 2 MCP servers.

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-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/gaelic-ghost/socket/swiftdata-workflow.svg)](https://agentmods.dev/skills/gaelic-ghost/socket/swiftdata-workflow)
Your own site
<a href="https://agentmods.dev/skills/gaelic-ghost/socket/swiftdata-workflow"><img src="https://agentmods.dev/badge/skills/gaelic-ghost/socket/swiftdata-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 758 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.00074 $0.00758
Opus 5 $0.00037 $0.00379
Sonnet 5 $0.00015 $0.00152
Haiku 4.5 $0.00007 $0.00076

Measured yesterday against content hash 0da36fcfc5ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

swiftdata-workflow 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 yesterday.

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.

plugins/apple-dev-skills/skills/swiftdata-workflow/SKILL.md · 60 lines

How it starts

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

SwiftData Workflow

Purpose

Own SwiftData persistence decisions without spreading SwiftData policy across unrelated Apple skills. Start from current Apple documentation, keep persistence types distinct from runtime/domain values, and hand view composition or general source-tree work to their focused owners.

When To Use

Use for SwiftData schemas, containers, contexts, queries, relationships, migrations, previews, tests, concurrency, and SwiftUI persistence integration.

Single-Path Workflow

  1. Read the relevant Apple SwiftData documentation through explore-apple-swift-docs before proposing implementation.
  2. Classify the task as schema design, container/context ownership, query and mutation, relationship behavior, migration, testing/previews, or external-boundary conversion.
  3. Read the matching reference:
    • references/models-containers-and-contexts.md
    • references/swiftui-integration.md
    • references/migrations-testing-and-boundaries.md
  4. Use the project's explicit three-letter prefix. Name runtime/domain values GEAWhatever.swift, SwiftData @Model persistence types GEAWhateverModel.swift, and additional Record or DTO representations only when a real boundary requires them.
  5. Keep SwiftData directly integrated with SwiftUI through modelContainer, environment modelContext, @Query, model objects, and narrow bindings. Do not insert repositories, stores, service mirrors, DTO mirrors, or view-model caches between SwiftData and SwiftUI.
  6. Add a separate direct concrete service only for a non-SwiftUI concern such as networking, import/export, migration tooling, server sync, or isolated tests. That service owns its real boundary directly; it does not become a repository, persistence mirror, or wrapper between SwiftData and SwiftUI.
  7. Hand view ownership and view-model composition to swiftui-app-architecture-workflow, filename and directory cleanup to structure-swift-sources, execution to xcode-build-run-workflow, and tests to xcode-testing-workflow.

Read the full file on GitHub · 60 lines

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. yesterday First seen · 60 lines · 74 tokens per session scan A 0da36fcfc5ac

Subscribe to this mod's changes

swiftdata-workflow is a skill published in the GitHub repository gaelic-ghost/socket (7 stars, last pushed 9d ago), licensed Apache-2.0. It adds 74 tokens to every session and 758 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

setup-datamodel

Use when the user wants to design or redesign the Dataverse schema and connector plan for an existing mobile app, or has an ER diagram (image, Mermaid, or text) to apply. Skip when the user is creating a brand-new app — /create-mobile-app handles the data model inline.

microsoft/power-platform-skills · 64 tokens

data-modeling

Designs the warehouse and semantic layer — source-to-mart structure, dimensional modeling, grain, slowly changing dimensions, and the metric layer analytics reads through. Use this to design or restructure a warehouse, model a new source, decide on grain or table structure, build a semantic or metric layer, or…

cbrock84/headcount · 77 tokens

app-store-optimization

Improves visibility and conversion in the App Store and Google Play — metadata, keywords, screenshots, ratings, and the listing experience that turns an impression into an install. Use this to audit or optimize an app listing, plan a launch listing, diagnose poor install conversion, or improve store search visibility.

cbrock84/headcount · 64 tokens

domain-modeling

Unified domain and data modeling for business entities, invariants, schema design, aggregate boundaries, and evolution strategy. Use when designing business models, schema changes, bounded contexts, or consistency rules.

rsmdt/the-startup · 42 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

flutter-ui

Build Flutter UI from Figma MCP or image input. Scans src for design tokens (colors, sizes, text styles), existing components, and naming conventions before writing a single line of code. Never hard-codes values.

datit309/supergraph · 48 tokens