Back to Spacetimedb

Paint App Prompt System

tools/llm-oneshot/apps/paint-app/prompts/README.md

2.1.05.6 KB
Original Source

Paint App Prompt System

Modular prompts for testing SpacetimeDB vs PostgreSQL with a collaborative drawing application.

Structure

prompts/
├── README.md
├── features/               # 16 feature building blocks
│   ├── 01_basic.md
│   ├── 02_cursor_indicators.md
│   ├── ...
│   └── 16_keyboard_shortcuts.md
├── composed/               # Pre-built cumulative prompts (language-agnostic)
│   ├── 01_basic.md
│   ├── 02_shapes.md
│   ├── ...
│   └── 12_full.md
├── language/               # Language/backend-specific setup (small files)
│   ├── typescript-spacetime.md
│   ├── typescript-postgres.md
│   ├── rust-spacetime.md
│   └── csharp-spacetime.md
├── grading_rubric.md
└── grading_checklist.md

How to Use

Combine a language file + a composed prompt:

  1. Pick a language: language/rust-spacetime.md
  2. Pick a feature level: composed/12_full.md
  3. Concatenate them (language file first)

Example test command:

bash
# Conceptually: language header + feature prompt
cat language/rust-spacetime.md composed/12_full.md > test_prompt.md

Or when using with an LLM:

@language/rust-spacetime.md @composed/12_full.md execute

Feature Levels

Each level is cumulative — includes all previous features.

LevelNameNew Features Added
01basicBasic Drawing, Live Cursors
02shapes+ Shapes
03selection+ Selection & Manipulation
04layers+ Layers with Locking
05presence+ Presence & Activity Status
06comments+ Comments & Feedback
07versions+ Version History
08permissions+ Permissions
09follow+ Follow Mode
10activity+ Activity Feed
11sharing+ Private Canvases & Sharing
12full+ Canvas Chat, Auto-Cleanup, Text & Stickies, Keyboard Shortcuts

Language Files

FileStack
typescript-spacetime.mdTypeScript + SpacetimeDB (React client)
typescript-postgres.mdTypeScript + PostgreSQL (Express + Socket.io)
rust-spacetime.mdRust + SpacetimeDB (axum web GUI)
csharp-spacetime.mdC# + SpacetimeDB (MAUI client)

Features Overview

#FeatureDescriptionSTDB Advantage
1Basic DrawingBrush, eraser, colors, real-time syncFoundation
2Live CursorsSee others' cursors with tool/color previewHigh-frequency updates
3ShapesRectangle, ellipse, line, arrowStandard feature
4SelectionSelect elements, see others' selectionsReal-time sync
5Layers + LockingLayers with "locked by user" featureInstant lock/unlock
6PresenceActive/idle/away status, current toolBuilt-in presence
7CommentsPin comments, threads, resolveStandard feature
8Version HistoryAuto-save snapshots, restoreSubscription updates
9PermissionsViewer/editor roles, instant enforcementRow-level security
10Follow ModeFollow another user's viewportViewport state sync
11Activity FeedReal-time action logSubscription-based
12Private CanvasesShare links, invite usersAccess control
13Canvas ChatChat with collaborators, typing indicatorReal-time messaging
14Auto-CleanupDelete inactive canvases after 30 daysScheduled reducers
15Text & StickiesText labels, sticky notes, inline editingReal-time sync
16Keyboard ShortcutsTool shortcuts, delete, escapeUX polish

Why This Structure?

Before (redundant):

composed/
├── typescript/spacetime/12_spacetime_full.md  # Same features
├── typescript/postgres/12_postgres_full.md    # Same features
├── rust/spacetime/12_spacetime_full.md        # Same features
├── csharp/spacetime/12_spacetime_full.md      # Same features

After (DRY):

composed/12_full.md           # Features (one source of truth)
language/rust-spacetime.md    # Just setup/architecture (~30 lines)

Benefits:

  • Update features once → applies to all languages
  • Language files are tiny - just setup and constraints
  • Easy to add new languages (one small file)