🚂🤖 LittleJS AI
An AI-assisted toolkit for making HTML5 games with LittleJS — starter templates, helper modules, agent instructions for any coding AI, and a Claude Code plugin. The games built with it live in the LittleJS Arcade.
LittleJS is a fast, lightweight, and fully open source HTML5 game engine designed for simplicity and performance.
This repo is the AI-assisted LittleJS toolkit — everything you need to build games, but not the games themselves:
- starter templates you can fork and remix
- helper modules for menus, sound/FX, and sprites
- docs and prompts to improve LittleJS + AI workflows
The 50+ finished games built with these tools live in their own repo: the LittleJS Arcade (source).
Want to make a game without writing code? Try the LittleJS GPT!
🤖 Claude Code Plugin
Make games with LittleJS, a fast open-source HTML5 engine that's simple to build on, straight from Claude Code. Ask for a game and get a complete, playable project that opens from a file. Because the engine already handles rendering, input, physics, collision and audio, nothing gets rebuilt from scratch: the tokens go into your game, not the plumbing. Templates for menus, sound, sprite art and board games already work. Install once, no clone required:
/plugin marketplace add KilledByAPixel/LittleJS-AI
/plugin install littlejs@littlejs-ai
Then in any empty folder, ask for a game ("make me a breakout game"). Claude scaffolds a complete project — engine included — that opens straight from file:// with no server and no npm install.
The plugin ships five skills:
littlejs-conventions — engine rules and pitfalls, applied automatically to any LittleJS code
new-littlejs-game — scaffolds a complete playable game project
littlejs-api — exact API signature lookup from the bundled reference
atlas-shape-art — fast recolorable shape sprites from the built-in atlas
custom-level-editor — turns the engine's built-in 2D and 3D level editors into an editor for your game
Cloning this repo is only needed for browsing the templates by hand — the plugin bundles everything else.
Developing the plugin itself? Load it from your working tree with claude --plugin-dir . (use forward slashes in the path — backslashes get mangled and silently load nothing), then /reload-plugins after edits. Don't /plugin install your local copy — that installs a frozen snapshot.
Every user-visible change needs two things in the same commit: a bumped version in .claude-plugin/plugin.json and an entry in CHANGELOG.md. The plugin cache is keyed by version, so without a bump, people who already installed the plugin receive nothing. When bumping the engine in dist/, also copy the engine repo's REFERENCE.md over reference.md and its EDITOR.md over skills/custom-level-editor/EDITOR.md.
For other tools, LittleJS also works great with GitHub Copilot, Codex, and Cursor.
LittleJS and everything in this repository is MIT licensed! See LICENSE for details.
📚 Resources
🛠️ Make Your Own
Clone the repo and you have everything you need to build games — from quick prototypes to large, multi-file projects. No external assets and no dependencies to play; the only npm packages are optional build tools.
Start a new game
- Copy the starter folder examples/emptyGame/ to
examples/<yourGame>/.
- Edit
game.js — and add more files (player.js, ui.js, constants.js, …) as the game grows.
- Open
index.html in a web browser. That's it — it runs straight from file://, no server needed.
Games use the global LittleJS API: load dist/littlejs.js with a plain <script> tag and call globals like engineInit, drawText, and vec2 directly. Keep gameplay modular across several .js files for medium and large games.
Ship a single-file build (optional)