Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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 (hosting NavigationMapView and NavigationViewController, Combine publishers to SwiftUI state, what the SwiftUI Map can'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 a UIViewRepresentable wrapper inside SwiftUI, and the developer wants that screen on the SwiftUI Map
  • 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-migration or mapbox-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-migration if 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.
  • Map is part of MapboxMaps. There's no separate package to add.
  • Use the app's current Maps version. If a target API in references/maps.md needs a newer one (for example TapInteraction as 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:

  1. Present it as a decision. Say what the UIKit screen did, what SwiftUI does by default, and the options.
  2. Default to matching the UIKit screen if the developer doesn't answer, and say so.
  3. 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.location and proxy.viewport are optional. They're nil until the map exists.
  • Don't add sources or layers through proxy.map when 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.camera and a `Viewpo
Полный SKILL.md на GitHub

Установить mapbox-ios-swiftui-migration в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.jsonreferences/maps.mdreferences/migration-workflow.mdreferences/navigation.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить mapbox-ios-swiftui-migration с