This file is the single source of truth for how contributors should build, extend, and maintain murmur.
- Name: murmur
- Type: Local-first PWA writing studio
- Vibe: Minimalist, focused, typography-first, local-first
- Emotional tone: Calm, organised, flow-inducing
- Non-goals (v1):
- No AI integrations or API calls
- No accounts, auth, cloud sync, or telemetry
- No vendor lock-in formats
- Local-first
- Works offline after first load.
- No network calls by default.
- Data ownership
- Documents are stored as Markdown strings in IndexedDB.
- Export produces a plain folder structure of
.mdfiles +project.json.
- Derived index
- Links/backlinks/search indexes are derived from stored Markdown and can be rebuilt.
- Clean architecture
- Small modules, explicit boundaries, no “god files”.
- Open-source readiness
- Minimal dependencies, auditable, consistent style, no platform/vendor references in UI/copy.
- Manuscript: Chapters and Scenes
- Bible: Characters, Locations, Themes
- Notes: Optional (v1-friendly but not required)
[[Name]][[Doc#Heading]](heading anchors) Features:- Autocomplete when typing
[[ - Backlinks panel (“Referenced in…”)
- Rename refactor updates links safely
Each document is Markdown with YAML frontmatter (mandatory):
id(uuid)type(chapter|scene|character|location|theme|note)titlestatus(draft|revised|final) for manuscript docsorder(number) for sortingupdated_at(ISO string)
Use Dexie (or idb) with tables:
projects:{ id, name, created_at, updated_at }documents:{ id, project_id, type, title, status?, order, markdown, updated_at }entities:{ project_id, entity_type, name, doc_id }links:{ project_id, source_doc_id, target_text, target_doc_id?, target_anchor?, raw }settings:{ project_id, key, value }
“Reindex Project” must:
- Parse all documents in a project
- Extract frontmatter, title, headings, wordcount, wikilinks
- Populate
linksandentities - Be deterministic and fast for hundreds of docs
- Be robust to malformed frontmatter (fail gracefully, show toast)
- Three-pane layout:
- Left: manuscript tree / navigation
- Center: editor
- Right: context panels (backlinks / bible / prompt studio)
- Resizable panes (desktop)
- Responsive:
- Mobile stacks panels (tabs/drawer)
- UI: Manrope
- Editor: Merriweather
- Mono: JetBrains Mono
Usage:
- Headings:
font-ui font-bold tracking-tight - Body:
font-editor leading-relaxed - UI text:
font-ui text-sm - Code:
font-mono text-xs
Editor readability:
- Keep editor content constrained to
max-w-prosewith comfortable line height.
- Dark mode default, light mode toggle
- Palette: Slate + muted teal accent
- No gradients, no textures
- Visible focus states:
ring-2 ring-primary ring-offset-2 - Respect
prefers-reduced-motion - Ensure contrast is readable in dark mode
Cmd/Ctrl+Kcommand palette / quick switchCmd/Ctrl+Smanual saveCmd/Ctrl+Popen Prompt Studio
- UI: shadcn/ui, lucide-react
- Editor: CodeMirror 6 with markdown
- Validation: Zod
- State: Zustand
- Toasts: sonner
Maintain clear folders (example):
src/app/(routing/layout)components/features/project/manuscript/bible/links/prompt-studio/search/
lib/db/markdown/export/utils/
types/(Zod schemas + shared TS types)
Guidelines:
- No
any - Prefer pure functions in
lib/with unit tests - UI components stay thin; logic in
features/andlib/
Prompt Studio generates copyable prompts for external tools (ChatGPT/Claude/etc.). No network calls.
Templates (v1):
- Draft next scene
- Rewrite with constraint (more subtext, less exposition)
- Continuity check
Context selection:
- Current doc
- Previous doc
- Referenced bible entities (suggested)
- Style guide doc (if present)
Minimum test suite:
- Frontmatter parser
- Wikilink parser
- Heading/anchor extraction
- Reindexer logic (pure functions)
- Link refactor on rename (pure function)
Integration smoke tests:
- Create project
- Create doc, autosave
- Reindex updates backlinks
- Export zip generates expected structure
All interactive elements should include data-testid attributes.
- Avoid platform vendor references in UI or copy.
- Avoid large rewrites; keep PRs small and reviewable
- Prefer explicitness over cleverness
- Keep the app calm and quiet: typography-first, minimal ornamentation