# Make a browser game with Cursor

Set up a SpawnKit game in Cursor, give the agent project context, make a playable change, and verify the production build.

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

<a id="get-kit"></a>

## 1. Start with a standalone game

Download a kit from the [starter builder](https://spawnkit.cloud/templates) and extract it into a new folder, such as `my-game`. Install Node.js 24 or newer and pnpm 12. Open the folder containing `package.json`, `src/`, and `AGENTS.md`. Local development needs no SpawnKit account. Follow [tool installation and version checks](https://spawnkit.cloud/docs/getting-started#before-you-start) if Node or pnpm is missing. Paste shell commands into a terminal opened in the game folder.

**Run inside the extracted game folder**

```sh
pnpm install
pnpm dev
```

Open the address printed in the terminal and check the starter scene works. This gives you a working version to compare against. Keep that terminal running while the agent edits; open a second terminal in the same game folder for checks. [CLI creation](https://spawnkit.cloud/docs/create-with-cli) is an alternative to downloading the kit.

<a id="agent"></a>

## 2. Open the game in Cursor

Open the extracted game folder in Cursor and start an Agent conversation for that codebase. Select the actual game folder containing package.json, rather than its parent downloads folder. Ask Agent to inspect the project before changing it.

See the [official Cursor setup guide](https://cursor.com/docs/agent/overview) for installation and sign-in. Your agent account is separate from a SpawnKit hosting account.

If the agent cannot reach the package registry or write to the package cache, run `pnpm install` in your own terminal inside the game folder, then ask it to continue. This also applies to access-denied errors for `pnpm-store-operation-locks`. Keep pnpm and the existing lockfile; switching package managers does not fix an agent's permissions. If browser tests need Chromium, run `pnpm test:setup` in that terminal too.

If the agent cannot open a documentation URL, open the guide in your browser and use Copy as Markdown to share it. Keep network and sandbox protections enabled; report blocked steps separately from completed checks.

Cursor supports AGENTS.md project instructions and more detailed .cursor/rules files. The generated AGENTS.md is a useful starting point. Keep additional rules specific to your game's conventions and avoid introducing a different framework or build tool by default.

See the [official project-instruction documentation](https://cursor.com/docs/rules) for details.

<a id="context"></a>

## 3. Give the agent the right context

**First task to paste into your agent**

```text
Read AGENTS.md, README.md, and package.json in this game folder.
Explain how to run the game and which engine it uses.
Change collectible scoring from one point to five points.
Keep the existing engine, controls, and project structure.
Update the relevant tests, run the available checks, and report results.
Show me what changed and how to verify the score in the game.
```

Ask it to read `AGENTS.md`, `README.md`, and `package.json`, identify the selected engine, and explain where input, simulation, rendering, and score updates live. Share the [project structure guide](https://spawnkit.cloud/docs/project-structure) when it needs orientation. It should use the existing game scripts and preserve your engine and local configuration.

Describe one concrete change, such as awarding five points per collectible. State what the player should see, which behavior must stay the same, and how you will check it. Ask for a focused change and a summary of affected files. Do not ask the agent to regenerate over an existing game.

<a id="verify"></a>

## 4. Review and play the change

**Inside the game folder**

```sh
pnpm lint
pnpm build
pnpm preview
```

Run `pnpm test` too if the game includes that script. Ask the agent to report which checks actually ran and their results. Open preview yourself and verify the change in gameplay; a passing build does not prove the controls or scoring work.

Review the changed files in your editor and ask the agent to explain anything unclear. Save a Git commit, or stop the development server and copy the project to a separate backup folder before the next feature. Keep changes inside this game folder.

<a id="publish"></a>

## 5. Share the finished game

Build again after your final edits. Follow [Publish your game](https://spawnkit.cloud/docs/publishing) to upload the contents of dist, or [Upload an existing game](https://spawnkit.cloud/docs/upload-existing-game) for a different browser export. Browser upload creates a new project. For an already-hosted game, follow [Publishing an update](https://spawnkit.cloud/docs/publishing-examples#updates) instead. Verify the live game after deployment.
