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 laxrajpurohit/swift-skills-pro --skill swiftdata-progit clone --depth 1 https://github.com/laxrajpurohit/swift-skills-proWrote 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/laxrajpurohit/swift-skills-pro/swiftdata-pro)<a href="https://agentmods.dev/skills/laxrajpurohit/swift-skills-pro/swiftdata-pro"><img src="https://agentmods.dev/badge/skills/laxrajpurohit/swift-skills-pro/swiftdata-pro/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/laxrajpurohit/swift-skills-pro/swiftdata-pro"><img src="https://agentmods.dev/badge/skills/laxrajpurohit/swift-skills-pro/swiftdata-pro.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00036 | $0.00906 |
| Opus 5 | $0.00018 | $0.00453 |
| Sonnet 5 | $0.00007 | $0.00181 |
| Haiku 4.5 | $0.00004 | $0.00091 |
Grade A, and why
swiftdata-pro 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SwiftData Pro
Model, query, and persist data with SwiftData correctly and efficiently.
When to use
- Defining
@Modeltypes and relationships. - Writing
@Query/ fetching in views. - Setting up
ModelContainer, migrations, or CloudKit sync.
Trigger: /swiftdata-pro.
Core principles
@Modelclasses are reference types managed by aModelContext.- Inject the container at the app root with
.modelContainer(for:). - Read in views with
@Query; write through themodelContext. - Keep the main-actor context for UI; use a background
ModelContextfor bulk work.
Modeling
@Model
final class Trip {
var name: String
var startDate: Date
@Relationship(deleteRule: .cascade) var stops: [Stop] = []
init(name: String, startDate: Date) {
self.name = name
self.startDate = startDate
}
}
- Set an explicit
deleteRuleon relationships — don't rely on defaults for ownership. - Use
@Attribute(.unique)for natural keys. - Mark large blobs
@Attribute(.externalStorage).
❌ No delete rule on an owning relationship
var stops: [Stop] = [] // orphans Stop rows when a Trip is deleted
✅
@Relationship(deleteRule: .cascade) var stops: [Stop] = []
Container setup
@main
struct TripsApp: App {
var body: some Scene {
WindowGroup { ContentView() }
.modelContainer(for: Trip.self)
}
}
Querying
Use @Query with sort/filter in the view; don't fetch-all then filter in Swift.
❌
@Query private var trips: [Trip]
var upcoming: [Trip] { trips.filter { $0.startDate > .now } } // loads everything
✅
@Query(filter: #Predicate<Trip> { $0.startDate > Date.now },
sort: \Trip.startDate)
private var upcoming: [Trip]
Writing
@Environment(\.modelContext) private var context
func add(_ trip: Trip) {
context.insert(trip)
// SwiftData autosaves; call try? context.save() only when you need it now.
}
Delete with context.delete(trip).
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.
- 11d ago First seen · 140 lines · 36 tokens per session scan A e066c87dc2fb
swiftdata-pro is a skill published in the GitHub repository laxrajpurohit/swift-skills-pro (5 stars, last pushed 3mo ago), licensed MIT. It adds 36 tokens to every session and 906 once invoked, about $0.0002 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-08-31.
Other skills, from other repositories
persistence-setup
Generates SwiftData or CoreData persistence layer with optional iCloud sync. Use when user wants to add local storage, data persistence, or cloud sync.
swift-actor-persistence
Thread-safe data persistence in Swift using actors — in-memory cache with file-backed storage, eliminating data races by design.
implementation-guide
Generates detailed implementation guide with pseudo-code and step-by-step development instructions. Creates IMPLEMENTATIONGUIDE.md from PRD, Architecture, and UX specs. Use when creating development roadmap.
architecture-spec
Generates technical architecture specification from PRD. Covers architecture pattern, tech stack, data models, and app structure. Use when creating ARCHITECTURE.md or designing system architecture.
foundation-models
On-device LLM integration using Apple's Foundation Models framework. Use when implementing AI text generation, structured output, or tool calling.
liquid-glass
Implement Liquid Glass design using .glassEffect() API for iOS/macOS 26+. Covers SwiftUI, AppKit, UIKit, and WidgetKit. Use when creating modern glass-based UI effects.