From 80f6a5a1ff6462762ff437a45620416e540accbd Mon Sep 17 00:00:00 2001 From: rain Date: Thu, 18 Jun 2026 08:10:12 -0400 Subject: [PATCH] docs: align skill guidance with reducer context docs --- skills/concepts/SKILL.md | 2 +- skills/csharp-server/SKILL.md | 2 +- skills/rust-server/SKILL.md | 2 +- skills/typescript-server/SKILL.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/skills/concepts/SKILL.md b/skills/concepts/SKILL.md index 402a1a8ff18..9c4195fc1bd 100644 --- a/skills/concepts/SKILL.md +++ b/skills/concepts/SKILL.md @@ -20,7 +20,7 @@ SpacetimeDB is a relational database that is also a server. It lets you upload a ## Critical Rules 1. **Reducers are transactional.** They do not return data to callers. Use subscriptions to read data. -2. **Reducers must be deterministic.** No filesystem, network, timers, or random. All state must come from tables. +2. **Reducers must be deterministic.** Do not use filesystem, network, external clocks, or external random sources in reducers. Use `ReducerContext` for SpacetimeDB-provided timestamp and deterministic random values. 3. **Read data via tables/subscriptions**, not reducer return values. Clients get data through subscribed queries. 4. **Auto-increment IDs are not sequential.** Gaps are normal, do not use for ordering. Use timestamps or explicit sequence columns. 5. **`ctx.sender` is the authenticated principal.** Never trust identity passed as arguments. diff --git a/skills/csharp-server/SKILL.md b/skills/csharp-server/SKILL.md index 05f353d5802..82fdab5cfd8 100644 --- a/skills/csharp-server/SKILL.md +++ b/skills/csharp-server/SKILL.md @@ -203,7 +203,7 @@ public partial struct TickTimer [SpacetimeDB.Reducer] public static void Tick(ReducerContext ctx, TickTimer timer) { - // timer row is auto-deleted after this reducer runs + // One-shot rows auto-delete after this runs; interval rows remain. } // One-time: fires once at a specific time diff --git a/skills/rust-server/SKILL.md b/skills/rust-server/SKILL.md index 99d2e87d23c..7e544228909 100644 --- a/skills/rust-server/SKILL.md +++ b/skills/rust-server/SKILL.md @@ -201,7 +201,7 @@ pub struct TickTimer { #[spacetimedb::reducer] pub fn tick(ctx: &ReducerContext, timer: TickTimer) { - // timer row is auto-deleted after this reducer runs + // One-shot rows auto-delete after this runs; interval rows remain. } // One-time: fires once at a specific time diff --git a/skills/typescript-server/SKILL.md b/skills/typescript-server/SKILL.md index e71e17a1290..010eef18078 100644 --- a/skills/typescript-server/SKILL.md +++ b/skills/typescript-server/SKILL.md @@ -156,7 +156,7 @@ const tickTimer = table({ export const tick = spacetimedb.reducer( { timer: tickTimer.rowType }, - (ctx, { timer }) => { /* timer row auto-deleted after this runs */ } + (ctx, { timer }) => { /* one-shot rows auto-delete after this runs; interval rows remain */ } ); // One-time: ScheduleAt.time(ctx.timestamp.microsSinceUnixEpoch + delayMicros)