# Codewisp Game Builder

> From a natural-language game description, scaffold a complete playable browser game as a single index.html using kaplay (kaboom.js successor) loaded via CDN — no build step, no dependencies, open in any browser.

- Skill: `riteshkew/codewisp-game-builder` (Agent Skill, multi-file: 8 files)
- Install (CLI): `npx skillmds@latest add riteshkew/codewisp-game-builder`
- Raw SKILL.md: https://api.skillmd.com/api/skills/riteshkew/codewisp-game-builder/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: riteshkew (https://skillmd.com/u/riteshkew)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/riteshkew/codewisp-game-builder

---


# Workflow

When this skill triggers, follow these steps in order.

## Step 1 — Capture the game description

Ask the user to describe their game in plain English. Good descriptions include:

- What the player controls and how (keyboard, mouse)
- What the objective is (survive, collect, reach a goal)
- What ends the game or increases the score
- Any enemies, obstacles, or power-ups

Example: "A game where you move a player left and right to dodge blocks falling from the top. Score goes up the longer you survive; getting hit ends the game."

If the user is unsure, suggest the dodge-blocks starter from `examples/input.md`.

## Step 2 — Run the engine

With `cwd` set to the skill root (`skills/codewisp-game-builder/`), run:

```bash
node scripts/gen-game.mjs <description-file> <output-html-file>
```

Or pipe the description directly:

```bash
echo "Your game description here" | node scripts/gen-game.mjs - output/index.html
```

The engine writes a single self-contained `index.html` that:

- Loads kaplay via CDN (`https://unpkg.com/kaplay@3001/dist/kaplay.js`)
- Initialises the game with `kaplay(...)`
- Defines scenes with `scene(...)` (menu, game, game-over)
- Spawns game objects matching the description
- Runs a main loop via `onUpdate(...)` with movement, scoring, and collision
- Handles keyboard input via `onKeyDown(...)`

## Step 3 — Tell the user how to play

After the file is written, instruct the user:

> Open `<output-html-file>` in any browser (double-click or drag into Chrome/Firefox/Safari).
> No server, no build step required.

## Step 4 — Iterate

Ask whether the user wants to change the game. Common refinements:

- Add a high-score tracker
- Increase difficulty over time (faster blocks, more blocks)
- Add power-ups or lives
- Change the art style (colours, shapes, sizes)

Update the description and rerun Step 2 to regenerate. The file is fully overwritten each run.

## Example

See `examples/input.md` for the dodge-blocks starter description and `examples/output/index.html` for the generated game.

Run the example yourself:

```bash
cd skills/codewisp-game-builder
bash examples/run.sh
```

The script generates `examples/output/index.html` and writes a verification report to `examples/output.md`.

