
Swift Refactor
A comprehensive refactoring guide for migrating Swift/SwiftUI projects to a modular MVVM-C architecture with local SPM packages. You'd reach for this when modernizing from ObservableObject to @Observable, replacing NavigationView with NavigationStack, or restructuring an app into Feature/Domain/Data boundaries where the app target owns dependency injection and coordination. It enforces practical rules like @Equatable on every view for diffing, stable identifiers in ForEach, and the dependency rule that feature modules never import Data or sibling features. The 50+ rules are prioritized by impact and organized into categories like view diffing, API modernization, and state architecture. Opinionated but well structured for teams committed to this specific architecture pattern.
- skills.sh installs
- 281
- GitHub stars
- 222
- last updated
- Aug 21, 2026
Install
$ npx -y skills add pproenca/dot-skills --skill swift-refactor --agent claude-codeInstalls into .claude/skills of the current project.
Files
Swift/SwiftUI Refactor (Modular MVVM-C)
Comprehensive refactoring guide for migrating Swift/SwiftUI code to modular MVVM-C with local SPM package boundaries and App-target composition root wiring.
Mandated Architecture Stack
┌───────────────────────────────────────────────────────────────┐
│ App target: DependencyContainer, Coordinators, Route Shells │
├───────────────────────────────────────────────────────────────┤
│ Feature modules: View + ViewModel (Domain + DesignSystem deps)│
├───────────────────────────────────────────────────────────────┤
│ Data package: repositories, remote/local stores, sync, retry │
├───────────────────────────────────────────────────────────────┤
│ Domain package: models, repository/coordinator/error protocols │
└───────────────────────────────────────────────────────────────┘
Dependency Rule: Feature modules never import Data and never import sibling features.
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
- Frontend Development, Code Review & Quality, Debugging, Mobile Development
- First seen
- Jun 3, 2026
More from pproenca/dot-skills
All 100- Dev Rfc279
- Swift Ui Architect273
- Ios Taste272
- Ios Storyboard270
- Rails Design System270
- Swift Data268
- 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