Generated banner for Build Threejs Enemy Systems
Generated logo for Build Threejs Enemy Systems

Build Threejs Enemy Systems

Meng ToCommunityCreated by Meng To

  • Skill
  • Workflow
  • Software development
  • MIT
  • No issues found

From the author

Build or refactor reusable, data-driven enemy archetype and moveset systems for Three.js action games. Use for enemy content schemas, model and rig conventions, combat move timing and contact contracts, runtime state boundaries, placeholder fallbacks, deterministic fixtures, or production playthrough validation.
— the description by Meng To

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a framework for decoupling enemy content from runtime logic in Three.js games. By treating enemies as portable, data-driven definitions, developers can separate AI decision-making, combat resolution, and visual presentation. The system emphasizes strict normalization of assets, deterministic move definitions, and robust fallback mechanisms to ensure consistent gameplay behavior across different enemy types and platforms.

What it does

  • Defines a schema for separating immutable enemy definitions from mutable runtime state.
  • Establishes a normalization contract for 3D models, rigs, and colliders.
  • Structures combat moves as data-driven definitions with specific timing and state rules.
  • Provides guidelines for implementing honest placeholders when production assets are missing.
  • Outlines a validation process using deterministic fixtures and automated testing.
  • Ensures consistent behavior across desktop and mobile environments.

When to use it

  • When designing the architecture for a new action game using Three.js.
  • When refactoring existing enemy code to improve modularity and reusability.
  • When you need to ensure combat mechanics remain consistent regardless of the visual model used.
  • When preparing a game for multi-platform deployment requiring stable performance and LOD management.

Advantages

  • Reduces code duplication by sharing runtime systems across multiple enemy archetypes.
  • Improves maintainability by isolating content definitions from game logic.
  • Facilitates easier debugging through deterministic fixtures and validation checks.
  • Ensures visual and mechanical consistency via strict asset normalization contracts.

Usage examples

“How do I define a new enemy archetype in my Three.js game?”
The agent will guide you through creating a new data definition that includes base stats, move IDs, and AI hints, ensuring it adheres to the established schema before integrating the model.
“How should I handle combat move timing for a new enemy attack?”
The agent will explain how to define the move as data, specifying startup, active windows, recovery, and cooldowns, while ensuring the combat system owns the timing rather than the animation.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/mengto/build-threejs-enemy-systems/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip build-threejs-enemy-systems.zip -d .agents/skills

Documentation by Meng To

Build Three.js Enemy Systems

Make each enemy a portable authored definition consumed by shared runtime systems. Keep AI choice, combat resolution, rendering, and feedback as separate consumers of the same stable contract.

Separate content from runtime state

  • Put stable IDs, role/tags, base stats, presentation spec, move IDs, AI hints, feedback hook IDs, rewards, and variant data in immutable authored definitions.

  • Put instance ID, transform, health/posture, target, current move and phase clock, cooldowns, statuses, pathing, visibility, and LOD state in runtime instances.

  • Reference definitions by ID. Reject duplicate IDs, missing references, invalid ranges, or impossible timing during content validation.

  • Never mutate authored definitions, store live timers in content, or duplicate the combat clock across AI, animation, and rendering.

Normalize presentation contracts

Define these fields before integrating a model:

  • source or factory ID, provenance, coordinate system, forward axis, and meters-per-unit;

  • root pivot at ground contact, normalized scale, facing offset, and visual height;

  • simple movement collider plus named hurtboxes, independent of render geometry;

  • stable sockets for contact origins, weapons, projectiles, VFX, audio, UI markers, and targeting;

  • rig and semantic clip map for idle, locomotion, moves, reactions, and death;

  • LOD tiers with hysteresis, animation/update policy, and unchanged gameplay colliders.

Normalize at the asset boundary. Do not scatter scale fixes, pivot offsets, raw clip names, or compensating rotations through gameplay code.

Define moves as data

For every move, define:

  • stable ID, AI tags, eligibility range/angle/line-of-sight, weight, and state prerequisites;

  • startup and telegraph, one or more active windows, recovery, cooldown, and minimum commitment;

  • movement, facing, cancellation, armor, interrupt, stagger, and phase rules;

  • contact shape/socket, damage, posture, knockback, status, and per-target hit limits;

  • semantic animation, VFX, and audio hook IDs with cleanup rules.

Let AI select only legal move IDs; let the combat system own timing and outcomes. Resolve damage from authoritative collision/contact events using stable action and target identifiers. Apply each contact once, then drive animation, VFX, audio, and UI from the resolved event.

Provide an honest fallback

When a production model is unavailable, use a deliberate placeholder that preserves footprint, height, pivot, collider, sockets, facing, move timing, and state readability. Log the fallback once and keep it visually unmistakable. Never silently substitute a mismatched asset or call placeholder visuals production-ready.

Add a new enemy

  1. Existing archetype and moves fit? Configure a new definition; do not add runtime branches.

  2. A new behavior is essential? Add the smallest reusable move, hook, or AI tag before adding a new subsystem.

  3. Model ready? Normalize it to the shared presentation contract; otherwise use the honest fallback.

  4. Content complete? Validate references, timing, contact, cooldown, recovery, interrupts, and feedback hooks.

  5. Proof ready? Add deterministic fixtures and automated tests, then run desktop and mobile playthroughs.

Prove the system

  • Create deterministic fixtures for spawn, each move phase, wrong range/direction, obstruction, interrupt, stagger, death/reset, missing-model fallback, LOD transitions, and multiple instances sharing one definition.

  • Test content uniqueness and references, active-window boundaries, cooldown/recovery, per-target hit deduplication, lifecycle cleanup, and pause/frame-step behavior.

  • Play a representative encounter in the repository-approved browser. Confirm telegraphs, contact, state, animation, VFX/audio, targetability, and rewards agree.

  • Verify desktop and mobile camera distance, touch controls, reduced motion, console health, frame time, draw calls, memory stability, and crowded-scene LOD behavior. Report baseline failures separately.

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Meng To
Publisher
Meng To (Community)
Source
MengTo/Skills · agent-skills/game-development/build-threejs-enemy-systems · commit 5ea1661
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Meng To or Meng To.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download build-threejs-enemy-systems.zip