migration-patterns
Skill915 starsChanged 22 days agoMITView on GitHub
Migration guides for CoreData to SwiftData, UIKit to SwiftUI, ObservableObject to @Observable, XCTest to Swift Testing, Objective-C to Swift, and StoreKit 1 to StoreKit 2. Use when migrating between Apple framework generations.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- duyet/clickhouse-monitoringtheir own version, first seen Oct 8, 2026
- dilolabs/nosiatheir own version, first seen Oct 8, 2026
- bybren-llc/safe-agentic-workflowtheir own version, first seen Jul 20, 2026
- adyba/pi-safe-workflowtheir own version, first seen Jul 10, 2026
- atuljha23/holocrontheir own version, first seen Apr 22, 2026
Used with
Projects with it also use api-patterns and testing-patterns.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
xenitV1Skillapi-patterns
API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
Also in 3 projects that use this
LangChainSkilltesting-patterns
Unit testing and integration testing best practices
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- bybren-llc/safe-agentic-workflow★ 405same name
- duyet/clickhouse-monitoring★ 306same name
- dilolabs/nosia★ 214same name
- atuljha23/holocron★ 2same name
- adyba/pi-safe-workflow★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository184 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-intentsSkill
- foundation-modelsSkill
- apple-intelligenceSkill
- visual-intelligenceSkill
- ad-attributionSkill
- app-description-writerSkill
- apple-search-adsSkill
- iap-finalizerSkill
- keyword-optimizerSkill
- marketing-strategySkill
- originality-checkSkill
- ratings-mechanicsSkill
- rejection-handlerSkill
- review-response-writerSkill
- screenshot-plannerSkill
- app-storeSkill
- web-presenceSkill
- core-mlSkill
- animation-patternsSkill
- design-systemSkill
- game-feelSkill
- liquid-glassSkill
- sf-symbolsSkill
- designSkill
- typographySkill
- ui-prototypingSkill
- ux-writingSkill
- attributed-stringSkill
- foundationSkill
- accessibility-generatorSkill
- account-deletionSkill
- analytics-setupSkill
- announcement-bannerSkill
- app-clipSkill
- app-extensionsSkill
- app-icon-generatorSkill
- app-store-assetsSkill
- auth-flowSkill
- background-processingSkill
- ci-cd-setupSkill
- cloudkit-syncSkill
- consent-flowSkill
- custom-product-pagesSkill
- data-exportSkill
- debug-menuSkill
- deep-linkingSkill
- error-monitoringSkill
- feature-flagsSkill
- featuring-nominationSkill
- feedback-formSkill
- force-updateSkill
- http-cacheSkill
- image-loadingSkill
- in-app-eventsSkill
- lapsed-userSkill
- live-activity-generatorSkill
- localization-setupSkill
- logging-setupSkill
- milestone-celebrationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 127
Migrate tests first: If you are migrating both app code and tests, migrate tests to Swift Testing first.
- Distinctive: line 129
One migration at a time: Do not migrate CoreData to SwiftData and ObservableObject to @Observable in the same PR.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migration Patterns
Comprehensive guides for migrating between Apple framework generations. Each guide covers the full before/after mapping, coexistence strategies, and common pitfalls.
When This Skill Activates
- User asks how to migrate from CoreData to SwiftData
- User is moving UIKit code to SwiftUI (or embedding one in the other)
- User needs to update from ObservableObject/Combine to @Observable/AsyncSequence
- User is converting XCTest tests to Swift Testing
- User asks about coexistence strategies (running old and new frameworks side by side)
- User wants to know whether a migration is worth doing for their situation
- User is migrating Objective-C code to Swift (bridging headers, incremental migration)
- User is migrating from StoreKit 1 to StoreKit 2 (in-app purchases, subscriptions)
- User encounters errors during a framework migration
Decision Tree
What are you migrating?
|
+-- Data persistence layer
| +-- CoreData --> SwiftData
| | See coredata-to-swiftdata.md
| | Min: iOS 17 / macOS 14
| |
| +-- Still need CoreData features SwiftData lacks?
| Stay on CoreData or use coexistence mode
|
+-- UI framework
| +-- UIKit --> SwiftUI
| | See uikit-to-swiftui.md
| | Min: iOS 13 (basic), iOS 16+ (modern navigation)
| |
| +-- Full rewrite or incremental?
| Incremental is almost always better -- adopt screen by screen
|
+-- State management / observation
| +-- ObservableObject --> @Observable
| | See observable-migration.md
| | Min: iOS 17 / macOS 14
| |
| +-- Combine publishers --> AsyncSequence
| Also covered in observable-migration.md
|
+-- Programming language
| +-- Objective-C --> Swift
| | See objc-to-swift.md
| | Incremental: migrate leaves first, trunks last
| |
| +-- Mixed-language project?
| Both languages coexist via bridging headers
|
+-- In-app purchases
| +-- StoreKit 1 --> StoreKit 2
| | See storekit-migration.md
| | Min: iOS 15
| |
| +-- Using a third-party SDK (RevenueCat, etc.)?
| Check if SDK already supports StoreKit 2 internally
|
+-- Testing framework
+-- XCTest --> Swift Testing
See xctest-to-swift-testing.md
Min: Xcode 16 / Swift 6.0Quick Reference
| Migration | Reference File | Minimum OS | Risk Level |
| CoreData to SwiftData | coredata-to-swiftdata.md | iOS 17 / macOS 14 | High (data layer) |
| UIKit to SwiftUI | uikit-to-swiftui.md | iOS 13+ | Medium (incremental) |
| ObservableObject to @Observable | observable-migration.md | iOS 17 / macOS 14 | Low-Medium |
| Objective-C to Swift | objc-to-swift.md | Any | Medium (incremental) |
| StoreKit 1 to StoreKit 2 | storekit-migration.md | iOS 15 | Medium-High (payments) |
| XCTest to Swift Testing | xctest-to-swift-testing.md | Xcode 16 | Low |
Process
1. Assess the Migration
Before starting, determine:
- What is the minimum deployment target? Many migrations require iOS 17+.
- How large is the surface area? (number of models, screens, test files)
- Can you adopt incrementally or is it all-or-nothing?
- Are there third-party dependencies that assume the old framework?
2. Load Relevant Reference File
Based on the migration type, read from this directory:
coredata-to-swiftdata.md-- NSManagedObject to @Model, migration stages, coexistenceuikit-to-swiftui.md-- UIHostingController, Representable, incremental adoptionobservable-migration.md-- @Observable macro, @Environment injection, AsyncSequenceobjc-to-swift.md-- Bridging headers, @objc, incremental file-by-file migrationstorekit-migration.md-- StoreKit 2 async/await purchases, Transaction.currentEntitlements, JWSxctest-to-swift-testing.md-- @Test, #expect, #require, parameterized tests
3. Review the User's Code
Scan for old-framework patterns and map each to its modern equivalent using the reference file. Check for:
- Deprecated API usage that has a direct modern replacement
- Custom workarounds that are no longer needed with the new framework
- Third-party dependencies that may conflict with the migration
- Coexistence requirements (both frameworks running simultaneously)
4. Recommend a Migration Strategy
For each migration, decide between:
- Full migration: Replace all old-framework code at once. Best for small codebases or when old framework is causing problems.
- Incremental migration: Migrate piece by piece while both frameworks coexist. Best for large codebases, production apps, or when timeline is flexible.
- No migration: The old framework is still appropriate. See "When NOT to Migrate" in each reference file.
General Migration Principles
- Migrate tests first. If you are migrating both app code and tests, migrate tests to Swift Testing first. This gives you a safety net for the app-code migration.
- One migration at a time. Do not migrate CoreData to SwiftData and ObservableObject to @Observable in the same PR. Each migration should be independently reviewable and revertible.
- Keep the old code compiling. During incremental migration, both old and new code must compile and run. Use coexistence patterns from each reference file.
- Feature-flag large migrations. For production apps, consider gating new-framework code behind a feature flag so you can roll back without a code revert.
- Write migration tests. For data-layer migrations (CoreData to SwiftData), write tests that verify data roundtrips correctly through both stacks.
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

