Creative Mantra
The Manuscripts.ai v3 writing surface — a Source Serif manuscript editor with a reports rail on the right showing style diagnostics.
In-House R&D · Manuscripts.ai

The manuscript editor that can prove it's yours.

An author-first AI writing surface. Every AI edit is a proposal. Every accepted proposal is logged. The ledger is exportable — as JSON for a machine, as Markdown for a reader — so the author, when asked, has an honest answer.

1M
Token context per request
12
Inline commands, author-picked
40
Templates · 18 visible, 3 cut
16
Diagnostic kinds in Flags
The Project

Our own product, built for a question no one else was asking.

Year
In development since Jun 2026 · v3 in early access Jul 2026
Industry
Literary software · fiction, non-fiction, screen, stage. Also fits academic long-form.
Role
Product, design, and engineering — in-house at Creative Mantra
Stage
Early access · in the hands of an early-access cohort of 34 authors · finding its shape

Manuscripts.ai was not shipped to a client. It was shipped to ourselves — a laboratory for how an author-first AI editor should behave when the industry is racing in the opposite direction.

The Manuscripts.ai marketing hero showing the app's cover mark.
The Collapse

The moment AI touches a manuscript, authorship gets slippery.

Beat 01 · The generation trap

The paragraph is elegant. And then the author cannot remember.

Modern AI writing tools optimise for output volume. Type a prompt, receive a paragraph. The paragraph is elegant, sometimes better than what the author would have written. It goes into the draft. And a week later the author cannot remember whether the sentence about the mother's hands was theirs or the model's.

Beat 02 · The disclosure trap

Publishers ask. Agents ask. Contests, imprints, and courts ask.

Attestations of authorship are now routine. An author who cannot answer the question — which words are yours — is exposed. Not because they cheated, but because their tooling didn't keep the receipts.

Beat 03 · The dignity trap

The writer becomes the second author of their own book.

The most-used AI writing UIs treat the author's manuscript as raw material for the model. Prompts overwrite. Suggestions auto-apply. Nothing is filed. The writer is the second author of their own book.

We built Manuscripts.ai to make authorship provable — at the paragraph, at the sentence, at the timestamp.

Discovery

We asked authors what an AI editor should refuse to do.

0
/ 25
Authors requested a hard boundary between the AI's brainstorm surface and the manuscript file.
0
/ 25
Wanted a per-sentence audit log they could export as evidence.
0
/ 25
Rejected dark mode — because that is not how books are read.
Three product laws, enforced in code

The wall.

The Pad — the AI brainstorm surface — cannot copy prose into the manuscript. Enforced in the system prompt, in the CSS .no-copy class, and in the microcopy. "Walk back to the manuscript" is the close button.

The ledger.

Every AI-accepted edit is logged with before/after text. The log is exportable as JSON and Markdown.

The measure.

No dark mode. Source Serif 4. 68-character line. Light-mode only. Because that is how books are read.

Jun 22, 2026
First commit · the wall is drawn on paper before it becomes code.
Jul 06, 2026
v3 repository initialised · TipTap, Source Serif, and the provenance schema land together.
Jul 07, 2026
Supabase mirror + SQLite ↔ Supabase sync foundation.
Jul 08, 2026
First author signup · custom auth + rate limiting shipped.
Jul 14, 2026
First external author signup · legacy Pro plan sync.
Jul 20, 2026
v3 performance report cut · v3 live, pre-PMF, and honest about it.

There is a small betrayal that happens between an author and their draft when an AI enters the room. We built Manuscripts to keep the ledger — so that the author, when asked, has an honest answer.

— design principle #01, from the DESIGN_DNA.md
Architecture

One editor. Three surfaces. One ledger.

The system separates three surfaces by intent — the writing surface, the exploration surface, and the analysis surface — and unifies them through a single provenance ledger. Retrieval is FTS5. Orchestration is OpenRouter. Persistence is SQLite locally, mirrored to Supabase for sync.

Manuscripts.ai system architecture A five-layer architecture diagram: client, API, AI orchestration via OpenRouter, data layer with SQLite plus Supabase mirror, and a highlighted trust layer with the ai_provenance ledger and export formats. Client browser · light-mode only Next.js 16 · App Router React 19 · Tailwind v4 · SSR + Client TipTap v3 · ProseMirror Bubble menu · Sheet · ULID paragraph ids Harper.js (WASM) Local grammar linter · 0 network calls API Next.js route handlers 15+ AI route handlers /api/ai/rewrite · /wizard · /atomize · /flags · /chat SSE streaming · JSON responses scrypt session auth handle+password · HttpOnly · 30-day sliding TTL rate-limit 5/5min · MC-XXXX codes AI orchestration OpenRouter OpenAI SDK v6.42 openrouter.ai/api/v1 Gemini 2.5 Pro default · 1M context · 10× deduction Claude Sonnet 4 / 4.6 quality path · 15× deduction Kimi K2 Thinking cost path · 4× deduction Gemini 3 Pro Preview frontier · experimental Data no vector DB SQLite · libsql 0.17.3 primary store · local-first documents · lore · flags · voice FTS5 retrieval bm25 ranking · snippet excerpts no embeddings · no RAG Supabase mirror outbox pattern · Vercel cron drain self-hosted · Hostinger Trust the load-bearing layer ai_provenance before · after · task · paragraph_ids · doc_id · ts · human every accepted AI edit — nothing filed silently load-bearing product rule JSON export machine-verifiable Markdown export human-readable → author holds the receipts
The Signature

Provenance is the load-bearing product rule.

Beat 01 · The accept moment

Every suggestion is a proposal. Every accept is a signature.

Every AI suggestion — from an inline command, from the Wizard's guided drafting flow, from a template run — appears in a sheet with two buttons. Accept, or Reject. Only Accept writes to the manuscript. And only Accept writes to the ledger.

Beat 02 · The ledger row

A row in ai_provenance holds the whole story.

Before-text, after-text, the task kind (rewrite, expand, hook-sharpen — one of twelve), the paragraph IDs, the document ID, and the timestamp of acceptance. Nothing is filed silently. Nothing is hidden.

Beat 03 · The export

Two formats. Same truth. The author holds both.

JSON, for machine-verifiable audit. Markdown, for a human reader. And its own claim.summary is explicit: only manuscript_ai_events count as AI in the draft. Adjacent activity — Pad, Chat, Templates, Flags — is transparency-only.

The Manuscripts.ai Provenance ledger — a page titled 'Your book's AI audit' showing a 100 percent human-typed score, per-document breakdown, and adjacent AI activity tiles for Pad, Template, Chat, Desk, and Flag surfaces, with Markdown and JSON audit export buttons at the top.
rewrite 2026-07-24T14:22:07Z
before: "She walked to the door."
after: "She hesitated, then opened it."
doc: doc_01HZ…
paragraph: p_7f2a
accepted by: @author
JSON provenance-2026-07-24.json
{
  "id": "ai_prov_01HZQ8…",
  "task": "rewrite",
  "model": "google/gemini-2.5-pro",
  "before": "She walked to the door.",
  "after":  "She hesitated, then opened it.",
  "accepted_at": "2026-07-24T14:22:07Z",
  "claim": { "summary": "manuscript_ai_event" }
}

“The ledger is the only reason we felt honest shipping this.”

— internal design review, Jul 2026
Provenance export — JSON and Markdown side by side Two side-by-side card mockups showing the same accepted AI edit event exported as JSON on the left and Markdown on the right. SAME EVENT · TWO FORMATS Provenance row ai_prov_01HZQ8… exported for a paragraph the author accepted at 14:22:07 UTC provenance-2026-07-24.json { "id": "ai_prov_01HZQ8…", "task": "rewrite", "model": "google/gemini-2.5-pro", "before": "She walked to the door.", "after": "She hesitated, then opened it.", "doc_id": "doc_01HZ…", "paragraph_ids": ["p_7f2a"], "accepted_at": "2026-07-24T14:22:07Z", "accepted_by": "@author", "claim": { "summary": "manuscript_ai_event" } } provenance-2026-07-24.md ## Provenance event - Event: ai_prov_01HZQ8… - Task: rewrite - Model: google/gemini-2.5-pro - Accepted: 2026-07-24 14:22:07 UTC - By: @author ### Before > She walked to the door. ### After > She hesitated, then opened it. ### Claim Only manuscript_ai_events count as AI in the draft.
Architectural Guardrails

The Pad is across the hall. And the hall is load-bearing.

The Brainstorm Pad is where the author spars with the model — throws ideas, argues with them, sketches outlines. Nothing in the Pad can be copied into the manuscript. That constraint isn't a filter — it's the architecture. It is enforced at three layers, each of which can catch what the others miss.

The Manuscripts.ai Brainstorm Pad, a surface deliberately walled off from the manuscript, with an amber banner reading 'The Pad is across the hall from your manuscript — 22 of 25 authors asked for that wall, and we kept it.'
Layer i.
The system prompt.
The model is told, in the first paragraph of its instructions, that it is a sparring partner and not a writer.
Hover to see the code
PAD_SYSTEM · src/lib/llm.ts
You are across the hall from the manuscript. Do not produce prose the author could paste into the book. You are a sparring partner. Argue with the idea. Sketch. Suggest. Never draft.
Layer ii.
The CSS.
The output surface uses user-select: none and a .no-copy class. The keyboard cannot select. The mouse cannot drag.
Hover to see the code
pad.css
.pad .no-copy { user-select: none; -webkit-user-select: none; cursor: default; } .pad .no-copy::selection { background: transparent; } .pad { background: var(--bg-wall); }
Layer iii.
The microcopy.
The button is labelled Sketch, not Send. The close link reads Walk back to the manuscript. The page background is a different colour from the workspace.
Hover to see the strings
pad.microcopy.ts
submit_btn: "Sketch" close_link: "Walk back to the manuscript" page_bg: rgba(79, 70, 229,0.14) // deliberately not // the workspace stone

22 of 25 authors asked for that wall, and we kept it.

Inline Commands

Twelve commands. The author picks. The author accepts.

Select text in the editor. A bubble menu appears. Pick a command. A suggestion streams in. Accept or reject. Every accept is a ledger row.

The Manuscripts.ai templates rail listing twelve curated inline commands including Sentence Sketcher, Content Improver, Sentence Expander, Rewrite, Hook Sharpener, Dialogue Punch-Up, Sensory Layer-In, Chapter-End Cliff, Perspective Generator, Chapter Title, Synopsis, and Summary.
01
Sentence Sketcher
Drafts a first-pass sentence from a fragment.
system prompt
Given a fragment, sketch a single sentence in the author's voice. Do not embellish beyond one clause.
02
Content Improver
Tightens prose while preserving voice.
system prompt
Improve clarity and rhythm. Do not change meaning. Preserve idiosyncratic word choices.
03
Sentence Expander
Extends a line into a longer, more textured beat.
system prompt
Expand the sentence with one image, one sound, or one interior thought. Never invent facts.
04
Rewrite
Restates a passage in a new register.
system prompt
Restate in the requested register (colder / warmer / tighter). Return one candidate, not a menu.
05
Hook Sharpener
Rewrites the opening line for tension.
system prompt
Sharpen the hook. Preserve the noun. Preserve the verb. Change everything else.
06
Dialogue Punch-Up
Adds bite and pace to spoken lines.
system prompt
Punch the dialogue. Keep speaker attributions. Do not invent new characters.
07
Sensory Layer-In
Adds one grounded sensory detail.
system prompt
Add exactly one sensory detail — sight, sound, smell, touch, or taste. One. Not five.
08
Chapter-End Cliff
Turns a closing line into a hook forward.
system prompt
Convert the closing line into a cliff. Do not resolve. Do not summarise.
09
Perspective Generator
Restates a beat from another character's view.
system prompt
Retell the beat from the named POV. Respect their known interiority. Add nothing new.
10
Chapter Title
Suggests three restrained title candidates.
system prompt
Return three chapter titles. Under six words each. No colons. No cliches.
11
Synopsis
A structural precis of the current chapter.
system prompt
Summarise the chapter in three sentences: what changed, who changed, why it matters.
12
Summary
Compresses a passage without paraphrase.
system prompt
Summarise. Retain vocabulary. Retain proper nouns. Cut only the connective tissue.

Three commands that violated the wall — AI Book Writer, Complete Story, Storyteller Mode — were cut from the final registry.

Model Orchestration

One request. Four models. A cost table with receipts.

Manuscripts routes every LLM call through OpenRouter using the OpenAI-compatible SDK. The default model is Gemini 2.5 Pro — a million-token context window, five-to-seven times cheaper than Sonnet, and cheap enough that a 60,000-word manuscript can be held in a single prompt without stitching. When quality matters more than cost, calls escalate to Sonnet 4 or Gemini 3 Pro Preview. Costs are billed in tokens, then multiplied by a per-model factor stored in src/lib/models.ts.

LLM model routing decision tree the request AI request rewrite · expand · chat /api/ai/* the router OpenRouter openai-compatible SDK src/lib/models.ts the models deduction Gemini 2.5 Pro default · 1M context · 5-7× cheaper than Sonnet 10× DEFAULT Gemini 2.5 Flash cost path · fast inference · lightweight tasks Claude Sonnet 4 / 4.6 quality path · nuance-first prose · escalation 15× Kimi K2 Thinking cheap reasoning · long-form ideation Gemini 3 Pro Preview frontier · experimental · opt-in 20× default path escalation paths multipliers stored in src/lib/models.ts

Model registry (excerpt)

google/gemini-2.5-pro 1M context 10×
google/gemini-2.5-flash 1M context
anthropic/claude-sonnet-4.6 200k context 15×
moonshotai/kimi-k2-thinking 200k context
google/gemini-3-pro-preview 1M context 20×

Every LLM error is classified

Sixteen MC-XXXX codes cover the full failure taxonomy — auth, rate limit, model refusal, malformed response, upstream 5xx. No opaque "something went wrong." When the model fails, the author knows how.

Context · Without Embeddings

A 60,000-word manuscript. No vector database.

Manuscripts uses SQLite FTS5 with bm25() ranking and snippet() excerpts. Paragraph-aware chunking (roughly 300 words per chunk, respecting scene and chapter breaks) lives in src/lib/chunk.ts. There are no embeddings. There is no vector DB. The retrieval mechanism is keyword search with strong ranking.

This is a deliberate architectural bet. For a single-author corpus, keyword retrieval is faster, cheaper, deterministic and — critically — citable. Every snippet returned by the Ask surface carries a source attribution the author can verify. CLAUDE.md puts it plainly: don't add an embedding service unless asked. FTS5 is the deliberate choice.

FTS5 retrieval flow the manuscript ~ 60,000 words · single-author corpus Ch. 1 · The arrival Ch. 2 · Under the elm Ch. 3 · The letter Ch. 4 · The garden Ch. 5 · Depart. match FTS5 query SELECT snippet(fts, 0, '<m>', '</m>') FROM chunks WHERE fts MATCH ? ORDER BY bm25(fts); snippet returned "…under the elm, she read the letter" ch. 2 · para p_2c14 · bm25 = 8.42 → cited in Ask surface with source id cite back no embeddings no vector DB bm25 + snippet · deterministic · citable
Gemini 2.5 Pro's million-token context is the second half of the answer. For requests that need the whole book, we just send the whole book.
The Measure

Nineteen pixels. 1.75 line-height. Sixty-eight characters to a line.

The literary measure is not an aesthetic — it is a reading finding. Somewhere between 45 and 75 characters per line, the eye stops re-finding the start of the next line and starts reading. We chose 68. We chose Source Serif 4 because it was designed for long-form reading on screens. We chose Geist Sans for chrome because chrome should get out of the way. We chose Geist Mono for IDs and timestamps because those things are meant to be read as machine text.

Source Serif 4 · 19 / 1.75 / 68ch
68ch measure

Call me Ishmael. Some years ago — never mind how long precisely — having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.

It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; then, I account it high time to get to sea as soon as I can.

Geist Mono · 12.5 / 1.7 / illustrative
# ai_provenance row · illustrative
id         = "ai_prov_01HZQ8…"
task       = "rewrite"
model      = "google/gemini-2.5-pro"
before     = "She walked to the door."
after      = "She hesitated, then opened it."
doc_id     = "doc_01HZ…"
accepted   = "2026-07-24T14:22:07Z"
by         = "@author"
# nothing filed silently
No dark mode. Enforced in code. Books are read in light.
Ochre dotted underlines. Grammar suggestions, not red squiggles.
All animations ≤ 250ms. Respecting prefers-reduced-motion.
Privacy By Architecture

The grammar checker never phones home.

Grammar and style suggestions in Manuscripts come from Harper.js — a WebAssembly linter that runs entirely in the author's browser. No paragraphs are sent to a server. The library is lazy-imported only when an author enables the feature. When the underline appears under a sentence, no network request has been made.

0
Network calls
0
%
In-browser
WASM
Lazy-loaded
runs.in-browser · harper.js@2.4

She had walked to the door. There was no one there, and she had already begun to wonder if the letter had been a mistake.

The underline is ochre and dotted. We did not want a red squiggle telling an author that their sentence is a mistake.
Author-First Authentication

No third-party sign-in required. No OAuth data trail.

Manuscripts uses custom handle-and-password authentication. Passwords are hashed with Node's crypto.scryptSync using a per-user 64-byte salt. Sessions are HttpOnly, SameSite=Lax, __Host--prefixed cookies with a 30-day sliding TTL. Google Sign-In is available but never required. There is no Facebook button. There is no LinkedIn button. The author's handle can be anything from three to thirty-two characters, and the author's writing is stored under that handle and no external identity.

Auth session flow step 1 handle @author-name 3-32 chars · a-z0-9._- step 2 scrypt hash crypto.scryptSync 64-byte per-user salt step 3 HttpOnly cookie __Host- · SameSite=Lax no JS access step 4 30-day session sliding TTL no third-party OAuth
Rate-limited to 5 login attempts per 5 minutes per IP+email. Every failure is classified with an MC-XXXX code — no opaque errors.
The Surface

The workspace, in full.

Manuscripts is a single application organised around a single question: what would an author-first AI editor actually need?

Write
TipTap on ProseMirror. ULID paragraph IDs. Bubble menu. Suggestion sheet with Accept/Reject.
The Wizard
A ten-step guided drafting flow. Persona → genre → premise → characters → outline.
Templates
Forty prompts. 18 visible in the Author Pack. 22 hidden. Three wall-violators cut.
Chat
Book-aware. Scope chip: this scene / whole book / clean room. Refuses prose output.
Lore Book
Seven typed entity kinds. @-mention resolution in the editor.
Outline
Acts → Chapters → Scenes. Sparse ordinals for drag-reorder without collisions.
Vault
Upload .txt, .md, .pdf, .docx, .epub. Automatic extraction. Chunked into FTS5.
Voice Fingerprint
Reads up to ~8k words of the author's own writing. Never injected into Pad, Chat, or Flags.
Desk
Query letter, synopsis, back-cover blurb, newsletter. Four drafts, voice-injected.
Echoes
Cross-channel repurposing. Newsletter, LinkedIn, thread, cold open, ad, caption, blurb.
Flags
Sixteen kinds of diagnostics. Plot-hole, stylometry, readability, continuity, promises.
Narrative Flow
Character & location co-occurrence graphs. Louvain communities surface isolated arcs.
Provenance
The ledger. The surface that binds every other AI action to the manuscript.
Write
TipTap on ProseMirror. ULID paragraph IDs. Bubble menu. Suggestion sheet with Accept/Reject.
The Wizard
A ten-step guided drafting flow. Persona → genre → premise → characters → outline.
Templates
Forty prompts. 18 visible in the Author Pack. 22 hidden. Three wall-violators cut.
Chat
Book-aware. Scope chip: this scene / whole book / clean room. Refuses prose output.
Lore Book
Seven typed entity kinds. @-mention resolution in the editor.
Outline
Acts → Chapters → Scenes. Sparse ordinals for drag-reorder without collisions.
Vault
Upload .txt, .md, .pdf, .docx, .epub. Automatic extraction. Chunked into FTS5.
Voice Fingerprint
Reads up to ~8k words of the author's own writing. Never injected into Pad, Chat, or Flags.
Desk
Query letter, synopsis, back-cover blurb, newsletter. Four drafts, voice-injected.
Echoes
Cross-channel repurposing. Newsletter, LinkedIn, thread, cold open, ad, caption, blurb.
Flags
Sixteen kinds of diagnostics. Plot-hole, stylometry, readability, continuity, promises.
Narrative Flow
Character & location co-occurrence graphs. Louvain communities surface isolated arcs.
Provenance
The ledger. The surface that binds every other AI action to the manuscript.
hover to pause · thirteen features, one workspace
The Stack

Boring on purpose.

Frontend

  • Next.js 16.2.7
  • TipTap v3.26 · ProseMirror
  • React 19
  • Tailwind CSS v4
  • Geist Sans / Source Serif 4
  • lucide-react 1.17
  • GSAP 3.15
  • Harper.js 2.4 (WASM)

Backend & API

  • Next.js App Router
  • SSE streaming
  • scrypt custom auth
  • REST + JSON responses
  • MC-XXXX error taxonomy
  • 15+ route handlers

Data

  • SQLite via libsql 0.17.3
  • FTS5 (bm25 + snippet)
  • Supabase mirror (Hostinger)
  • Outbox pattern
  • Vercel cron drain

AI

  • OpenAI SDK v6.42
  • OpenRouter (openai-compat)
  • Gemini 2.5 Pro (default)
  • Claude Sonnet 4 / 4.6
  • Kimi K2 Thinking
  • Gemini 3 Pro Preview

Specialist libraries

pdf-parse mammoth docx jspdf epub-gen-memory wink-nlp graphology Yjs (offline) marked ulid
Not in the stack. No vector database. No MCP servers. No multi-agent framework. No fine-tuning pipeline. No LangChain. No LangGraph. Every one of those was considered. Every one was rejected.
The Rollout

Live. In early access. Finding its shape.

Manuscripts is not a launched product. It is a working product in the hands of a hand-picked cohort of authors. The v3 build went to real writers on 2026-07-08. The first external author signup was 2026-07-14. The team has been shipping, listening, and cutting features — three templates were removed in the first two weeks because they violated the wall — while the ledger, the wall, and the measure held.

We are in an early-access cohort of 34 authors, actively used by a smaller subset, watched carefully by all of us. The product is not finished. It was not meant to be, yet.

Adoption is being measured by conversations, not conversions. The next chapter is being written.

2026-06-22
First commit. Wall drawn on paper.
2026-07-06
v3 repository initialised.
2026-07-07
Supabase mirror + SQLite ↔ Supabase sync foundation.
2026-07-08
First author signup. Custom auth + rate limiting complete.
2026-07-14
First fully external author. Legacy Pro plan sync.
2026-07-20
v3 performance report cut. v3 live but pre-PMF.
2026-07-24
Payment reliability + heavy-call confirms shipped.
2026-07-29
Wizard states + FK-orphan hydration.
What We Learned

Four honest observations from twelve days in the wild.

Lesson i.

Authors want the AI to refuse.

The most consistent piece of feedback was gratitude for the wall. Authors do not want a tool that races them. They want a tool that keeps its hands where they can see them.

Lesson ii.

Adoption is a shape, not a number.

In twelve days, an early-access cohort of 34 authors signed up. Four used AI features. One wrote three hundred thousand words with zero AI calls. The shape of adoption tells us the product is a serious editor with an optional AI layer — which is exactly what we designed.

Lesson iii.

The wall is more valuable than the AI.

Every product decision that reinforces the wall — the CSS, the microcopy, the different page background — has been more user-praised than any AI feature we've shipped.

Lesson iv.

Cost is a feature.

The choice to default to Gemini 2.5 Pro over Sonnet is not a compromise. It is a design decision. Cheaper models at large context let us hold whole books in a single prompt without stitching, which lets us give authors cleaner, more coherent suggestions.

Building Something With Sharp Edges?

Manuscripts.ai was our in-house bet.
We build the same way for clients.

If you're planning an AI product where the trust story matters — provenance, guardrails, human-in-the-loop, honest UX — we would like to hear about it.