一键导入
tinyworld-single-file
// Use when editing the Tiny World Builder repo, especially tiny-world-builder.html, to preserve the single-file Three.js r128 app structure and local edit/reload workflow.
// Use when editing the Tiny World Builder repo, especially tiny-world-builder.html, to preserve the single-file Three.js r128 app structure and local edit/reload workflow.
Use when changing Tiny World Builder selection placement, freehand drawing, asset clipboard, cut/copy/paste/duplicate, saved templates, or Stamps panel navigation.
Use when changing Tiny World Builder renderer setup, shadows, smoke, voxel clouds, ghost board render cost, frame loop, or GPU performance.
Use when changing Tiny World Builder API, webhook, SSE, MCP, plugin, or automation examples.
Use when changing the home island layout, edge dressing, undersides, draped banners (autoincentive sponsor flag), plane/crop-duster flight paths, banner streamers, or which side of the island is "front".
Use when changing ghost boards, multiplayer preview boards, panning, ghost visibility, jigsaw reveal, or any visibility behavior around the active Tiny World board.
Use when adding or changing persisted user state — settings defaults, audio, camera/orbit, panel positions, feature flags, and the in-app "Save Defaults" pipeline that snapshots localStorage into tinyworld-defaults.json. Also covers the inline-script regex gotcha that has burned us twice.
| name | tinyworld-single-file |
| description | Use when editing the Tiny World Builder repo, especially tiny-world-builder.html, to preserve the single-file Three.js r128 app structure and local edit/reload workflow. |
Work mainly in tiny-world-builder.html; also update vendor/three/, publish.sh, checks, docs, or skills when a change affects those durable contracts.
Core rules:
tiny-world-builder BACKUP.html if present.// -------- tools --------.setCell(x, z, opts), not direct world[x][z] writes outside initialization.vendor/three/; do not reintroduce CDN runtime scripts.tiny-world-builder / dist/LandscapeEngine.js line numbers after source edits, run npm run build so dist/index.html, dist/tiny-world-builder.html, and dist/LandscapeEngine.js are regenerated before judging the runtime.cluso/cluso-embed.js
or cluso/cluso-embed.css; the floating launcher must stay out of local and
production runtime.M.* must not be mutated per instance; clone first for unique opacity/material behavior and dispose cloned materials in disposeGroup.Validation:
npm test (syntax-checks the inline app script, parses world.schema.json, verifies embedded schema parity, checks local script/link assets, and runs the no-browser smoke guard).perl -0ne 'print $1 if m#<script>\s*(.*?)\s*</script>#s' tiny-world-builder.html | node --check.http://localhost:3000/tiny-world-builder.<script> gotcha (has burned us twice)tools/check.js extracts the main app script with this regex:
html.match(/<script>([\s\S]*?)<\/script>\s*<\/body>/);
It greedily matches from the first plain <script> through to the last
</script></body>. If you add another inline <script> block above the main
app (e.g. a defaults bootstrap), it MUST carry an HTML attribute or check.js
conflates the two scripts plus the literal </script><script> separator into
one parse target and throws Unexpected token '<'.
<script id="my-bootstrap">...</script> <!-- ✓ regex skips this -->
<script>...</script> <!-- ✗ becomes part of main app -->
For persisted runtime state (defaults pipeline, audio, camera, panel
positions, feature flags) see .codex/skills/tinyworld-runtime-state.
For island layout, sponsor banner, plane/crop-duster flight paths see
.codex/skills/tinyworld-island-and-planes.