swift-refactor
swift-refactor helps developers modernize SwiftUI applications by transforming existing code into clean, modular MVVM-C patterns. It leverages Swift's @Observable macro and SPM package boundaries to create maintainable, scalable architectures that separate concerns and improve testability.
swift-refactor guides you through replacing deprecated ObservableObject patterns with Swift's @Observable macro. This modernization reduces boilerplate, improves performance through automatic view diffing, and aligns with current SwiftUI best practices. The skill helps you migrate state management to cleaner, more efficient implementations that work seamlessly with Swift 6.2 and later.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-07-24
swift-refactor guides you through replacing deprecated ObservableObject patterns with Swift's @Observable macro. This modernization reduces boilerplate, improves performance through automatic view diffing, and aligns with current SwiftUI best practices. The skill helps you migrate state management to cleaner, more efficient implementations that work seamlessly with Swift 6.2 and later.
Use it when
- swift-refactor helps you refactor existing SwiftUI code into modular MVVM-C patterns using SPM package boundaries.
- Yes.
Verify before relying
Read SKILL.md below before installing (60 files). Open directory: indexed for reading, not audited.
Install
pproenca/dot-skills/swift-refactor · repository language: Shell
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What modernization does swift-refactor apply to SwiftUI observable viewmodels?
swift-refactor guides you through replacing deprecated ObservableObject patterns with Swift's @Observable macro. This modernization reduces boilerplate, improves performance through automatic view diffing, and aligns with current SwiftUI best practices. The skill helps you migrate state management to cleaner, more efficient implementations that work seamlessly with Swift 6.2 and later.
How does swift-refactor structure code into modular MVVM-C architecture?
swift-refactor helps you refactor existing SwiftUI code into modular MVVM-C patterns using SPM package boundaries. It establishes clean architecture layers—Domain, Data, Feature, and App—with protocol-driven design. This separation enables independent feature development, easier testing, and scalable codebase organization across multiple Swift Package Manager modules.
Can swift-refactor help migrate from NavigationView to NavigationStack?
Yes. swift-refactor addresses the migration from deprecated NavigationView to modern NavigationStack. It shows how to implement coordinator-based navigation patterns and dependency injection alongside the new navigation APIs. This modernization improves navigation predictability and integrates cleanly with MVVM-C architectures.
What SwiftUI performance optimizations does swift-refactor cover?
swift-refactor improves SwiftUI performance through view diffing, composition extraction, and list optimization techniques. It teaches you to identify expensive view recomputations, break monolithic views into smaller components, and optimize collection rendering. These patterns reduce unnecessary updates and improve app responsiveness.
How does swift-refactor implement dependency injection in SwiftUI?
swift-refactor demonstrates dependency injection container patterns and coordinator-based navigation that work with modern SwiftUI. It shows how to inject dependencies at the feature and app layers, enabling testable, loosely-coupled components. This approach pairs naturally with SPM boundaries and protocol-driven design for maximum flexibility.
What license covers swift-refactor?
swift-refactor is released under the MIT license, allowing free use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
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
(truncated - see the full file via the links below)
File tree — 15 files
skills/.experimental/swift-refactor/SKILL.md
skills/.experimental/swift-refactor/metadata.json
skills/.experimental/swift-refactor/references/_sections.md
skills/.experimental/swift-refactor/references/api-alert-confirmation-dialog.md
skills/.experimental/swift-refactor/references/api-environment-object-removal.md
skills/.experimental/swift-refactor/references/api-list-foreach-identifiable.md
skills/.experimental/swift-refactor/references/api-navigationstack-migration.md
skills/.experimental/swift-refactor/references/api-observable-macro.md
skills/.experimental/swift-refactor/references/api-onchange-signature.md
skills/.experimental/swift-refactor/references/api-toolbar-migration.md
skills/.experimental/swift-refactor/references/arch-environment-key-injection.md
skills/.experimental/swift-refactor/references/arch-feature-module-extraction.md
skills/.experimental/swift-refactor/references/arch-model-view-separation.md
skills/.experimental/swift-refactor/references/arch-protocol-dependencies.md
skills/.experimental/swift-refactor/references/arch-viewmodel-elimination.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Refactor existing SwiftUI code to modular MVVM-C with @Observable and SPM boundaries”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
swift-ui-architect equips AI agents with the expertise to design and implement robust SwiftUI applications using proven architectural patterns. The skill enforces separation of concerns through MVVM-C layering, Swift Package Manager organization, and coordinator-based navigation, enabling agents to generate production-ready iOS codebases that scale with team complexity.
This skill equips AI agents with the knowledge to architect scalable data persistence solutions in Swift using SwiftData's modern ORM capabilities. It covers entity modeling, repository patterns, and clean architecture principles tailored for MVVM-C workflows. Developers gain practical guidance on structuring data layers that remain maintainable as iOS projects grow in complexity.
This skill equips developers with Apple's Human Interface Guidelines, providing essential design principles and patterns for building polished SwiftUI applications. Access curated rules, accessibility requirements, and platform-specific best practices to ensure your iOS apps meet Apple's quality standards and deliver excellent user experiences.
ios-xcode equips AI agents with specialized capabilities for iOS development workflows, enabling configuration of Xcode projects with SwiftData persistence layers and clinic-pattern MVVM-C architecture. This skill extends coding agents with domain knowledge for building structured, maintainable iOS applications.
This skill equips AI agents to work directly with iOS storyboard files, enabling updates and restructuring of interface layouts within healthcare applications. It integrates with the Agent Skills open format to provide domain-specific capabilities for managing UI components and screen configurations in clinic-focused iOS development.
This skill collection provides AI agents with specialized capabilities for constructing and improving iOS design systems. It enables systematic management of design tokens, component styling, and architectural patterns to maintain consistency across iOS applications. Leverage these domain-specific tools to streamline design system workflows and enhance code maintainability.
More skills ios-testing (MIT) · swiftui-patterns (MIT)