All skills
thedivergentai avatar

/godot-platform-web

@9d6e91e

Expert blueprint for HTML5/web export on Compatibility (WebGL 2.0): JavaScriptBridge, localStorage wrapper, custom loading shells, COOP/COEP hosts, relative paths, beforeunload, visibility pause, and size optimization. WebGPU is out of scope. Keywords: web, HTML5, WebGL, Compatibility, JavaScriptBridge, localStorage, COOP, COEP, canvas, browser API.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-platform-web

This session only. Nothing lands on disk.

referencesweb-elite-patterns.md

≈472 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Web Elite Patterns (load on demand)

MANDATORY for JSON-RPC bridges, PWA lifecycle, and host integration beyond bundled scripts. NEVER use raw JavaScriptBridge.eval("localStorage.setItem('%s')" % data) — use web_local_storage_wrapper.gd.

PWA update lifecycle

func _ready() -> void:
    if OS.has_feature("web"):
        JavaScriptBridge.pwa_update_available.connect(_on_pwa_update)

func _on_pwa_update() -> void:
    if JavaScriptBridge.pwa_needs_update():
        JavaScriptBridge.pwa_update()

Also in SKILL.md — keep signal wiring on web feature gate.

WebGPU status

Godot 4.x web ships Compatibility (WebGL 2.0) only. WebGPU is not a supported production renderer — do not design around it.

JSON-RPC bridge (structured JS↔GD)

MANDATORY web_json_rpc_bridge.gd for bidirectional browser messaging.

CAUTION: Keep create_callback refs alive on the Node instance. Never interpolate untrusted JSON into eval strings.

LocalStorage anti-pattern (do not ship)

# ❌ BAD — injection + escaping bugs
JavaScriptBridge.eval("localStorage.setItem('save', '%s')" % data)

Use get_interface("localStorage") via web_local_storage_wrapper.gd.

Size optimization project.godot

[rendering]
textures/vram_compression/import_etc2_astc=true

[export]
exclude_filter="*.md,*.txt,docs/*"

Performance targets

~60 FPS mid-range browsers; limit particles/draw calls; practical download budget ~50MB with exclude filters.

COOP/COEP + HTTPS

Required for threads/SharedArrayBuffer and many secure-context APIs — host checklist in SKILL.md.

Feature gate

if OS.has_feature("web"):
    pass  # visibility pause, navigation guard, storage wrapper

Source: SKILL.md on GitHub

2 warnings16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive utilities for Godot web platform integration, including storage, clipboard access, and JavaScript interop. It employs dynamic execution techniques such as JavaScriptBridge.eval() and remote resource loading via ProjectSettings.load_resource_pack(). While these are standard practices for web exports, developers should ensure inputs to these methods are validated to prevent potential script injection or execution of untrusted code.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    2/2 files flagged

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-platform-web