-
Notifications
You must be signed in to change notification settings - Fork 0
AI Workflow
Spatial Deck is designed from the ground up to be edited by LLMs. The single-file architecture, SECTIONS data model, and annotation export system are all built around AI-collaborative authoring.
- Single file — paste the whole thing (or the relevant section) into a context window
- Config-driven — change SECTIONS, slides update; no imperative DOM manipulation needed
-
Semantic class names —
.case-title,.lesson-title,.case-bullet, etc. are unambiguous -
Comment landmarks —
// ── Section Name ──let the AI navigate the file without reading all of it - Annotation export — export positions and text edits as markdown, paste into a prompt, the AI bakes them into source
The repo includes HANDOFF_PROMPT.md — a comprehensive briefing document for AI agents:
Read HANDOFF_PROMPT.md and then help me with my presentation.
The handoff prompt covers: file structure, SECTIONS config format, media cycler API, slide steps, theme system, navigation hooks, and known quirks. It's kept up to date as the framework evolves.
Keep HANDOFF_PROMPT.md updated. When you add a custom IIFE or a new feature, update the handoff prompt so future AI sessions understand your deck.
This is the core human-AI loop for layout work:
- Open the deck in your browser.
-
Drag elements into position using move mode (
M). The CSS coordinates auto-copy to clipboard. -
Leave text notes using annotation mode (
A). Click any element, type a note. -
Export annotations — press
Ato open the annotation panel, then click Export. You get a markdown block like:
## 1. Case title on slide #4
**Selector:** `.case-title`
**left:42%, top:18% on slide #4**
**Note:** TEXT EDIT: "Old title…" → "New title"
**Full text:** The New Exact Title Text- Paste into a prompt to your AI:
Here are my annotation edits — please bake them into the SECTIONS array:
[paste the annotation export]
- The AI updates the source code. You reload and verify.
| Type | How to spot it | What the AI does |
|---|---|---|
| Text edit |
Note: TEXT EDIT: "old…" → "new…" + **Full text:** line |
Replace with Full text verbatim |
| Position/move | TRANSFORM left:X%, top:Y% · translate(...) |
Usually no-op (already in localStorage); bake to source only if asked |
| Plain note | Note: some text |
Usually means "set this element's text to this string" — verify with the selector |
The annotation export also includes a "Current Settings" block listing all config values (colors, fonts, scales, transition style, etc.). This lets you:
- Tweak settings on slide 0 visually
- Export annotations
- Paste to AI with "update the D defaults object to match Current Settings"
- The AI patches the hardcoded defaults in the
Dobject
This is a lossless round-trip — the deck ships with your preferences baked in for anyone who opens it fresh.
These patterns work well:
Adding content:
Read HANDOFF_PROMPT.md. Add a new lesson to SECTIONS:
- Year: 2024
- Accent: purple
- Title: "The Fastest Way to Learn Is to Ship"
- Tagline: "Every project taught us something we couldn't have learned in theory."
- Two case studies: [describe them]
Media cycler:
Add a media cycler to the "AR at Scale" case study slide with these three images:
media/ar/site-01.jpg, media/ar/site-02.jpg, media/ar/overview.mp4 (loop: true)
Editing from annotations:
Here is the annotation export from my presentation session.
Please bake all TEXT EDIT annotations into the SECTIONS array,
and update any position transforms I've marked as "make permanent".
[paste export]
Theming:
Change the teal accent color to #0EA5E9 and the purple to #8B5CF6 in the :root block.
Timing check:
Look at the notes fields across all my SECTIONS entries.
Using the 150-wpm prose / 20-sec-per-bullet formula, estimate how long my talk will be.
Flag any slides with no notes.
Claude Design generates beautiful visual layouts — Spatial Deck is a natural runtime for them.
Claude Design → Spatial Deck handoff:
- Export from Claude Design as HTML
- Run
python3 tools/import_html.py exported.html - Run
python3 tools/merge_sections.py tools/imported-exported-HASH.json - Use
python3 tools/import_tokens.pyto pull the design tokens if Claude Design exported a CSS file
Spatial Deck → Claude Design handoff:
Export your SECTIONS as markdown (python3 tools/export_md.py) and paste it into a Claude Design session as the slide structure to style.
- Give context in the handoff: "I'm presenting this at a 20-minute conference talk to a technical audience" helps the AI make better content decisions.
- Reference the HANDOFF_PROMPT.md patterns: the AI can follow them precisely if you say "use the pattern from HANDOFF_PROMPT.md for adding a media cycler".
- Don't send the whole file unless needed: for content edits, paste just the SECTIONS array. For layout changes, paste the annotation export. For engine changes, paste the relevant IIFE.
-
Curly quote gotcha: if the AI produces edits with curly apostrophes (
'/') inside JavaScript string literals, the JS will break. Ask your AI assistant to use straight quotes in any JS strings.
Getting started
Presenting
Editing & design
Workflow
Reference