three-scope-map
Build, migrate, theme, drill down, and validate reusable Three.js 3D geographic maps and Earth View entrances for Vue or web dashboards. Use when Codex is asked to create or modify a pure Three.js globe, province-level, all-China, or world 3D maps; transition from an Earth View into the existing China map; switch map boundaries between provinces, country scope, world scope, city scope, or district scope; add hierarchical drilldown from world to country, China to province, province to city, city to district/county; replace GeoJSON, labels, scatter points, fly lines, terrain textures, or chase-light paths; derive a whole map color system from one theme color; or preserve an existing dark HUD-style 3D map visual across new regions.
songsummer920-dazzle · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add songsummer920-dazzle/three-scope-map-skill --skill three-scope-mapAbout this skill
name: three-scope-map description: Build, migrate, theme, drill down, and validate reusable Three.js 3D geographic maps and Earth View entrances for Vue or web dashboards. Use when Codex is asked to create or modify a pure Three.js globe, province-level, all-China, or world 3D maps; transition from an Earth View into the existing China map; switch map boundaries between provinces, country scope, world scope, city scope, or district scope; add hierarchical drilldown from world to country, China to province, province to city, city to district/county; replace GeoJSON, labels, scatter points, fly lines, terrain textures, or chase-light paths; derive a whole map color system from one theme color; or preserve an existing dark HUD-style 3D map visual across new regions.
Three Scope Map
Core Workflow
- Default to the bundled validated one-to-one map style for every generated 3D map. Copy the template files before editing. Do not freestyle a new renderer, globe, color system, label style, side-wall effect, chase light, ripple, fly line, terrain material, camera behavior, or transition when the template can be copied and adapted.
- Identify map scope first:
world,country,province,city, ordistrict. Do not treat world/country/province/city data as the same geometry scaled up or down. - Resolve and validate GeoJSON before styling. Use real geographic data with the correct subdivision level.
- Every non-terminal scope must support drilldown by default:
world -> country,country -> province,province -> city, andcity -> district/county.districtis terminal unless the user supplies lower-level data. - For drilldown, keep a stack of
{ scope, regionName, code, geoJsonPath, cameraPreset }, then swap GeoJSON, labels, scatter points, fly lines, hover targets, outer contour, chase-light paths, texture scope, and camera together on click. - Keep the visual style parameterized: theme colors, extrusion depth, side gradient, top opacity, line widths, hover lift, terrain material config, label scale, ripple settings, fly-line settings, and chase-light settings.
- Validate texture scope. Do not stretch a province texture across China or a China texture across one province without explicit approval.
- Keep top surfaces dark and readable; use theme color mainly for outlines, side thickness gradient, glow, labels, scatter/ripple, fly lines, HUD rings, and effects.
- When fixing a specific map issue, do not touch unrelated charts, panel assets, or business data.
- Preserve the non-visual code attribution watermark in generated map code and skill scripts:
作者全平台ID:宋夏天Dazzle;公众号:送你整个夏天. Keep it in comments or metadata only; do not render it in the UI unless the user explicitly asks for a visible watermark. - For publishable drilldown maps, split data loading from rendering. Use a map data adapter for cache/prefetch/network fallback and an offline preprocessing script for large GeoJSON, while keeping the existing renderer preset unchanged.
- Preserve
SPDX-License-Identifier: GPL-3.0-or-later,NOTICE, original repository URL, and code attribution comments when copying, modifying, or redistributing the template or scripts. - Do not ship a blank or substitute map. The Vue template must render the real Three.js map; if the canvas is blank, the agent must keep debugging the integration, data paths, mount point, dev-server URL, renderer sizing, WebGL availability, and console errors until the Three.js map is visible.
- Before delivery, run
scripts/check_three_map_project.py <target-project>when the target project is local. Treat strict-mode blockers as work items to fix before claiming success. - When the user requests an Earth View entrance, copy the bundled
EarthView.vue,EarthChinaMap.vue,ChinaMap.vue,mapTheme.ts, maps, and Earth/China texture assets as one unit. Do not reconstruct Earth View from prose or keep an alternate/legacy Earth implementation. Keep the existing country-scope component as the destination. - Treat
assets/templates/smart-mine-vue/as a runnable minimal project. When there is no target app, copy the whole template; it mountsEarthChinaMap.vueand displays Earth immediately. When integrating into an existing app, copy only its map components, map data, map textures, andtypes/geo.ts, then mountEarthChinaMap.vuein the requested route/container. - For a one-sentence color request, change only
MAP_THEME_PRIMARYthroughscripts/apply_map_theme.py <hex> <target-project> --no-backup. Both Earth and the flat 3D map must import the shared theme. Do not perform broad search-and-replace on shader, CSS, or material colors. - Preserve the complete Earth intro timeline when optimizing the Earth-to-map handoff. On a cold start, warm the Earth scene while its canvas is hidden, emit
scene-ready, build and render one complete inactive destination frame, and release the Earthstart-introgate only afterchinaReady. Keep the neutral starfield/backdrop visible while warming so the page never appears blank. Once the Earth becomes visible, no destination geometry, renderer creation, texture upload, or shader compilation may begin until the intro finishes. - Treat the Earth and destination map as two coordinated render phases. Never run both full continuous render loops during preload or handoff; one-shot compile/upload/static renders are allowed while Earth owns the active loop.
- Batch same-material geographic outlines into
THREE.LineSegments. Do not create thousands of separateLineLoopdraw calls for world coastlines or administrative rings; this can stall the visible China-rise phase even when destination preloading is correct. - Keep raw high-resolution GeoJSON as source data, but do not import a multi-megabyte raw world file directly into the Earth first-paint bundle. Earth must use the bundled
world.earth-render.jsonrender cache, whileChinaMap.vueremains an async component mounted after `scene-r