# godot-platform-web

Scripts and rules for shipping Godot games to the browser: saves, JS bridges, tab-hide pause, unsaved-progress guard.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 302 installs · ★ 893
- Author: thedivergentai
- License: LGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-platform-web/SKILL.md
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/skills/godot-platform-web

## What it does

This skill covers HTML5 export on the Compatibility renderer (WebGL 2.0). The `scripts/` folder holds ready pieces: a quota-safe `localStorage` wrapper built on `JavaScriptBridge.get_interface` and JSON rather than string interpolation, a two-way GD↔JS bridge via `create_callback`, a canvas adaptor that follows the browser viewport, lazy fetching of remote PCK files, async clipboard access through the Navigator API, and auto-pause of engine and audio when the tab is hidden.

A host checklist comes with it. Serve over HTTPS, send COOP/COEP headers when you need threads or `SharedArrayBuffer`, keep asset URLs relative in a custom `index.html`, and wire the `beforeunload` guard while progress is unsaved. Threads simply will not start without cross-origin isolation, and absolute paths break once the build sits under a subpath like `/game/`.

Performance guidance is included too: S3TC/BPTC texture compression, tighter particle and draw-call budgets, exclude filters that keep docs and sources out of the download. WebGPU is not treated as a web renderer here — Compatibility is the target.

## Requirements
- Works with: Godot

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-platform-web -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-platform-web -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-platform-web -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install thedivergentai/Game-Dev-Agentic-Skills godot-platform-web
```

2. **Manually: put the files in place**
- File: `.github/skills/godot-platform-web/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-platform-web -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/thedivergentai/Game-Dev-Agentic-Skills --path skills/godot-platform-web
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-platform-web -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/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-platform-web/SKILL.md

## When to use it
- Store browser saves without string-built `localStorage` calls
- Set up two-way data exchange between GDScript and page JS
- Resize the canvas to match the browser viewport
- Warn players about unsaved progress before they close the tab
- Trim build size to fit a download budget

## Example prompts
- Set up web saves using `web_local_storage_wrapper.gd`
- Add a JS↔GD bridge with `create_callback` so the page can send events
- Walk the host checklist: COOP/COEP headers and relative paths in `index.html`

## Similar
- [orbit-card](https://affpapa.org/en/nevibecode/skills/orbit-card.md) — skill · 10000 installs
- [cad](https://affpapa.org/en/nevibecode/skills/cad.md) — skill · 14000 installs
- [step-parts](https://affpapa.org/en/nevibecode/skills/step-parts.md) — skill · 11200 installs
- [sdf](https://affpapa.org/en/nevibecode/skills/sdf.md) — skill · 10500 installs
- [urdf](https://affpapa.org/en/nevibecode/skills/urdf.md) — skill · 10500 installs
- [hatch-pet](https://affpapa.org/en/nevibecode/skills/hatch-pet.md) — skill · 3300 installs

From the same set: [thedivergentai/game-dev-agentic-skills](https://affpapa.org/en/nevibecode/by/thedivergentai/game-dev-agentic-skills.md) — 61 cards

---
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
