.claude/skills/hetzner-deploy/SKILL.md
# Skill: Deploy to Hetzner Use this skill to deploy MultiMagicDungeonWeb server changes to the Hetzner VPS. ## Prerequisites - `HETZNER_API_KEY` is in `~/.zshrc` — load with `source ~/.zshrc` - SSH key at `~/.ssh/id_rsa` or `~/.ssh/id_ed25519` - Server IP: fetch via API (Step 1) ## Step 1: Get the server IP ```bash source ~/.zshrc curl -s -H "Authorization: Bearer $HETZNER_API_KEY" \ https://api.hetzner.cloud/v1/servers \ | python3 -c "import sys,json; servers=json.load(sys.stdin)['serve
npx skillsauth add dschonholtz/MultiMagicDungeonWeb .claude/skills/hetzner-deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to deploy MultiMagicDungeonWeb server changes to the Hetzner VPS.
HETZNER_API_KEY is in ~/.zshrc — load with source ~/.zshrc~/.ssh/id_rsa or ~/.ssh/id_ed25519source ~/.zshrc
curl -s -H "Authorization: Bearer $HETZNER_API_KEY" \
https://api.hetzner.cloud/v1/servers \
| python3 -c "import sys,json; servers=json.load(sys.stdin)['servers']; [print(s['name'], s['public_net']['ipv4']['ip']) for s in servers]"
If no servers exist, provision one (see Provisioning section below).
SERVER_IP="<ip from step 1>"
# Rsync server files
rsync -avz --exclude='node_modules' --exclude='.git' \
/Users/douglasschonholtz/repos/MultiMagicDungeonWeb/server/ \
root@$SERVER_IP:/opt/mmd/server/
# SSH in and restart
ssh root@$SERVER_IP '
cd /opt/mmd/server
npm install --silent
pm2 restart mmd-server 2>/dev/null || pm2 start index.js --name mmd-server
pm2 save
'
ssh root@$SERVER_IP 'pm2 status mmd-server'
ssh root@$SERVER_IP 'lsof -i :8080 | grep LISTEN'
In index.html:
const WS_URL = 'ws://<SERVER_IP>:8080'; // or wss:// with TLS
Then push index.html to GitHub.
source ~/.zshrc
curl -X POST https://api.hetzner.cloud/v1/servers \
-H "Authorization: Bearer $HETZNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "mmd-server",
"server_type": "cx22",
"location": "ash",
"image": "ubuntu-22.04",
"ssh_keys": []
}'
ash = Ashburn VA. cx22 = 2 vCPU, 4GB RAM, ~€4/mo.
ufw allow 8080/tcp on servernpm install -g pm2 on server first"type": "module")tools
# Skill: Extend the WebSocket Protocol Use this when adding a new message type. Both client and server must be updated together. ## Message flow ``` Client → Server: join, move, spell_cast, rename, [new type] Server → Client: welcome, player_join, player_leave, player_move, spell_cast, player_rename, [new type] ``` ## Step 1: Define the message before coding Document these before touching any file: - **Name**: snake_case - **Direction**: client→server, server→client, or
development
# Skill: Add a Three.js Feature to MultiMagicDungeonWeb This game is a **single monolithic `index.html`** — no build step, no bundler. Everything lives in one file. ## File structure inside index.html ``` <html> <head> ... styles ... </head> <body> <!-- HUD overlay divs: #hud, #rename-panel, etc. --> <canvas id="c"></canvas> <script type="module"> // === CONSTANTS (WS_URL, PLAYER_SPEED, HP_MAX, etc.) === // === GLOBALS (scene, camera, renderer, clock) === //
development
Creates simple Three.js web apps with scene setup, lighting, geometries, materials, animations, and responsive rendering. Use for: "Create a threejs scene/app/showcase" or when user wants 3D web content. Supports ES modules, modern Three.js r150+ APIs.
tools
# Skill: Test Multiplayer Locally Use this skill any time you need to verify multiplayer behavior in MultiMagicDungeonWeb. ## Stack - Game: `index.html` (open as `file://` — no HTTP server needed) - WS server: `server/index.js` on port 8080 - Node binary: `~/.nvm/versions/node/v22.22.0/bin/node` (shell aliases don't apply in Bash tool) ## Step 1: Start the WS server ```bash export PATH="$HOME/.nvm/versions/node/v22.22.0/bin:$PATH" cd /Users/douglasschonholtz/repos/MultiMagicDungeonWeb/server