Skip to content
Browse documentation

Extend your game

Add mechanics, replace artwork, and evolve your project without losing the work you already have.

View Markdown
On this page

Understand your project

A downloaded SpawnKit game is a standalone project. You can work on it with your editor and the packages it already includes; you do not need the SpawnKit repository.

  • Read AGENTS.md for the project's instructions.
  • Check package.json for the installed engine, dependencies, and scripts.
  • Read game.config.json for the original kit configuration.
  • Start at src/main.ts, then follow its imports into the game logic.

Before a larger change, save a Git commit or copy your game folder to a separate backup location. Keep existing artwork, saves, and local configuration. For generated tools, use Add tools and modules; for verification, see Testing and debugging.

Build one playable change at a time

Choose a small outcome you can test: a new collectible, a different movement speed, an obstacle, or a score display. Use the rendering engine already installed in the project.

  1. Run pnpm dev and establish that the current game works.
  2. Make the smallest change that produces the behavior you want.
  3. Try it in the browser with real input, including its failure or reset state.
  4. Run the project's checks, then save that working version before the next change.

Add tools that fit your stack

Use the kit builder to explore supported rendering, physics, UI, and testing combinations. The versioned catalog exposes those same compatibility rules for agents and tools.

A new kit download is a separate project, not an update to your existing folder. Compare its configuration and source before moving changes across. Physics kits provide example scenes you can extend, rather than finished controllers for every genre.

Check the result

Terminal · core checks
pnpm lint
pnpm build

Run pnpm test and pnpm e2e if those scripts exist in package.json. Tests prepare Chromium automatically when they start. See Test environment setup for CI and setup troubleshooting.

  • Exercise keyboard, pointer, and touch controls that your game claims to support.
  • Check the game at a narrow phone size and a wide desktop size.
  • Reload and check any saved progress.
  • Test the built game with pnpm preview, using the address printed in the terminal.

Add modules with @spawnkit/cli

Inspect the available commands for your installed version. Preview a change before applying it.

Terminal · inspect and preview
pnpm dlx @spawnkit/cli add --help
pnpm dlx @spawnkit/cli addons --json
pnpm dlx @spawnkit/cli add vitest --dry-run --json

Review the plan for dependencies, files, and conflicts. Apply a resolved plan only when it matches the change you want. The generator protects modified files; if it reports a conflict, compare the affected files and resolve it explicitly.

Keep .spawn/state.json. It records the generator's file baseline; deleting it or replacing edited files to force an update removes that protection. Existing AGENTS.md instructions are preserved during module additions.

Need a hand? Get support

Explore the guides

Build your first game

Download a standalone game kit, run it locally, and make your first change.

Create and build a game with @spawnkit/cli

Start in a parent folder, generate your game, then run every development command inside the new game folder.

Upload an existing browser game

Upload a self-contained browser build. Your original source, engine, and build tools can stay as they are.

Publish your game

The dashboard accepts a ZIP of your built game. You will need an account to deploy it.

Use the SpawnKit dashboard

The dashboard manages your hosted games. Your editor or AI agent remains where you change and build your game source.

Make a browser game with Codex

Use Codex with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Claude Code

Use Claude Code with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Cursor

Use Cursor with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Extend your game

Find the right files, make a focused change, and check it in a playable build.

A complete publishing example

Follow a small example from editable source to a ZIP with index.html at its root. Use your own game title, description, and artwork.

Add tools to an existing game

Keep a recoverable baseline, inspect the proposed changes, and verify one addition at a time.

Test and debug your game

Combine automated checks with a short playthrough of the production build. A successful build alone does not verify gameplay.

Project structure and configuration

Your downloaded kit is a standalone TypeScript project. Its files belong to you and do not depend on the SpawnKit repository.

SpawnKit CLI reference

A command-by-command reference to the implemented CLI. Local generation works without an account; hosted operations require access to a project.

Accounts and access

Building locally is account-free. Publishing requires an account with access to the target project.

Agents and API resources

Public discovery endpoints are account-free. Use the dashboard or @spawnkit/cli for publishing.

16 guides available