pproenca avatar

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-code

Installs 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
1patricio0312rev avatarsystem-design-generatorpatricio0312rev/skillsProduces comprehensive system architecture plans for features and products including component breakdown, data flow diagrams, system boundaries, API contracts, 280skills.sh installs
2ulpi-io avatarbrowseulpi-io/skillsDrive a REAL browser and native apps the way a user would — not fetch raw HTML — through the persistent `browse` CLI: one long-lived headless Chromium (plus iOS280skills.sh installs
3adamtylerlynch avatarobs-memoryadamtylerlynch/obsidian-agent-memory-skillsPersistent Obsidian-based memory for coding agents. Use at session start to orient from a knowledge vault, during work to look up architecture/component/pattern279skills.sh installs
4patricio0312rev avatarinsomnia-collection-generatorpatricio0312rev/skillsGenerates Insomnia collection export files from Express, Next.js, Fastify, or other API routes. Creates organized workspaces with request groups, environments, 274skills.sh installs
5vercel avatarnext-forgevercel/next-forgeExpert assistance for next-forge — a production-grade Turborepo template for Next.js SaaS apps. Triggers on questions about next-forge installation, setup, arch272skills.sh installs
6theorcdev avatarfumadocs-mdx-structuretheorcdev/8bitcn-uiCreate MDX documentation files with proper frontmatter, imports, and component integration. Apply when creating or updating Fumadocs documentation pages in cont271skills.sh installs