mapbox-ios-swiftui-migration
БесплатноБез исполняемых скриптовНе проверенMove iOS Mapbox map and navigation screens from UIKit (MapView in a view controller, storyboards, or UIViewRepresentable wrappers) to SwiftUI with a coding…
от mapbox★ 90 звёзд на GitHubОб этом скилле
Mapbox iOS Screens → SwiftUI
Moves iOS map and navigation screens built with UIKit to SwiftUI. The agent does the work. The developer makes the decisions.
This skill covers only what's specific to Mapbox: the map, its content, its camera and its events. The rest of the screen (layout, navigation stack, view models, theming) is the app team's normal SwiftUI work. Say so in the plan rather than guessing at the app's architecture.
Reference files:
references/maps.md: UIKit → SwiftUI mappings for Maps SDK v11 (map view, style, camera and viewport, events, gestures, interactions, annotations, location, ornaments)references/navigation.md: Navigation SDK v3 screens in SwiftUI (hostingNavigationMapViewandNavigationViewController, Combine publishers to SwiftUI state, what the SwiftUIMapcan't do)references/migration-workflow.md: templates for the inventory, plan, decision log and summary
Load maps.md for every migration. Also load navigation.md when the screen uses the Navigation SDK.
When to use
- The app shows a Mapbox map in a
UIViewController, a storyboard, or aUIViewRepresentablewrapper inside SwiftUI, and the developer wants that screen on the SwiftUIMap - The developer asks "how much work is it to move our map screens to SwiftUI?". Run steps 1 and 2 only and stop.
- A map screen broke after moving to SwiftUI (map recreated on navigation, camera jumps back, taps not firing, layers disappear after a style change, high CPU from camera updates)
- The Maps v10 → v11 or Navigation v2 → v3 migration skill recommended SwiftUI as the next step
Not covered:
- Apps on Maps SDK v10 or Navigation SDK v2. Migrate first with
mapbox-ios-maps-v10-to-v11-migrationormapbox-ios-navigation-v2-to-v3-migration. Never combine an SDK version migration and a SwiftUI migration in one change. - The non-map parts of the screen
- Changing the map style, moving to Mapbox Standard, or turning on other data products
- Flutter and React Native
- Android. Use
mapbox-android-compose-migrationif it's installed.
Rules
These rules apply to every step.
1. Requirements
- Maps SDK 11.6.0 or later. The SwiftUI API was marked stable in 11.6.0. Earlier 11.x releases shipped it as experimental, with signatures that changed between releases.
Mapis part ofMapboxMaps. There's no separate package to add.- Use the app's current Maps version. If a target API in
references/maps.mdneeds a newer one (for exampleTapInteractionas map content, stable since 11.12), use the row's fallback, or propose a Maps bump as a separate change. Don't bump the SDK silently as part of this migration.
2. Stable APIs only, unless the developer agrees
Some SwiftUI-facing APIs still need @_spi(Experimental) import MapboxMaps (for example Marker, draggable MapViewAnnotation, viewAnnotationAvoidLayers). references/maps.md marks them. Don't introduce one to replace stable UIKit code without asking. If the app already imports @_spi(Experimental), keep using what it uses, and list it in the report.
3. No silent behavior change
Moving to SwiftUI can change what the user sees even when the code compiles. Examples: a single PointAnnotation per marker puts each marker on its own layer, the map is recreated when the view's identity changes, and the camera returns to initialViewport when the screen is rebuilt. references/maps.md has a Behavior changes table. For every row that applies:
- Present it as a decision. Say what the UIKit screen did, what SwiftUI does by default, and the options.
- Default to matching the UIKit screen if the developer doesn't answer, and say so.
- Record it in the decision log (
references/migration-workflow.md).
4. Keep the style and data products
Carry the screen's style over exactly: the same style URI or JSON, the same Standard config (light preset, labels), the same runtime sources and layers with the same IDs. A UIKit screen that never set a style loaded Standard, and so does Map, so leave it. Don't move a screen to Standard or change tilesets as part of the migration.
5. Declarative where it exists, MapReader where it doesn't
Use the SwiftUI API when references/maps.md lists one: Map modifiers, Viewport, map content (sources, layers, annotations, Puck2D, TapInteraction), event modifiers. Use MapReader and MapProxy only for what has no SwiftUI API (queries, snapshots, custom layers, annotation manager features the groups don't expose). Don't move a whole viewDidLoad into one .onAppear { proxy.map ... } and call it migrated.
MapReader rules:
proxy.map,proxy.camera,proxy.locationandproxy.viewportare optional. They're nil until the map exists.- Don't add sources or layers through
proxy.mapwhen they can be map content. Layers added through the proxy aren't part of the declaration and are lost on style reload. - Don't drive the camera from both
proxy.cameraand a `Viewpo
Установить mapbox-ios-swiftui-migration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mapbox-ios-swiftui-migration?
Move iOS Mapbox map and navigation screens from UIKit (MapView in a view controller, storyboards, or UIViewRepresentable wrappers) to SwiftUI with a coding agent. Covers the Mapbox parts of the screen (the SwiftUI Map view, Viewport, map content for styles and annotations, MapReader, events, Navigation SDK v3 hosting) and marks which APIs are stable and which are experimental. Keeps the map looking and behaving the same, one screen at a time. Use when migrating a Mapbox screen to SwiftUI, planning that work, or fixing a map that broke after moving to SwiftUI.
Как установить скилл mapbox-ios-swiftui-migration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mapbox-ios-swiftui-migration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic