swiftdata

swiftdata is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 40 tokens per session (287 once invoked), scanned A, original, MIT.

SwiftData modeling guidance covers hierarchical models, type-based queries, polymorphic relationships, and choices between inheritance and enum fields. SwiftData is Apple's framework for storing app data.

In plain words
What is it for?
Use it to plan SwiftData model hierarchies and direct questions about inheritance to the detailed inheritance guidance.
Why use it?
It provides a route to the relevant guidance when designing more advanced SwiftData models instead of treating every modeling question the same way.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the apple-skills plugin — 182 skills shipped together , and of apple-skills

Good fit Use it to plan SwiftData model hierarchies and direct questions about inheritance to the detailed inheritance guidance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/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 rshankras/claude-code-apple-skills --skill swiftdata
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftdata/github.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/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 swiftdata

Your own site · 80×15
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftdata.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 287 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.
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.00040 $0.00287
Opus 5.5 $0.00016 $0.00115
Sonnet 5.5 $0.00008 $0.00057
Haiku 4.5 $0.00004 $0.00029

Measured 1mo ago against content hash 249ed19f40cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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/swiftdata/SKILL.md · 33 lines

What it actually says

SwiftData Skills

SwiftData modeling patterns beyond the basics.

When This Skill Activates

Use this skill when the user:

  • Designs hierarchical SwiftData models (class inheritance)
  • Needs type-based or polymorphic queries
  • Weighs inheritance vs enum for model variants

Available Skills

Paths are relative to THIS file's directory — skills run with cwd set to the user's project, so resolve each path from this SKILL.md's own location.

Skill Read Covers
inheritance inheritance/SKILL.md Class inheritance, polymorphic relationships, type-based querying, inheritance-vs-enum

How to Route

  1. Read inheritance/SKILL.md (relative to this file) plus any reference files it lists.
  2. Apply the guidance to the user's code. For broader macOS SwiftData architecture, see also ../macos/swiftdata-architecture/SKILL.md.
Files

What ships with it

1 file 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 · 33 lines · 40 tokens per session scan A 249ed19f40cb

Subscribe to this mod's changes

swiftdata is a skill published in the GitHub repository rshankras/claude-code-apple-skills (927 stars, last pushed 26d ago), licensed MIT. It adds 40 tokens to every session and 287 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-11-05.

Related

swiftdata compared with skills from other repositories

swiftdata next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
swiftdatarshankras/claude-code-apple-skillsSkill92726d agoMITA40Claude Code
migration-patternssoftspark/ai-toolkitSkill1802d agoApache-2.0A41Claude Code
1c-db-listDesko77/claude-code-skills-1cSkill103yesterdayMITA47Claude Code
flux-schematonone-ai/tononeSkill85todayMITA55Claude Code
flux-recontonone-ai/tononeSkill85todayMITA48Claude Code
spring-sessionclaude-dev-suite/claude-dev-suiteSkill514d agoMITA90Claude Code
spring-data-jpaclaude-dev-suite/claude-dev-suiteSkill514d agoMITA128Claude Code