Loading...
Loading...
Swift and SwiftUI refactoring patterns aligned with the iOS 26 / Swift 6.2 clinic modular MVVM-C architecture (Airbnb + OLX SPM layout). Enforces @Observable ViewModels/coordinators, App-target `DependencyContainer` + route shells, Domain repository/coordinator/error-routing protocols, and Data-owned I/O with stale-while-revalidate plus optimistic queued sync boundaries. Use when refactoring existing SwiftUI code into the clinic architecture.
npx skill4agent add pproenca/dot-skills swift-refactor┌───────────────────────────────────────────────────────────────┐
│ 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 │
└───────────────────────────────────────────────────────────────┘DataDomainDesignSystemDataDependencyContainerDomain*CoordinatingErrorRoutingAppErrorDataDependencyContainer.task(id:)@ObservableObservableObject@PublishedNavigationStack@EquatableAnyView| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | View Identity & Diffing | CRITICAL | | 4 |
| 2 | API Modernization | CRITICAL | | 7 |
| 3 | State Architecture | CRITICAL | | 6 |
| 4 | View Composition | HIGH | | 7 |
| 5 | Navigation & Coordination | HIGH | | 5 |
| 6 | Layer Architecture | HIGH | | 5 |
| 7 | Architecture Patterns | HIGH | | 5 |
| 8 | Dependency Injection | MEDIUM-HIGH | | 2 |
| 9 | Type Safety & Protocols | MEDIUM-HIGH | | 4 |
| 10 | List & Collection Performance | MEDIUM | | 4 |
| 11 | Async & Data Flow | MEDIUM | | 3 |
| 12 | Swift Language Fundamentals | MEDIUM | | 8 |
diff-equatable-viewsdiff-closure-skipdiff-identity-stabilitydiff-printchanges-debugapi-observable-macroapi-navigationstack-migrationapi-onchange-signatureapi-environment-object-removalapi-alert-confirmation-dialogapi-list-foreach-identifiableapi-toolbar-migrationstate-scope-minimizationstate-derived-over-storedstate-binding-extractionstate-remove-observationstate-onappear-to-taskstate-stateobject-placementview-extract-subviewsview-eliminate-anyviewview-computed-to-structview-modifier-extractionview-conditional-contentview-preference-keysview-body-complexitynav-centralize-destinationsnav-value-based-linksnav-path-state-managementnav-split-view-adoptionnav-sheet-item-patternlayer-dependency-rulelayer-usecase-protocollayer-repository-protocollayer-no-view-repositorylayer-viewmodel-boundaryarch-viewmodel-eliminationarch-protocol-dependenciesarch-environment-key-injectionarch-feature-module-extractionarch-model-view-separationdi-container-compositiondi-mock-testingtype-tagged-identifierstype-result-over-optionalstype-phantom-typestype-force-unwrap-eliminationlist-constant-viewcountlist-filter-in-modellist-lazy-stackslist-id-keypathdata-task-modifierdata-error-loadabledata-cancellationswift-let-vs-varswift-structs-vs-classesswift-camel-case-namingswift-string-interpolationswift-functions-clear-namesswift-for-in-loopsswift-optionalsswift-closures| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |