Instructions for AI coding assistants (GitHub Copilot, Cursor, etc.) working with this codebase.
Hyperia requires WebGPU. WebGL WILL NOT WORK.
This is a hard requirement. DO NOT:
- Add WebGL fallback code
- Use
--disable-webgpuflags - Use
forceWebGLparameters - Create headless Chrome configurations without GPU/WebGPU support
- Suggest WebGL as an alternative
- All materials use TSL (Three Shading Language) which ONLY works with WebGPU
- Post-processing effects use TSL-based node materials
- There is NO WebGL fallback path - the game simply won't render
- Chrome 113+, Edge 113+, Safari 17+
- WebGPU must be available and working
- NVIDIA GPU with Vulkan support is REQUIRED
- Must run headful with Xorg or Xvfb (NOT headless Chrome)
- CRITICAL LINUX NOTE: It is important on Linux to use Chrome Canary and the ANGLE backend, NOT Vulkan (
--use-vulkan). Using the native Vulkan backend with WebGPU will crash. - CRITICAL MAC NOTE: It is important on macOS to use Google Chrome with the Metal backend for ANGLE (
--use-angle=metal). - If WebGPU cannot initialize, deployment MUST FAIL
Hyperia is a classic fantasy MMORPG built on Three.js WebGPURenderer with TSL shaders.
Never put private keys, seed phrases, API keys, tokens, RPC secrets, or wallet secrets into any file that could be committed.
- ALWAYS use local untracked
.envfiles for real secrets - NEVER hardcode secrets in source files, tests, docs, JSON fixtures, scripts, config files, or workflow YAML
- NEVER put real secrets in
.env.example; placeholders only - If a secret is needed in production or CI, use the platform secret store, not a tracked file
- If a task requires a new secret, document the variable name and load it from
.env,.env.local, or deployment secrets
- No
anytypes - ESLint will reject them - WebGPU only - No WebGL code or fallbacks
- No mocks in tests - Use real Playwright browser sessions
- Bun package manager - Use
bun install, not npm - Strong typing - Prefer classes over interfaces
- Secrets stay out of git - Real keys must only come from local
.envfiles or secret managers
- Runtime: Bun v1.1.38+
- Rendering: WebGPU ONLY (Three.js WebGPURenderer + TSL)
- Engine: Three.js 0.180.0, PhysX (WASM)
- UI: React 19.2.0
- Server: Fastify, WebSockets
- Database: PostgreSQL (production), SQLite (local)
bun install # Install dependencies
bun run build # Build all packages
bun run dev # Development mode
npm test # Run testspackages/
├── shared/ # Core engine (ECS, Three.js, networking)
├── server/ # Game server (Fastify)
├── client/ # Web client (Vite + React)
├── physx-js-webidl/ # PhysX WASM bindings
└── asset-forge/ # AI asset generation
See CLAUDE.md for complete documentation.