ScriptFlow
Auteur Script Editor & Scene Blueprint
Draft the World. Direct Every Beat.
π v1.0.0 Release Notes β’
π Grammar Contract β’
πΊοΈ Graph View β’
π¬ Audit Rules β’
π§© JSON IR Spec β’
β¨ AI Walkthrough
What is ScriptFlow?
ScriptFlow (v1.0.0) is a local-first, Plain-Text-as-Truth editor and Scene Blueprint studio for authoring, visualizing, auditing, and exporting Auteur Script (v0.4.0)βa 100% platform- and model-agnostic canonical inline screenplay grammar designed for spatial, optical, temporal, and acoustic precision.
Live Mode, Graph View, Source Mode, deterministic Script Supervisor diagnostics, exports, and programmatic JSON IR all derive synchronously from a single canonical plain-text bufferβnever from a parallel mutable UI document tree.
Version Separation Note
- ScriptFlow Application (
v1.0.0): Tracks the editor UI, Scene Blueprint Graph View, multi-script library & lineage, version history, and optional browser-local BYOK AI Assistant in package.json, CHANGELOG.md, and docs/release/v1.0.0.md.
- Auteur Script Specification (
v0.4.0 β Locked): Tracks the canonical inline syntax, deterministic Script Supervisor linter, and programmatic JSON IR schema (AUTEUR_IR_SCHEMA_VERSION = "0.4.0") separately in docs/SPEC_CHANGELOG.md.
Key Capabilities
Asymmetric 40/60 Live Mode & Source Mode
- Independently scrollable Phase 1 β Staging (
S0) and Phase 2 β Execution (S1 β SN) columns on desktop (lg:) with a draggable split divider (25%β60%), collapsible cards/Macro-States, and a structured 2-column [AESTHETIC] Lookbook editor.
- Always-formatted
β³ Waterfall Sub-State editing with toggleable 1-based S#.# badges, live -> / Enter splitting, Backspace merging, ArrowUp/ArrowDown navigation, Alt+β/Alt+β keyboard Sub-State reordering, hover + seams, @dnd-kit drag-and-drop reordering, global Paste-and-Hydrate, and active-draft document Undo/Redo (Cmd/Ctrl+Z, Cmd/Ctrl+Shift+Z / Ctrl+Y).
- Centered single-document Source Mode (
~820px in JetBrains Mono) with Find & Replace (case, whole-word, Regex with $1/$2 backreferences, phase scope), Safe Symbol Rename (characters, @refs, tokens, [CAM ##] slots), direct .txt/.md/.json file drop, non-destructive Format Script, timestamped/content-hashed exports (Canonical .txt, Tagless .txt, JSON Envelope), and automatic read-only reader mode on narrow < 640px viewports.
Read-Only Spatial Graph View ([ Live | Graph | Source ])
- Lazy-loaded
@xyflow/react pan-anywhere blueprint canvas (>= 640px, locked cards for smooth desktop & touch panning) visualizing Phase 1 β Staging (MB#), an intermediate Inferred Objects rail (Characters, [AESTHETIC] Tokens + @ref, Staging-only Visual Refs, Camera Setups), and Phase 2 β Execution (S1 β SN) wrapped in Shot Chambers with curved RECALL arcs.
- Dual-axis
L β R / T β B auto-layout (L β R starts folded; T β B starts unfolded), [AESTHETIC] Lookbook key-value expansion (Keys/Fold), perpendicular Sub-State splitting (Split/Fold), opposite-side Source provenance branches, cascading Threads orthogonal blueprint pipes, a scene-aware Sub-State Isolator Dock (Ghost vs. Compact with gliding pulse-dot animation), a read-only Object Inspector with Call Site fitView focus, always-ready Reset, and 4-theme parity. See docs/GRAPH_VIEW.md.
Deterministic Script Supervisor Linter & 6 Worked Example Families
- 5 pure, synchronous linter rules spanning
Lens 1βLens 5 (viewport-coordinate-purity, camera-redefinition-guard, macro-state-resolution, multimodal-reference-isolation, frozen-first-frame-purity) with persisted per-rule 'off' | 'warning' | 'error' overrides in Settings and zero-shift DiagnosticDot popovers.
- 6 bundled read-only verbatim JSON example families (10 scripts total, defaulting to The Grand Continental alongside Simit and River Pebbles, Cappadocia Balloon Panic, Robert's Machu Picchu Trail Dispatch, and branched
@video1 continuation series Three Years Late and Frequency Over Force) covering all scene topologies with one-click Fork to Edit.
Local-First Script Library, Import Pre-Flight, Branching & Version History
- Browser-local IndexedDB
v2 persistence (scripts + snapshots) with localStorage fallback & automatic mid-session reconciliation, crash-recovery mirror, and debounced + immediate unload flushes.
- Editorial two-pane Script Library (
ScriptLibraryModal) with full-text search, collapsible root-family rows, Recent βΎ sorting, compact Filter βΎ popover (tab-scoped folder & frequency-sorted #tag facets with clickable preview pills), theme-aware folder combobox, opt-in bulk export/delete with lineage repair, and full-library JSON backup.
- Unified pre-flight Import / Restore modal (
ScriptImportModal) evaluating v0.4.0 structural fit, lint diagnostics, and #snapshotHash duplicates before saving, alongside Project & Version History (VersionHistoryModal) with automatic pre/post-AI and Pre-Restore checkpoints, permanent manual Milestones, branchNote tracking, and interactive Lineage Map (ScriptLineageTree).
Optional Browser-Local BYOK AI Assistant & Layer 2.5 Quick Scan
- Lazy-loaded right-side AI Canvas Sidebar (
@google/genai Interactions API streaming across Gemini 4 Hydrogen / Neon / Carbon, Gemini 3.8 Flash, and Gemini 3.5 Flash-Lite, with Low / Medium / High reasoning and localStorage or sessionStorage BYOK key storage).
- Unified
Auto / Draft / Refine / Audit focus bar with editor-state-aware tool pruning, recent-edit diff tracking, 10 strictly read-only/staging browser tools, suggestions-first review cards (Patch, Draft, Title, Audit Review with sibling rebasing & Apply All, opt-in Ask First questions), Layer 2.5 Quick Scan (gemini-decision-1 on v1beta), multimodal Scene Brief & References modal (local images/text, Gemini Files API uploads & 48h cloud browser, YouTube URLs), 5-tab Context Inspector with unified JSON pack Export/Import, Live Mode hover-to-diff margin indicators, USD cost tracking, and opt-in sanitized Trace Inspector.
Programmatic JSON IR, Debug Inspector & 4-Mode Themes
- Pure TypeScript + Zod
AuteurScriptIR, AuteurEnvelope, transactional applyAuteurPatch(), projectAuteurPatchPreview(), Composable Lens Slicer (AUDIT_LENS_PRESETS), getAuteurJsonSchemas(), and zero-cost-when-closed 5-tab JsonIrDebugDrawer.
- 4-mode semantic theme system (Light default, Warm, Dark, Pure Black OLED), text-size presets (
13pxβ16px), toggleable clause underlines and S#.# IDs, ConfirmDialog, and ErrorBoundary crash recovery.
Auteur Script (v0.4.0) at a Glance
Every script is plain text partitioned into a strict three-level hierarchy:
- Macro-Block (
MB#) β Document-level sections separated by blank lines across Phase 1 β Staging (S0) ([INTENT], [LOGIC], [AESTHETIC], [OPENING], [CONTINUITY PROTOCOL], custom Staging blocks) and Phase 2 β Execution ([EXECUTION]).
- Macro-State (
S#) β A single non-empty line inside [EXECUTION] (S1, S2, β¦) representing one atomic stretch of screen time.
- Sub-State (
S#.#) β Each ->-chained, single-dimension unit inside a Macro-State line, led by a Sub-State Tag ([CAM 01], [ACT], [BLOCK], [LIGHT], [STATE IN], [STATE OUT], Tier-2 tags) or inline syntax (Speaker says (delivery) {line}, <foley>, (score), γon-screen textγ).
[INTENT]
Create a tense quiet handoff in a dim diner featuring @image1 as Miller (voice: @audio1).
[LOGIC]
Keep the counter as the 180-degree axis with Miller frame-left facing screen-right. No subtitles appear on screen.
[AESTHETIC]
Medium: 35mm film, natural tungsten practicals
Location: late-night chrome diner -> LOC01
Audio: soft refrigerator hum, distant rain on glass
[OPENING]
MS at eye level across the laminate counter in LOC01. Frame-left, Miller sits facing screen-right with a brass key resting flat under his right palm.
[EXECUTION]
[CAM 01] MS across counter -> [ACT] Miller slides the brass key forward with his right hand -> <metal scrape>
[CAM 01] -> Miller says (low, steady) {Check the locker before dawn.} -> [ACT] Miller folds his right hand back onto his lap
π For locked syntax regexes, Tagless export rules, and all 5 linter contracts, see the Grammar Contract and Glossary.
Editor Shortcuts & Navigation
| Shortcut |
Action |
Context |
βZ / Ctrl+Z |
Undo |
Document edits (Live & Source modes) |
β§βZ / Ctrl+Y |
Redo |
Document edits (Live & Source modes) |
-> / Enter |
Chain Sub-State |
Focused Sub-State in Live Execution |
Alt + β / β |
Move Sub-State |
Reorder focused Sub-State inside its Macro-State |
Backspace |
Merge Sub-State |
At column 0 of an indented β³ Sub-State |
β / β |
Navigate |
Sub-State boundaries in Live Mode, or rows in Library / History |
Esc |
Dismiss / Blur |
Close active modal/popover, clear Graph trace, or blur Sub-State |
Quickstart
Prerequisites
Installation & Development
# 1. Clone the repository
git clone https://github.com/taruma/ScriptFlow.git
cd ScriptFlow
# 2. Install dependencies
npm install
# 3. Start local development server
npm run dev
Open http://localhost:3000 in your browser.