PluginBench
Skill
Official
Pass
Audit score 90

mapbox-style-patterns

mapbox/mapbox-agent-skills

Battle-tested Mapbox style patterns and layer configurations for restaurant finders, real estate, data visualization, navigation, and delivery maps.

What is mapbox-style-patterns?

This skill provides proven style patterns and layer configurations for common mapping scenarios including POI finders, real estate, data visualization, navigation, and delivery/logistics. Use it when implementing a specific map use case or looking for established style recipes that handle visual hierarchy, performance, and platform optimization.

  • Provides complete layer configurations for 6 common mapping patterns (POI finder, real estate, data visualization, navigation, dark mode, delivery/logistics)
  • Includes a decision tree to select the right pattern based on content type, viewing environment, user action, and platform
  • Demonstrates performance optimization patterns like zoom-based layer filtering and simplified rendering
  • Offers visual regression testing checklist for validating styles across zoom levels and devices
  • References additional detailed patterns in separate markdown files for real estate, data visualization, navigation, dark mode, and delivery tracking

How to install mapbox-style-patterns

npx skills add https://github.com/mapbox/mapbox-agent-skills --skill mapbox-style-patterns
Prerequisites
  • Mapbox GL JS library installed
  • Access to Mapbox Streets tileset or equivalent vector source
  • Understanding of Mapbox style layer structure and paint/layout properties
Claude Code
Cursor
Windsurf
Cline

How to use mapbox-style-patterns

  1. 1.Identify your primary use case using the decision tree (POI finder, real estate, data visualization, navigation, or delivery/logistics)
  2. 2.Select the corresponding pattern from the main skill or load the relevant reference file (e.g., references/real-estate.md)
  3. 3.Copy the recommended layer configuration JSON into your map style
  4. 4.Customize colors, icons, and text properties to match your brand and data
  5. 5.Test the style across zoom levels 4, 8, 12, 16, and 20 using the visual regression checklist
  6. 6.Verify performance and label collision on both mobile (375px) and desktop (1920px) viewports

Use cases

Good for
  • Building a restaurant or POI finder app with high-contrast markers and neutral background for content overlay
  • Creating a real estate map with property boundaries and price-based color coding
  • Implementing a data visualization map with minimal base map and choropleth or heatmap overlays
  • Designing a navigation/routing map with route display and turn-by-turn indicators
  • Building a delivery or logistics tracking map with real-time driver markers and service zones
Who it's for
  • Frontend developers building consumer mapping applications
  • Product teams implementing location-based features
  • Designers creating map UIs for specific use cases
  • Teams optimizing existing Mapbox styles for performance or usability

mapbox-style-patterns FAQ

Which pattern should I use for my use case?

Use the decision tree in the Pattern Selection Guide. Answer four questions: (1) What is the primary content? (2) What is the viewing environment? (3) What is the user's primary action? (4) What is the platform? This will direct you to the appropriate pattern.

Where are the other patterns documented?

Patterns 2–6 are documented in reference files: real-estate.md, data-viz-base.md, navigation.md, dark-mode.md, and delivery-logistics.md. Load the relevant file when you need that specific pattern.

How do I optimize performance for dense data?

Use the performance pattern with zoom-based layer filtering to show only relevant road classes at each zoom level. Also see references/expressions-clustering.md for data-driven expressions and clustering techniques for dense POIs.

What should I test before deploying a style?

Use the visual regression checklist: test at zoom levels 4, 8, 12, 16, 20; verify on mobile and desktop; test with dense and sparse data; check label collision, color contrast (WCAG), and loading performance.

Can I combine patterns or customize the examples?

Yes. The patterns are starting points. Customize colors, icons, text sizes, and layer filters to match your specific data and brand. The decision tree helps you select the base pattern, then modify as needed.

Full instructions (SKILL.md)

Source of truth, from mapbox/mapbox-agent-skills.


name: mapbox-style-patterns description: Common style patterns, layer configurations, and recipes for typical mapping scenarios including restaurant finders, real estate, data visualization, navigation, delivery/logistics, and more. Use when implementing specific map use cases or looking for proven style patterns.

Mapbox Style Patterns Skill

This skill provides battle-tested style patterns and layer configurations for common mapping scenarios.

Pattern Library

Pattern 1: Restaurant/POI Finder

Use case: Consumer app showing restaurants, cafes, bars, or other points of interest

Visual requirements:

  • POIs must be immediately visible
  • Street context for navigation
  • Neutral background (photos/content overlay)
  • Mobile-optimized

Recommended layers:

{
  "layers": [
    {
      "id": "background",
      "type": "background",
      "paint": {
        "background-color": "#f5f5f5"
      }
    },
    {
      "id": "water",
      "type": "fill",
      "source": "mapbox-streets",
      "source-layer": "water",
      "paint": {
        "fill-color": "#d4e4f7",
        "fill-opacity": 0.6
      }
    },
    {
      "id": "landuse-parks",
      "type": "fill",
      "source": "mapbox-streets",
      "source-layer": "landuse",
      "filter": ["==", "class", "park"],
      "paint": {
        "fill-color": "#e8f5e8",
        "fill-opacity": 0.5
      }
    },
    {
      "id": "roads-minor",
      "type": "line",
      "source": "mapbox-streets",
      "source-layer": "road",
      "filter": ["in", "class", "street", "street_limited"],
      "paint": {
        "line-color": "#e0e0e0",
        "line-width": {
          "base": 1.5,
          "stops": [
            [12, 0.5],
            [15, 2],
            [18, 6]
          ]
        }
      }
    },
    {
      "id": "roads-major",
      "type": "line",
      "source": "mapbox-streets",
      "source-layer": "road",
      "filter": ["in", "class", "primary", "secondary", "tertiary"],
      "paint": {
        "line-color": "#ffffff",
        "line-width": {
          "base": 1.5,
          "stops": [
            [10, 1],
            [15, 4],
            [18, 12]
          ]
        }
      }
    },
    {
      "id": "restaurant-markers",
      "type": "symbol",
      "source": "restaurants",
      "layout": {
        "icon-image": "restaurant-15",
        "icon-size": 1.5,
        "icon-allow-overlap": false,
        "text-field": ["get", "name"],
        "text-offset": [0, 1.5],
        "text-size": 12,
        "text-allow-overlap": false
      },
      "paint": {
        "icon-color": "#FF6B35",
        "text-color": "#333333",
        "text-halo-color": "#ffffff",
        "text-halo-width": 2
      }
    }
  ]
}

Key features:

  • Desaturated base map (doesn't compete with photos)
  • High-contrast markers (#FF6B35 orange stands out)
  • Clear road network (white on light gray)
  • Parks visible but subtle
  • Text halos for readability

Pattern Selection Guide

Decision Tree

Question 1: What is the primary content?

  • User-generated markers/pins -> POI Finder Pattern
  • Property data/boundaries -> Real Estate Pattern
  • Statistical/analytical data -> Data Visualization Pattern
  • Routes/directions -> Navigation Pattern
  • Real-time tracking/delivery zones -> Delivery/Logistics Pattern (customer markers should include a pulse animation via second circle layer + requestAnimationFrame + setPaintProperty; see references/delivery-logistics.md)

Question 2: What is the viewing environment?

  • Daytime/office -> Light theme
  • Night/dark environment -> Dark Mode Pattern
  • Variable -> Provide theme toggle

Question 3: What is the user's primary action?

  • Browse/explore -> Focus on POIs, rich detail
  • Navigate -> Focus on roads, route visibility
  • Track delivery/logistics -> Real-time updates, zones, status
  • Analyze data -> Minimize base map, maximize data
  • Select location -> Clear boundaries, context

Question 4: What is the platform?

  • Mobile -> Simplified, larger touch targets, less detail
  • Desktop -> Can include more detail and complexity
  • Both -> Design mobile-first, enhance for desktop

Layer Optimization Patterns

Performance Pattern: Simplified by Zoom

{
  "id": "roads",
  "type": "line",
  "source": "mapbox-streets",
  "source-layer": "road",
  "filter": [
    "step",
    ["zoom"],
    ["in", "class", "motorway", "trunk"],
    8,
    ["in", "class", "motorway", "trunk", "primary"],
    12,
    ["in", "class", "motorway", "trunk", "primary", "secondary"],
    14,
    true
  ],
  "paint": {
    "line-width": {
      "base": 1.5,
      "stops": [
        [4, 0.5],
        [10, 1],
        [15, 4],
        [18, 12]
      ]
    }
  }
}

Reference Files

Additional patterns and configurations are available in the references/ directory. Load the relevant file when a specific pattern is needed.

FileContents
references/real-estate.mdPattern 2: Real Estate Map -- property boundaries, price color-coding, amenity markers
references/data-viz-base.mdPattern 3: Data Visualization Base Map -- minimal grayscale base for choropleth/heatmap overlays
references/navigation.mdPattern 4: Navigation/Routing Map -- route display, user location, turn arrows
references/dark-mode.mdPattern 5: Dark Mode / Night Theme -- near-black background, reduced brightness
references/delivery-logistics.mdPattern 6: Delivery/Logistics Map -- real-time tracking, zones, driver markers, ETA badges
references/expressions-clustering.mdData-driven expression patterns + clustering for dense POIs
references/common-modifications.md3D Buildings, Terrain/Hillshade, Custom Markers

Loading instructions: Read the reference file that matches the user's use case. For example, if implementing a delivery tracking map, load references/delivery-logistics.md.

Testing Patterns

Visual Regression Checklist

  • Test at zoom levels: 4, 8, 12, 16, 20
  • Verify on mobile (375px width)
  • Verify on desktop (1920px width)
  • Test with dense data
  • Test with sparse data
  • Check label collision
  • Verify color contrast (WCAG)
  • Test loading performance

When to Use This Skill

Invoke this skill when:

  • Starting a new map style for a specific use case
  • Looking for layer configuration examples
  • Implementing common mapping patterns
  • Optimizing existing styles
  • Need proven recipes for typical scenarios
  • Debugging style issues
  • Learning Mapbox style best practices

Related skills

More from mapbox/mapbox-agent-skills and the wider catalog.

MAmapbox-style-quality logo

mapbox-style-quality

Official
mapbox/mapbox-agent-skills

Expert guidance on validating, optimizing, and ensuring quality of Mapbox styles through validation, accessibility checks, and optimization. Use when preparing styles for production, debugging issues, or ensuring map quality standards.

1.1k installs
MAmapbox-token-security logo

mapbox-token-security

Official
mapbox/mapbox-agent-skills

Security best practices for Mapbox access tokens, including scope management, URL restrictions, rotation strategies, and protecting sensitive data. Use when creating, managing, or advising on Mapbox token security.

1.1k installsAudited
MAmapbox-web-integration-patterns logo

mapbox-web-integration-patterns

Official
mapbox/mapbox-agent-skills

Official Mapbox GL JS integration patterns for React, Vue, Svelte, and Angular with best practices for setup, lifecycle, and token handling.

1.4k installsAudited
MAmapbox-web-performance-patterns logo

mapbox-web-performance-patterns

Official
mapbox/mapbox-agent-skills

Performance optimization patterns for Mapbox GL JS web applications, prioritized by user experience impact.

1.4k installs
YTyt-dlp-downloader logo

yt-dlp-downloader

mapleshaw/yt-dlp-downloader-skill

Download videos from YouTube, Bilibili, Twitter, and thousands of other sites using yt-dlp. Use when the user provides a video URL and wants to download it, extract audio (MP3), download subtitles, or select video quality. Triggers on phrases like "下载视频", "download video", "yt-dlp", "YouTube", "B站", "抖音", "提取音频", "extract audio".

606 installs
COconventional-commit logo

conventional-commit

marcelorodrigo/agent-skills

Create conventional commit messages following best conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits specification.

835 installs