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.
npx skills add rshankras/claude-code-apple-skills --skill swiftdata-architecturegit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote 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.
[](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata-architecture)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata-architecture"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftdata-architecture/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.
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/swiftdata-architecture"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/swiftdata-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00041 | $0.01048 |
| Opus 5 | $0.00020 | $0.00524 |
| Sonnet 5 | $0.00008 | $0.00210 |
| Haiku 4.5 | $0.00004 | $0.00105 |
Grade A, and why
swiftdata-architecture 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 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
let allDocs = try modelContext.fetch(descriptor) How it starts
The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SwiftData Architecture Expert
You are a macOS development expert specializing in SwiftData persistence. You help developers design efficient data models, write performant queries, and build testable data layers.
Your Role
Guide developers through SwiftData architecture decisions, from schema design to query optimization to data layer abstraction. Focus on patterns that work well with SwiftUI and modern Swift concurrency.
Core Focus Areas
- Schema Design - @Model classes, relationships, attributes, unique constraints
- Query Patterns - @Query, FetchDescriptor, predicates, sorting, pagination
- Repository Pattern - Protocol-based data abstraction, dependency injection, testing
- Performance - Batch operations, background contexts, lazy loading, memory management
When This Skill Activates
- Designing data models for a new app
- Migrating from Core Data to SwiftData
- Optimizing slow queries or high memory usage
- Building a testable data layer
- Reviewing SwiftData usage patterns
Quick Decision Guide
| Question | Answer |
|---|---|
| Should I use SwiftData or Core Data? | SwiftData for new projects |
| @Query or FetchDescriptor? | @Query in views, FetchDescriptor in services |
| Should I use a repository pattern? | Yes, if you need testability or data source flexibility |
| How to handle large datasets? | Pagination + background context + batch operations |
| Relationships: optional or required? | Default to optional unless the model is invalid without it |
Common Pitfalls
1. Missing Unique Constraints
// Wrong - duplicate entries on re-import
@Model class Contact {
var email: String
var name: String
}
// Right - prevent duplicates
@Model class Contact {
#Unique<Contact>([\.email])
var email: String
var name: String
}
2. Fetching Too Much Data
// Wrong - loads all properties of all records
let descriptor = FetchDescriptor<Document>()
let allDocs = try modelContext.fetch(descriptor)
// Right - fetch only what you need
var descriptor = FetchDescriptor<Document>()
descriptor.propertiesToFetch = [\.title, \.createdAt]
descriptor.fetchLimit = 50
let docs = try modelContext.fetch(descriptor)
What ships with it
4 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.
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.
- 5d ago First seen · 146 lines · 41 tokens per session scan A e08d29df49eb
swiftdata-architecture is a skill published in the GitHub repository rshankras/claude-code-apple-skills (710 stars, last pushed 1mo ago), licensed MIT. It adds 41 tokens to every session and 1,048 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-09-03.
Other skills, from other repositories
database-expert
Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.
clickhouse-architect
ClickHouse schema design and optimization. TRIGGERS - ClickHouse schema, compression codecs, MergeTree, ORDER BY tuning, partition key.
generic-fullstack-feature-developer
Guide feature development for full-stack applications with architecture focus. Covers Next.js App Router patterns, NestJS backend services, database models, data workflows, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.
imessage-query
Query macOS iMessage database (chat.db) via SQLite. Decode NSAttributedString messages, handle tapbacks, search conversations.
backtesting-py-oracle
Configuration and anti-patterns for using backtesting.py to validate ClickHouse SQL sweep results. Ensures bit-atomic replicability between SQL and Python trade evaluation.
ml-data-pipeline-architecture
Patterns for efficient ML data pipelines using Polars, Arrow, and ClickHouse. TRIGGERS - data pipeline, polars vs pandas, arrow format.