unity
Skill by clockworklabs
Integrates SpacetimeDB into Unity game projects with MonoBehaviour patterns for the connection lifecycle, frame ticking, and token persistence. It is for developers building Unity clients for SpacetimeDB 2.0.
Install unity
Built from the published package, never by AI.
git clone --depth 1 https://github.com/clockworklabs/SpacetimeDB /tmp/SpacetimeDB && mkdir -p ~/.claude/skills && cp -r /tmp/SpacetimeDB/skills/unity ~/.claude/skills/unityRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/clockworklabs/SpacetimeDB /tmp/SpacetimeDB && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/SpacetimeDB/skills/unity ~/.gemini/antigravity-cli/skills/unityAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The unity skill gives AI assistants Unity-specific patterns for connecting a Unity game client to SpacetimeDB. It covers installing the SDK through the Unity Package Manager git URL, generating C# module bindings with spacetime generate, and a SpacetimeManager MonoBehaviour singleton that owns the connection. It also covers calling reducers from UI code, registering row callbacks, and reading the local client cache.
The skill stresses that FrameTick must run every frame in Update, that SDK calls stay on the main thread, and that DontDestroyOnLoad keeps the connection across scene loads. It explains automatic reconnect with backoff and PlayerPrefs token persistence so a player keeps the same identity. It is aimed at developers building Unity clients for SpacetimeDB 2.0. Server-side module work is pointed to the separate csharp-server skill.
Written from the project's SKILL.md and checked against it.
What it can do
- Connection singletonSets up a SpacetimeManager MonoBehaviour that builds and owns the DbConnection.
- Frame tickingCalls FrameTick in Update so queued network messages and callbacks are processed.
- Binding generationGenerates C# module bindings with spacetime generate into the Unity Assets folder.
- Row callbacksRegisters OnInsert, OnDelete and OnUpdate callbacks to spawn, remove or update GameObjects.
- Reducer calls from UIShows how UI scripts call reducers and handle Committed, Failed and UnknownResult status.
- Client cache readsCovers finding rows by primary key, iterating tables, filtering by index and counting rows.
- Automatic reconnectExplains WithAutomaticReconnect, backoff settings and how subscriptions are replayed after an outage.
- Token persistenceSaves the server-issued token in PlayerPrefs and reuses it to keep the same identity.
What you need
- SpacetimeDB 2.0
- Unity 2022.3 or later
- Unity Package Manager access to the git URL for the SDK
Try asking
- Set up a SpacetimeManager singleton that calls FrameTick in Update
- Add automatic reconnect with a token provider to my Unity client
- Save the SpacetimeDB token in PlayerPrefs and reuse it on reconnect
Good to know
- FrameTick and all SDK calls must run on the Unity main thread.
- Self-issued identities are meant for development; production should use an OIDC provider such as SpacetimeAuth.
- Views with arguments require SpacetimeDB 2.13 or later.
- Pending reducer calls may report UnknownResult and are not replayed.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/unity/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to unity
All alternatives →Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.
Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.
Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.
Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.
Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.
Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.
Compare with hugging-face-datasets, db-repair or alloydb-basics
unity: common questions
Why does my Unity client show no updates?
FrameTick must be called every frame in Update(). The SDK queues network messages and only processes them when FrameTick runs, so without it no callbacks fire.
Does a saved token keep the same identity?
Passing the saved server-issued token back on reconnect keeps the same identity. Without a saved token, the server issues a new identity in the OnConnect callback.
Does the connection survive a scene change?
Use DontDestroyOnLoad on the SpacetimeManager. The skill says that without it the connection drops every time a new scene loads.
How do I install unity?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is unity free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is unity safe to use?
It scores 84 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to unity?
Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.
