.claude/skills/code-quality/SKILL.md
Code quality standards and review checklist for MultiMagicDungeonWeb
npx skillsauth add dschonholtz/MultiMagicDungeonWeb code-qualityInstall 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.
MmdPascalCase (MmdPlayer, MmdSpell, MmdPortal)SCREAMING_SNAKE in the === CONSTANTS === block at top of filecamelCase// === SECTION NAME === before every logical group// === GAME STATE === sectionconst over let; never varconsole.log in production paths (use console.warn for recoverable errors)try/catch on all JSON.parse callsws?.readyState === WebSocket.OPEN_geoCache / _matCache (no per-instance GPU alloc for projectiles)map.dispose() before reassigningdt, never use raw frame counts<area>: <what changed> (e.g. player: fix lerp clamp overshoot)Always run grep -c "<<<<<<" index.html before committing. A session once committed <<<<<< merge markers to main — the game broke for every user with a SyntaxError. The session said "merge complete" without checking the actual file content.
Always run node --check index.html before committing. This catches SyntaxError before the browser does.
Never allow two sessions to edit index.html simultaneously. This is the single-file monolith — parallel sessions WILL produce merge conflicts. Coordinate work so only one session touches index.html at a time. If a concurrent edit already happened, resolve conflicts and run the full pre-commit checklist before pushing.
When Claude Code runs in a git worktree, node --check and grep operate on the worktree copy of index.html, not the file the HTTP server is serving (which is from the main repo). A clean worktree does NOT mean a clean main. After merging a worktree branch, always verify the served file:
grep -c "<<<<<<" /path/to/main/repo/index.html
node --check /path/to/main/repo/index.html
"Pushed and working" requires: loading the page in a browser AND reading the console AND confirming no exceptions. Checking git status or the worktree file is not sufficient. Multiple sessions have shipped broken code by skipping this step.
See threejs-feature/SKILL.md → Target Module Architecture
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