mapbox / mapbox/mapbox-agent-skills

Add skill: mapbox-custom-rendering-patterns (CustomLayerInterface, THREE.js, WebGL)

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
78
Forks
17
Avg merge
4h 39m
Merged PRs (30d)
3

Description

## Summary

Custom rendering with Mapbox GL JS is a powerful but poorly documented area. AI assistants typically don't know the `CustomLayerInterface` API or how to integrate THREE.js / raw WebGL into the map render pipeline correctly.

## Topics to cover

- `CustomLayerInterface` - `onAdd`, `render`, `onRemove` lifecycle
- THREE.js integration - shared WebGL context, coordinate projection, camera sync
- Raw WebGL custom layers - shader setup, buffer management, depth testing
- Point clouds and 3D model overlays
- Synchronizing custom layer rendering with map camera and tile loading

## Key patterns a skill should teach

- Correct matrix math for projecting geographic coordinates to clip space
- How to share the WebGL context without corrupting Mapbox's render state
- Frame timing and when to call `map.triggerRepaint()`
- Common mistakes: wrong depth buffer settings, coordinate system confusion, memory leaks from unregistered layers

## Why this matters

Developers building 3D visualizations, AR-adjacent experiences, or high-performance custom effects need this. The base model frequently gives incorrect matrix math or misuses the render lifecycle.

Contributor guide

Open the contributing guide

Research direction

No files or tests are named in the issue. Start by locating how existing skills are structured, then research Mapbox GL JS CustomLayerInterface, THREE.js shared-context rendering, and raw WebGL layers. Done means a skill covering the listed lifecycles, matrix and camera handling, render-state safety, repaint timing, and common mistakes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
computer-graphics, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.