spawn_init
Provision the project directory for a Spawn world: detect the engine version, then clone the git repository or scaffold a pre-6.0 project.
Instructions
Provision the project directory for this world — what that means depends on the engine, and this detects it. On engine 6.0+ (the git lane) the world's code IS a git repository: this CLONES it into projectDir (the agent token is the git password, supplied per-command and never written to .git/config), fetches the spawn notes ref, keeps .env and .spawn/ out of the tree via .git/info/exclude, and saves the docs. A non-empty directory that is not already this world's clone is refused rather than cloned over. On a pre-6.0 world (the document lane) it scaffolds as before: gitignore secrets, world/ + scripts/, pull current spec → game.json, materialize scripts. Either way the docs land in .spawn/ (guide.md, tome-api.md, skills.json).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Engine 6.0+ only: how many commits of history to clone (default 20). A live world's full history is tens of thousands of objects and may not finish fetching at all, and nothing here needs it — editing, committing and pushing all work from the tip. Pass 0 for the full history (slow, and the only way to get `git log --notes=spawn`). | |
| projectDir | No | Absolute path to the Spawn game project (game.json / .env). Defaults to SPAWN_PROJECT_DIR or the MCP process cwd. | |
| engineVersion | No | Optional engine version this call assumes: a semver ('6.0.0', '5.4') or an era name ('6.0' for a git world, 'document' for a pre-6.0 one). Omit it and the world's engine is detected from the API and cached. When passed it is CHECKED against the real pin and a mismatch fails the call without writing anything — it is an assertion, not an override. |