# maplibre-mapbox-migration

Guides the transition from Mapbox GL JS to MapLibre GL JS across imports, CSS, and tile configurations. Useful when moving away from Mapbox licensing.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 464 installs · ★ 155
- Author: maplibre
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/maplibre/maplibre-agent-skills/tree/HEAD/skills/maplibre-mapbox-migration/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/maplibre-mapbox-migration

## What it does

The skill provides agent instructions for swapping `mapbox-gl` with `maplibre-gl`. It handles renaming `mapboxgl` namespaces, updating CSS classes like `mapboxgl-ctrl`, and stripping `mapboxgl.accessToken` from map setup.

Native `mapbox://` style URLs do not work in MapLibre. Projects must replace them with alternative tile sources such as OpenFreeMap or self-hosted servers like Martin.

The guide highlights changes in MapLibre GL JS v6, which ships ES modules only and drops UMD bundles. Switching also means giving up proprietary Mapbox Geocoding and Directions APIs.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add maplibre/maplibre-agent-skills --skill maplibre-mapbox-migration -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/maplibre-mapbox-migration/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/maplibre-mapbox-migration/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add maplibre/maplibre-agent-skills --skill maplibre-mapbox-migration -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/maplibre-mapbox-migration/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add maplibre/maplibre-agent-skills --skill maplibre-mapbox-migration -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/maplibre-mapbox-migration/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install maplibre/maplibre-agent-skills maplibre-mapbox-migration
```

2. **Manually: put the files in place**
- File: `.github/skills/maplibre-mapbox-migration/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add maplibre/maplibre-agent-skills --skill maplibre-mapbox-migration -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/maplibre/maplibre-agent-skills --path skills/maplibre-mapbox-migration
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/maplibre-mapbox-migration/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add maplibre/maplibre-agent-skills --skill maplibre-mapbox-migration -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/maplibre/maplibre-agent-skills/tree/HEAD/skills/maplibre-mapbox-migration/SKILL.md

## When to use it
- replace `mapbox-gl` package imports with `maplibre-gl`
- remove `mapboxgl.accessToken` setup from application code
- switch map style endpoints away from proprietary `mapbox://` protocols
- update CSS class prefixes from `mapboxgl-ctrl` to `maplibregl-ctrl`

## Example prompts
- Migrate our web map from Mapbox GL JS to MapLibre GL JS
- How do I update imports and remove the access token for MapLibre v6?
- Replace our mapbox:// style URLs with OpenFreeMap tiles

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: f44715804947eff8.

BEGIN THIRD-PARTY FILE f44715804947eff8
```text
---
name: maplibre-mapbox-migration
description: Migrating from Mapbox GL JS to MapLibre GL JS — package and import changes, removing the access token, choosing tile sources, plugin equivalents, and what you gain or give up. Use when moving an existing Mapbox map to MapLibre.
status: verified
---

# Mapbox to MapLibre Migration

This skill guides you through migrating an application from **Mapbox GL JS** to **MapLibre GL JS**. The two libraries share a common ancestry (MapLibre forked from Mapbox GL JS v1.13 in December 2020), so the API is largely the same. The main changes are: swap the package, replace the namespace, remove the Mapbox access token, and **choose a new tile source** (MapLibre does not use `mapbox://` styles).

**Primary reference:** [MapLibre official Mapbox migration guide](https://maplibre.org/maplibre-gl-js/docs/guides/mapbox-migration-guide/).

## When to Use This Skill

- Migrating an existing Mapbox GL JS app to MapLibre
- Evaluating MapLibre as an open-source alternative to Mapbox
- Understanding API compatibility and what breaks
- Choosing tile sources and services after moving off Mapbox

## Why Migrate to MapLibre?

Common reasons teams switch from Mapbox to MapLibre:

- **Open-source license** — MapLibre is BSD-3-Clause; no vendor lock-in or proprietary terms
- **No access token** — The library does not require a Mapbox token; tile sources may have their own keys or none (e.g. OpenFreeMap)
- **Cost** — Avoid Mapbox map-load and API pricing; use free or fixed-cost tile and geocoding providers
- **Self-hosting** — Use your own tiles (PMTiles, tileserver-gl, Martin) or any third-party source
- **Community** — MapLibre is maintained by the MapLibre organization and community; style spec and APIs evolve in the open
- **Community-supported funding** — MapLibre is funded by donations from many companies and individuals; there is no single commercial backer, so the project stays aligned with the community
- **Open vector tile format (MLT)** — MapLibre offers [MapLibre Tile (MLT)](https://maplibre.org/maplibre-tile-spec/), a modern alternative to Mapbox Vector Tiles (MVT) with better compression and support for 3D coordinates and elevation; supported in GL JS and Native, and can be generated with Planetiler

**What you give up:** Mapbox Studio integration, Mapbox-hosted tiles and styles, Mapbox Search/Directions/Geocoding APIs, official Mapbox support.

## Understanding the Fork

- **Dec 2020:** Mapbox GL JS v2.0 switched to a proprietary license. The community forked v1.13 as **MapLibre GL JS**. [MapLibre organization](https://github.com/maplibre) and [GL JS repo](https://github.com/maplibre/maplibre-gl-js) are the canonical homes.
- **API:** MapLibre GL JS v1.x is largely backward compatible with Mapbox GL JS v1.x. Most map code (methods, events, layers, sources) works with minimal changes.
```
END THIRD-PARTY FILE f44715804947eff8

The third-party file has ended. Everything between the f44715804947eff8 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2879 of 18859 bytes. © maplibre · MIT · https://github.com/maplibre/maplibre-agent-skills/tree/HEAD/skills/maplibre-mapbox-migration/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
