@kentcdodds/world-builder
Build a shared 3D voxel world with friends and your AI agents, live.
README.md
64 lines · 3.0 KB · MarkdownKody World Builder
Intent
A shared 3D block world that people and their AI agents build together, live. Click Create a room, share the link, pick a block, and click to build. Then click Copy prompt for your agent, paste it into your own agent (Claude, ChatGPT or Grok connected to Kody), and ask for a castle. Everyone in the room sees it rise block by block.
It's a demo of "LLM-in-the-loop sync" with PowerSync: every block lives in Postgres, PowerSync streams changes to each browser's local SQLite database, and the 3D view renders straight from that local copy. Your own edits show up instantly, even on a flaky connection, and sync when you're back.
When to use
- You want to build with friends in the same world at the same time.
- You want to watch an agent turn a prompt ("a castle with four towers") into a structure, live.
- You want a working example of a regular web app plus agents sharing one synced dataset.
How it works
- Rooms: one click makes a room with a short, hard-to-guess link
(
/r/<code>) and a random name. You own it and can rename it by clicking the name. Anyone with the link can join. A room only syncs its own blocks. - People sign in with Kody. Each person gets a color, and others see where you're pointing.
- Agents are yours: connect your assistant to Kody (over MCP or the CLI),
paste the room's prompt, and ask for a build. Agents that can't run code on
their own machine still work through Kody's
executetool. It shows up as "Kent's Claude" (your name, its name) in the builder list and build feed. - Building: pick a block from the bottom bar and click or tap the ground or a block face. Switch to the trash tool (or right-click / shift-click) to remove. Drag to orbit, scroll or pinch to zoom.
- Fair use: coordinates stay inside the world bounds, and writes are rate-limited per person and per agent.
Setup (owner)
These are one-time steps for whoever runs a copy of this app:
- A Neon Postgres database with logical replication, the tables in
AGENTS.md, and apowersyncpublication. - A PowerSync Cloud instance connected to that database with the sync rules in
powersync/sync-rules.yaml, and this app's public key (src/lib/jwks.ts) added to its client auth. - Two Kody credentials:
- Database (provider
neon-postgres): the Postgres connection string, sent only to your Neon endpoint host. Approve the host when Kody asks. - Token signing (provider
powersync-jwt, kind Signing): the RS256 private key, limited to your PowerSync instance host.
- Database (provider
Credential values are never shown to the app or to agents.
Done when
- Create a room from the start page, open its link in a second browser, and both see each other's blocks appear within a second.
- Pasting the room's prompt into your agent and asking for a castle makes it rise live in every open browser, with the agent listed as "<your name>'s <agent>".
- The sync icon in the top bar is green.