Skip to content
Browse documentation

Project structure and configuration

Understand the files in a generated game, configure its listing, and keep source, secrets, and build output separate.

View Markdown
On this page

Find the file you need

Typical generated project; optional tools add more files
my-game/
├── src/
│   ├── main.ts
│   └── score.ts
├── public/media/cover.svg
├── spawnkit/config.ts
├── spawnkit/vite.ts
├── spawnkit.config.ts
├── game.config.json
├── dev-domains.config.mjs
├── vite.config.ts
├── package.json
├── tsconfig.json
└── .spawn/state.json
File or folderResponsibility
src/Game source. The renderer and selected modules determine its exact structure.
public/Static files copied to the build without import processing.
game.config.jsonVersioned scaffolding manifest; not the public game listing.
spawnkit.config.ts or spawnkit.config.jsonOne configuration for title, description, genre, dimension, and release-relative media paths.
spawnkit/Local listing types, validation, and Vite plugin. No private package required.
dev-domains.config.mjsNamed local HTTPS endpoints.
.spawn/state.jsonGenerator ownership baseline used for safe module additions.
.spawn/project.jsonCreated by CLI linking; associates this folder with a hosted project.
pnpm-lock.yamlCreated by installation. Commit it for reproducible installs and source deployment.
dist/Generated browser build. Rebuild instead of editing these files.

Run the project's scripts

Install, develop, and validate
pnpm install
pnpm dev
# Stop the development server before continuing.
pnpm lint
pnpm build
pnpm preview

build checks TypeScript and creates the Vite production output. preview serves that output locally. Test, E2E, and Storybook scripts exist only when their add-ons are selected; inspect package.json before using them. Generated projects and hosted source builds currently use pnpm.

Asset paths from source to release

Static file mapping
public/media/cover.webp → dist/media/cover.webp
Listing coverPath: media/cover.webp
Browser URL: /media/cover.webp

Use public/ for assets that need a stable filename. Assets imported from source are processed by Vite and may receive hashed filenames. Keep listing media under public/ so their release-relative paths remain predictable. Match filename capitalization exactly; hosted files are case-sensitive.

For a full listing configuration and ZIP commands, see Publishing examples.

Local environment and public configuration

Optional .env override
SPAWN_GAME_DOMAIN=my-game.spawnkit.games

No domain override is needed for local development. If you set SPAWN_GAME_DOMAIN, use your project's assigned production hostname, not an arbitrary custom name. Verified CLI linking normally supplies the assigned hostname automatically. Run pnpm exec dev-domains urls to see the addresses and pnpm exec dev-domains doctor to diagnose local setup.

Changing the listing configuration requires a new production build. Changing .spawn/project.json by hand is not an authorization mechanism; use the CLI link flow to verify account access.

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