Skip to content
pproenca avatar

Swift Refactor

Swift and SwiftUI refactoring guide for migrating code into a modular MVVM-C clinic architecture with SPM boundaries.

CCM score
44 of 100
skills.sh installs
293
GitHub stars
228
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers migrating legacy SwiftUI to @Observable ViewModels, coordinators, and App-target route shells on iOS 26 / Swift 6.2
  • Includes 12 prioritized rule categories with per-rule reference files for diffing, API modernization, state, navigation, layers, and concurrency
  • Enforces the Domain/Data/Feature/App dependency rule, with features never importing Data or sibling features
  • Designed for teams refactoring existing SwiftUI code into the Airbnb and OLX-style SPM layout

Install

$ npx -y skills add pproenca/dot-skills --skill swift-refactor -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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:

Details

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

Questions

What does the swift-refactor skill do?

swift-refactor guides refactoring existing Swift and SwiftUI code into the clinic modular MVVM-C architecture for iOS 26 and Swift 6.2. It enforces @Observable ViewModels and coordinators, App-target DependencyContainer and route shells, and Domain protocols with Data-owned I/O.

How do I install swift-refactor?

Run npx -y skills add pproenca/dot-skills --skill swift-refactor -y in your project. Once installed, swift-refactor lets your agent migrate SwiftUI code away from ObservableObject and NavigationView toward @Observable and NavigationStack.

Which other skills are in the same category as swift-refactor?

swift-refactor is listed in the Mobile Apps category with vercel-react-native-skills, animate-expo, write-swift, firebase-crashlytics and xcode-project-setup. Its focus is restructuring existing SwiftUI code into modular MVVM-C with local SPM package boundaries.

More from pproenca/dot-skills

All 100

Similar to Swift Refactor

More Mobile Apps