This enforces the clinic modular MVVM-C architecture for SwiftData on iOS 26 and Swift 6.2, keeping all SwiftData types locked inside the Data layer while feature modules work with domain structs and repository protocols. It covers the full workflow from @Model entity design through stale-while-revalidate reads, optimistic queued writes, sync coordinators with retry policies, and routing persistence errors through centralized AppError infrastructure. Use it when you need architectural guardrails that prevent SwiftData from leaking into ViewModels or when you're wiring up background sync with conflict resolution. The troubleshooting section alone is worth having open during any data layer refactor.

skills.sh installs
268
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add pproenca/dot-skills --skill swift-data --agent claude-code

Installs into .claude/skills of the current project.

Files

SwiftData Best Practices — Modular MVVM-C Data Layer

Comprehensive data modeling, persistence, sync architecture, and error handling guide for SwiftData aligned with the clinic modular MVVM-C stack.

Architecture Alignment

This skill enforces the same modular architecture mandated by swift-ui-architect:

┌───────────────────────────────────────────────────────────────┐
│ Feature modules: View + ViewModel, no SwiftData imports       │
├───────────────────────────────────────────────────────────────┤
│ Domain: models + repository/coordinator/error protocols        │
├───────────────────────────────────────────────────────────────┤
│ Data: @Model entities, SwiftData stores, repository impls,     │
│ remote clients, retry executor, sync queue, conflict handling  │
└───────────────────────────────────────────────────────────────┘

Key principle: SwiftData types (@Model, ModelContext, @Query, FetchDescriptor) live in Data-only implementation code. Feature Views/ViewModels work with Domain types and protocol dependencies.

Clinic Architecture Contract (iOS 26 / Swift 6.2)

All guidance in this skill assumes the clinic modular MVVM-C architecture:

Sponsors

Details

Repository
github.com/pproenca/dot-skills
Categories
Documentation, Code Review & Quality, Mobile Development
First seen
Jun 3, 2026

More from pproenca/dot-skills

All 100
1openai avatartest-coverage-improveropenai/openai-agents-pythonImprove test coverage in the OpenAI Agents Python repository: run `make coverage`, inspect coverage artifacts, identify low-coverage files, propose high-impact 266skills.sh installs
2huggingface avatarhugging-face-evaluationhuggingface/skillsAdd and manage evaluation results in Hugging Face model cards. Supports extracting eval tables from README content, importing scores from Artificial Analysis AP265skills.sh installs
3ovachiever avatarnextjs-shadcn-builderovachiever/droid-tingsBuild new Next.js applications or migrate existing frontends (React, Vue, Angular, vanilla JS, etc.) to Next.js + shadcn/ui with systematic analysis and convers263skills.sh installs
4pedronauck avatarqmdpedronauck/skillsSearch markdown knowledge bases, notes, and documentation using QMD. Use when users ask to search notes, find documents, or look up information.263skills.sh installs
5ai-dashboad avatare2e-testingai-dashboad/flutter-skillAI-powered E2E testing for any app — Flutter, React Native, iOS, Android, Electron, Tauri, KMP, .NET MAUI. Connects via MCP to running apps so the agent can tak262skills.sh installs
6ncklrs avatarproduct-leaderncklrs/startup-os-skillsStrategic product leadership guidance for SaaS and technology companies. Covers product strategy, roadmap planning, product discovery, user research, growth pro262skills.sh installs