.claude/skills/spell-template/SKILL.md
# Skill: Add a New Spell The `SPELL_DEFS` registry in `index.html` is the single source of truth for all spells. ## Step 1: Add to SPELL_DEFS ```javascript const SPELL_DEFS = { fireball: { color: 0xff6600, size: 0.8, speed: 22, maxLifeMs: 1333, cooldownMs: 666, icon: '🔥', label: 'Fireball', key: '1' }, frostbolt: { color: 0x44aaff, size: 0.6, speed: 14, maxLifeMs: 2000, cooldownMs: 1000, icon: '❄️', label: 'Frostbolt', key: '2' }, telekinesis: { color: 0xaa44ff, size: 1.0
npx skillsauth add dschonholtz/MultiMagicDungeonWeb .claude/skills/spell-templateInstall 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.
The SPELL_DEFS registry in index.html is the single source of truth for all spells.
const SPELL_DEFS = {
fireball: { color: 0xff6600, size: 0.8, speed: 22, maxLifeMs: 1333, cooldownMs: 666, icon: '🔥', label: 'Fireball', key: '1' },
frostbolt: { color: 0x44aaff, size: 0.6, speed: 14, maxLifeMs: 2000, cooldownMs: 1000, icon: '❄️', label: 'Frostbolt', key: '2' },
telekinesis: { color: 0xaa44ff, size: 1.0, speed: 18, maxLifeMs: 1667, cooldownMs: 1500, icon: '🔮', label: 'Telekinesis', key: '3' },
// New spell:
lightning: { color: 0xffff44, size: 0.4, speed: 40, maxLifeMs: 600, cooldownMs: 400, icon: '⚡', label: 'Lightning', key: '4' },
};
| Field | Type | Description | |---|---|---| | color | hex int | Projectile color | | size | float | Sphere radius | | speed | float | Units/second | | maxLifeMs | int | Ms before expiry | | cooldownMs | int | Ms between casts | | icon | string | Emoji for HUD | | label | string | Display name | | key | string | Keyboard key ('1'–'9') |
In server/lib/MessageHandler.js:
_onSpellCast(ws, msg) {
const ALLOWED = ['fireball', 'frostbolt', 'telekinesis', 'lightning']; // add here
if (!ALLOWED.includes(msg.type)) return;
// ...
}
test-multiplayer/SKILL.md)SPELL_DEFS.keyAdd a behavior field and handle it in MmdSpell.update(dt):
// SPELL_DEFS entry:
homing: { ..., behavior: 'homing' }
// MmdSpell.update(dt):
update(dt) {
if (this.def.behavior === 'homing' && this.target) {
const dir = this.target.position.clone().sub(this.mesh.position).normalize();
this.direction.lerp(dir, dt * 3);
}
this.mesh.position.addScaledVector(this.direction, this.def.speed * dt);
this.lifeMs += dt * 1000;
return this.lifeMs > this.def.maxLifeMs;
}
Attach sub-mesh to this.mesh in MmdSpell constructor, update in update(dt), dispose via scene.remove + .dispose() on expiry. Keep effect geometry cheap — under 50 tris per spell in flight.
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