
Swift Data
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-codeInstalls 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- Ios Chaos Monkey267
- Ios Navigation267
- Nginx C Module Perf260
- React Native Elements258
- Effect Ts257
- Bug Review256
- Nginx C Module Debug253
- Rails Application Ui Blocks251
- Rust Write Tests248
- Rust Implement246
- Domain Architect242
- Graph Schema233
- Exec Plan232
- Framer Motion Best Practices187
- Rust124
- Zod7.2K
- Vitest7.2K
- React Hook Form3.1K
- Emilkowal Animations2.8K
- Nuqs2.4K
- Clean Architecture2K
- Typescript1.8K
- Code Simplifier1.6K
- Expo React Native Performance1.5K