-
Notifications
You must be signed in to change notification settings - Fork 680
LLM Oneshot Prompts, Oneshotted Apps, and Cursor Rules (C#/Rust/TS) #4032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
daa0c6d
f4050f9
b94fce5
764f988
7dad7ec
cf06852
d09bc27
ca6b6ea
47400d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| description: "⛔ MANDATORY: Core SpacetimeDB concepts (all languages)." | ||
| globs: **/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.rs,**/*.cs | ||
| alwaysApply: true | ||
| --- | ||
| # SpacetimeDB Rules (All Languages) | ||
|
|
||
| ## Core Concepts | ||
|
|
||
| 1. **Reducers are transactional** — they do not return data to callers | ||
| 2. **Reducers must be deterministic** — no filesystem, network, timers, or random | ||
| 3. **Read data via tables/subscriptions** — not reducer return values | ||
| 4. **Auto-increment IDs are not sequential** — gaps are normal, don't use for ordering | ||
| 5. **`ctx.sender` is the authenticated principal** — never trust identity args | ||
|
|
||
| --- | ||
|
|
||
| ## Index System | ||
|
|
||
| SpacetimeDB automatically creates indexes for: | ||
| - Primary key columns | ||
| - Columns marked as unique | ||
|
|
||
| You can add explicit indexes on non-unique columns for query performance. | ||
|
|
||
| **Index names must be unique across your entire module (all tables).** If two tables have indexes with the same declared name → conflict error. | ||
|
|
||
| **Schema ↔ Code coupling:** | ||
| - Your query code references indexes by name | ||
| - If you add/remove/rename an index in the schema, update all code that uses it | ||
| - Removing an index without updating queries causes runtime errors | ||
|
|
||
| --- | ||
|
|
||
| ## Editing Behavior | ||
|
|
||
| - Make the smallest change necessary | ||
| - Do NOT touch unrelated files, configs, or dependencies | ||
| - Do NOT invent new SpacetimeDB APIs — use only what exists in docs or this repo | ||
| - Do NOT add restrictions the prompt didn't ask for — if "users can do X", implement X for all users |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # LLM One-Shot Benchmark Summary | ||
|
|
||
| **Generated:** 2026-01-28 | ||
| **Total Runs:** 13 | ||
|
|
||
| ## Overall Results by Backend | ||
|
|
||
| | Backend | Runs | Avg Score | Best | Worst | | ||
| |---------|------|-----------|------|-------| | ||
| | SpacetimeDB | 7 | 91.7% | 100.0% | 76.0% | | ||
| | PostgreSQL | 6 | 62.7% | 76.4% | 41.7% | | ||
|
|
||
| **SpacetimeDB advantage:** +29.0 percentage points | ||
|
|
||
| ## Results by LLM | ||
|
|
||
| | LLM | STDB Runs | STDB Avg | PG Runs | PG Avg | Delta | | ||
| |-----|-----------|----------|---------|--------|-------| | ||
| | gemini-3-pro | 1 | 85.4% | 1 | 71.9% | +13.5% | | ||
| | gpt-5-2 | 1 | 100.0% | 1 | 41.7% | +58.3% | | ||
| | grok-code | 1 | 76.0% | 1 | 46.9% | +29.1% | | ||
| | opus-4-5 | 4 | 95.1% | 3 | 72.0% | +23.1% | | ||
|
|
||
| ## Results by App | ||
|
|
||
| | App | STDB Runs | STDB Avg | PG Runs | PG Avg | Delta | | ||
| |-----|-----------|----------|---------|--------|-------| | ||
| | chat-app | 7 | 91.7% | 6 | 62.7% | +29.0% | | ||
|
|
||
| ## All Runs | ||
|
|
||
| | App | LLM | Backend | Date | Score | % | | ||
| |-----|-----|---------|------|-------|---| | ||
| | chat-app | gemini-3-pro | PG | 2026-01-08 | 17.25/24 | 71.9% | | ||
| | chat-app | gemini-3-pro | STDB | 2026-01-07 | 20.5/24 | 85.4% | | ||
| | chat-app | gpt-5-2 | PG | 2026-01-08 | 10/24 | 41.7% | | ||
| | chat-app | gpt-5-2 | STDB | 2026-01-07 | 24/24 | 100.0% | | ||
| | chat-app | grok-code | PG | 2026-01-28 | 11.25/24 | 46.9% | | ||
| | chat-app | grok-code | STDB | 2026-01-07 | 18.25/24 | 76.0% | | ||
| | chat-app | opus-4-5 | PG | 2026-01-04 | 27.5/36 | 76.4% | | ||
| | chat-app | opus-4-5 | PG | 2026-01-04 | 27.25/36 | 75.7% | | ||
| | chat-app | opus-4-5 | PG | 2026-01-04 | 23/36 | 63.9% | | ||
| | chat-app | opus-4-5 | STDB | 2026-01-05 | 36/36 | 100.0% | | ||
| | chat-app | opus-4-5 | STDB | 2026-01-02 | 32.5/36 | 90.3% | | ||
| | chat-app | opus-4-5 | STDB | 2026-01-02 | 34.5/36 | 95.8% | | ||
| | chat-app | opus-4-5 | STDB | | 34/36 | 94.4% | |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference between this GRADE_SUMMARY.md and the one in the directory above? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # chat-app Benchmark Summary | ||
|
|
||
| **Generated:** 2026-01-28 | ||
| **Total Runs:** 13 | ||
|
|
||
| ## Results by Backend | ||
|
|
||
| | Backend | Runs | Avg Score | Best | Worst | | ||
| |---------|------|-----------|------|-------| | ||
| | SpacetimeDB | 7 | 91.7% | 100.0% | 76.0% | | ||
| | PostgreSQL | 6 | 62.7% | 76.4% | 41.7% | | ||
|
|
||
| ## Results by LLM | ||
|
|
||
| | LLM | STDB Runs | STDB Avg | PG Runs | PG Avg | Delta | | ||
| |-----|-----------|----------|---------|--------|-------| | ||
| | gemini-3-pro | 1 | 85.4% | 1 | 71.9% | +13.5% | | ||
| | gpt-5-2 | 1 | 100.0% | 1 | 41.7% | +58.3% | | ||
| | grok-code | 1 | 76.0% | 1 | 46.9% | +29.1% | | ||
| | opus-4-5 | 4 | 95.1% | 3 | 72.0% | +23.1% | | ||
|
|
||
| ## Feature Scores (Average) | ||
|
|
||
| | Feature | Max | STDB Avg | PG Avg | Winner | | ||
| |---------|-----|----------|--------|--------| | ||
| | 1. Basic Chat Features | 3 | 2.79 | 1.71 | STDB | | ||
| | 2. Typing Indicators | 3 | 2.93 | 2.50 | STDB | | ||
| | 3. Read Receipts | 3 | 3.00 | 1.58 | STDB | | ||
| | 4. Unread Message Counts | 3 | 2.86 | 1.33 | STDB | | ||
| | 5. Scheduled Messages | 3 | 2.36 | 1.75 | STDB | | ||
| | 6. Ephemeral/Disappearing Messages | 3 | 2.64 | 2.67 | PG | | ||
| | 7. Message Reactions | 3 | 2.89 | 1.79 | STDB | | ||
| | 8. Message Editing with History | 3 | 2.93 | 1.83 | STDB | | ||
| | 9. Real-Time Permissions | 3 | 2.25 | 1.58 | STDB | | ||
| | 10. Rich User Presence | 3 | 2.88 | 2.67 | STDB | | ||
| | 11. Message Threading | 3 | 3.00 | 2.00 | STDB | | ||
| | 12. Private Rooms & Direct Messages | 3 | 3.00 | 2.17 | STDB | | ||
| | 13. Room Activity Indicators | 3 | 0.00 | - | - | | ||
| | 14. Draft Sync | 3 | 0.00 | - | - | | ||
| | 15. Anonymous to Registered Migration | 3 | 0.00 | - | - | | ||
|
|
||
| ## All Runs | ||
|
|
||
| | LLM | Backend | Date | Score | % | Level | | ||
| |-----|---------|------|-------|---|-------| | ||
| | gemini-3-pro | PG | 2026-01-08 | 17.25/24 | 71.9% | 5 | | ||
| | gemini-3-pro | STDB | 2026-01-07 | 20.5/24 | 85.4% | 5 | | ||
| | gpt-5-2 | PG | 2026-01-08 | 10/24 | 41.7% | 5 | | ||
| | gpt-5-2 | STDB | 2026-01-07 | 24/24 | 100.0% | 5 | | ||
| | grok-code | PG | 2026-01-28 | 11.25/24 | 46.9% | 5 | | ||
| | grok-code | STDB | 2026-01-07 | 18.25/24 | 76.0% | 5 | | ||
| | opus-4-5 | PG | 2026-01-04 | 27.5/36 | 76.4% | 9 | | ||
| | opus-4-5 | PG | 2026-01-04 | 27.25/36 | 75.7% | 9 | | ||
| | opus-4-5 | PG | 2026-01-04 | 23/36 | 63.9% | 9 | | ||
| | opus-4-5 | STDB | 2026-01-05 | 36/36 | 100.0% | 9 | | ||
| | opus-4-5 | STDB | 2026-01-02 | 32.5/36 | 90.3% | 9 | | ||
| | opus-4-5 | STDB | 2026-01-02 | 34.5/36 | 95.8% | 9 | | ||
| | opus-4-5 | STDB | | 34/36 | 94.4% | 9 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files have been moved here (they are used by
spacetime initso that we can initialize a project with rules):https://github.com/clockworklabs/SpacetimeDB/tree/master/docs/static/ai-rules
Could you please move them to here and merge them with the pre-existing ones?