New to Claude Skills? Learn how to install them →

mengto on GitHub

Cobe.js Globe Skill

Free

Add an interactive WebGL globe to your web projects.

by mengto4.6k stars on mengto/skills
5 views
Updated Aug 9, 2026
Get this skill

Free · Opens the source repo

What Cobe.js Globe Skill does

Cobe.js is a lightweight library designed to create interactive globes using WebGL, making it an ideal choice for developers looking to enhance their web pages with a visually appealing spinning globe. This skill is particularly useful for hero sections or about pages where location markers can provide context and engagement. By focusing on a minimal setup, Cobe.js allows for quick integration without the overhead of larger libraries like Three.js, making it suitable for projects that require a straightforward globe solution.

The core functionality revolves around the createGlobe method, which initializes the globe on a specified canvas element. Developers can customize various options such as rotation angles, colors, and marker locations to tailor the globe to their needs. The library supports responsive design, ensuring that the globe adapts to different screen sizes, which is crucial for modern web applications. With built-in methods for pausing and destroying the globe instance, developers have control over the globe's lifecycle, allowing for efficient resource management.

Common pitfalls include ensuring proper canvas sizing and handling device pixel ratios effectively, especially on mobile devices. The skill provides guidance on these aspects, helping developers avoid issues that could lead to poor performance or visual artifacts. Additionally, the provided quick recipe demonstrates how to set up a responsive globe with markers, making it easier for developers to get started quickly.

Overall, Cobe.js is a practical tool for web developers and designers who want to incorporate interactive globes into their projects without the complexities of larger 3D libraries. Its lightweight nature and ease of use make it a valuable addition to any web toolkit, especially for projects focused on location-based content or visual storytelling.

When to use it

Use Cobe.js when you need a simple, interactive globe for visualizing locations on your web pages.

When not to use it

Avoid using this skill for complex 3D visualizations that require extensive features beyond a basic globe.

What you can build with it

Hero Section Globe

Add a spinning globe to the hero section of your website to enhance visual appeal.

Location Markers

Use Cobe.js to display location markers on the globe for an interactive user experience.

Responsive Design

Implement a responsive globe that adjusts to different screen sizes for better accessibility.

How to install Cobe.js Globe Skill

View source

1. Install with the skills CLI

npx skills add mengto/skills/cobejs --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mengto

cobe.js — Lightweight WebGL Globe Skill

When to use

  • A “spinning globe” / location markers in hero or about pages
  • You want a small, focused globe lib (not full three.js)
  • Decorative + interactive (markers, rotation) with minimal setup

Key APIs/patterns

  • Core:
    • import createGlobe from "cobe"
    • const globe = createGlobe(canvas, { ...options, onRender(state) { ... } })
  • Important options (common):
    • devicePixelRatio, width, height
    • phi, theta (rotation angles)
    • scale, dark, diffuse
    • baseColor, markerColor, glowColor
    • markers: [{ location: [lat, lon], size, color? }]
  • Lifecycle:
    • globe.toggle() pauses RAF
    • globe.destroy() removes instance

Common pitfalls

  • Canvas sizing mismatch
    • Set CSS size AND set canvas width/height scaled for DPR.
  • Not updating on resize
    • Recompute width/height and recreate or update params.
  • Too high DPR on mobile
    • Clamp DPR to 1–2.

Quick recipe: responsive globe with markers

import createGlobe from "cobe";

const canvas = document.getElementById("cobe");
let phi = 0;

function setup() {
  const rect = canvas.getBoundingClientRect();
  const dpr = Math.min(window.devicePixelRatio, 2);
  canvas.width = Math.round(rect.width * dpr);
  canvas.height = Math.round(rect.height * dpr);

  const globe = createGlobe(canvas, {
    devicePixelRatio: dpr,
    width: canvas.width,
    height: canvas.height,
    phi: 0,
    theta: 0.2,
    dark: 0,
    diffuse: 1.2,
    scale: 1,
    mapSamples: 16000,
    mapBrightness: 6,
    baseColor: [0.2, 0.2, 0.25],
    glowColor: [1, 1, 1],
    markerColor: [0.8, 0.5, 1],
    markers: [{ location: [1.3521, 103.8198], size: 0.08 }],
    onRender: (state) => {
      state.phi = phi;
      phi += 0.01;
    },
  });

  return globe;
}

let globe = setup();
window.addEventListener("resize", () => {
  globe.destroy();
  globe = setup();
});

What to ask the user

  • Globe size and placement (hero, section, card)?
  • Marker locations + colors (brand-aligned)?
  • Interaction needs (drag to rotate vs. ambient spin)?

Frequently asked questions about Cobe.js Globe Skill

Similar skills