spacetimedb-workflow

spacetimedb-workflow is a cursor rule for Cursor from SeloSlav/2d-multiplayer-survival-mmorpg. It costs 15 tokens per session (1,124 once invoked), scanned A, original, Apache-2.0.

A project workflow guide for SpacetimeDB, a database system that can run multiplayer game logic and share live data with clients. It documents the commands for building, publishing, checking logs, querying data, and generating client code.

In plain words
What is it for?
Use it when changing Rust server code, publishing a local database, viewing server logs, running SQL queries, generating TypeScript bindings, or starting the client.
Why use it?
Server changes require several steps before the client can use them. This guide keeps those steps in the right order and helps avoid stale client code or an unpublished server.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is spacetime generate --lang typescript --out-dir ./client/src/generated -p ./server.

Good fit Use it when changing Rust server code, publishing a local database, viewing server logs, running SQL queries, generating TypeScript bindings, or starting the client.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/SeloSlav/2d-multiplayer-survival-mmorpg
agentmods
npx agentmods add rules/seloslav/2d-multiplayer-survival-mmorpg/spacetimedb-workflow

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spacetimedb-workflow

README.md
[![agentmods](https://agentmods.dev/badge/rules/seloslav/2d-multiplayer-survival-mmorpg/spacetimedb-workflow.svg)](https://agentmods.dev/rules/seloslav/2d-multiplayer-survival-mmorpg/spacetimedb-workflow)
Your own site
<a href="https://agentmods.dev/rules/seloslav/2d-multiplayer-survival-mmorpg/spacetimedb-workflow"><img src="https://agentmods.dev/badge/rules/seloslav/2d-multiplayer-survival-mmorpg/spacetimedb-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,124 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.01124
Opus 5 $0.00008 $0.00562
Sonnet 5 $0.00003 $0.00225
Haiku 4.5 $0.00002 $0.00112

Measured 8d ago against content hash 4a8e06f79e86, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

spacetimedb-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/spacetimedb-workflow.mdc · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SpacetimeDB Development Workflow

Essential commands and patterns for developing with SpacetimeDB in this 2D multiplayer survival game.

Core Development Commands

Server Development

# Build server (run from project root)
spacetime build -p ./server

# Publish to local database  
spacetime publish -p ./server broth-bullets-local

# View server logs
spacetime logs broth-bullets-local

# SQL query the database
spacetime sql broth-bullets-local "SELECT * FROM player LIMIT 5"

# Clear database and republish (destructive!)
spacetime publish -c -p ./server broth-bullets-local

Client Development

# Generate TypeScript bindings (CRITICAL after server changes)
spacetime generate --lang typescript --out-dir ./client/src/generated -p ./server

# Start client development server
npm run dev

Essential Workflow Pattern

1. Making Server Changes

  1. Edit server Rust files in server/src/
  2. Test build: spacetime build -p ./server
  3. Publish: spacetime publish -p ./server broth-bullets-local
  4. Generate client bindings: spacetime generate --lang typescript --out-dir ./client/src/generated -p ./server

2. Making Client Changes

  1. Update client TypeScript files in client/src/
  2. Restart dev server if needed: npm run dev

3. Testing Full Stack

  1. Server logs: spacetime logs broth-bullets-local
  2. Browser console for client errors
  3. Database inspection: spacetime sql broth-bullets-local "SELECT * FROM {table}"

Key Files & Patterns

Server-side Key Files

Client-side Key Files

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 143 lines · 15 tokens per session scan A 4a8e06f79e86

Subscribe to this mod's changes

spacetimedb-workflow is a cursor rule published in the GitHub repository SeloSlav/2d-multiplayer-survival-mmorpg (177 stars, last pushed 20d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,124 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.