Commit your working game or make a separate backup before changing modules. Record what currently passes: lint, build, installed tests, and a short playthrough. Keep game.config.json, .spawn/state.json, and your lockfile; they describe the generated project and its dependency state.
git status --short
pnpm lint
pnpm build
If the folder is not a Git repository, use your backup workflow instead of the Git command. Do not delete edited files to make an addition succeed.
pnpm dlx @spawnkit/cli addons --json
pnpm dlx @spawnkit/cli add vitest --dry-run
The ownership record lets SpawnKit compare the original generated file, the new generated file, and your current file. Compatible JSON fields can be merged; conflicting edits stop the operation. The CLI does not switch renderers through pnpm dlx @spawnkit/cli add.
pnpm dlx @spawnkit/cli add vitest
pnpm install
git diff --stat
git diff
Review and accept the CLI confirmation before installation. In automation, pass --yes only after reviewing a resolved dry run. Review source and configuration changes, not just the file count. Keep your game-specific logic, listing, and user-written AGENTS.md instructions. Commit the updated lockfile with the addition. --yes accepts a resolved plan; it cannot force an overwrite of conflicting edits.
| Problem | Safe next step |
|---|
| Edited file conflicts with the new module | Read the proposed changes, compare against a separate generated project, and merge intentionally. |
|---|
| Incompatible selected add-ons | Inspect pnpm dlx @spawnkit/cli addons and the dry run. Use --replace <names> only when you intend to replace those components. |
|---|
| Missing or unsupported ownership record | Run the command from your generated project root. Do not fabricate or edit .spawn/state.json. |
|---|
| Different renderer desired | Create a new project and port game logic and assets deliberately. |
|---|
pnpm dlx @spawnkit/cli init comparison-game --add phaser,vitest --dry-run
pnpm dlx @spawnkit/cli init comparison-game --add phaser,vitest
Choose your actual renderer and modules; the example uses Phaser. The destination must not already exist. A comparison project is a reference, not a replacement for the original.
pnpm lint
pnpm test
pnpm build
pnpm preview
Play through existing behavior and the feature you changed. If the checks pass, review the diff and save the new baseline. Follow Publishing an update to target the same hosted project.
If the addition fails verification, preserve any new work before restoring your known-good baseline. Reinstall from the restored lockfile and repeat the checks. Hosted rollback is a separate operation; it restores retained release artifacts and does not undo database migrations.