Skip to content
BWBrookPublic

About

Markdown-native manuscript review: tracked changes and comment threads on Markdown/Quarto sources, with a rendered viewer and agent CLI

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

scrivmark

Status: beta, developed in the open and used on real manuscripts. Try the built-in 5-minute tutorial first, and please report rough edges. CHANGELOG.md records each release.

Track changes, margin comments, and document comparison for Markdown, Quarto, and LaTeX manuscripts in git — without converting to Word.

Keep your paper in plain text beside its code and data. scrivmark gives supervisors, co-authors, and AI collaborators the Word "Review" experience directly over your source files: rendered prose with citations, figures, tables, and equations; inline redline you can accept, reject, or undo one by one or in bulk; margin comment threads; offline-file comparison and import; and a full round-lifecycle manager right in the browser. Every edit touches the real source, and the complete review history is preserved in git.

The scrivmark viewer: a rendered manuscript with tracked changes, comments, and drafts from two AI agents in the margin


Start in 60 seconds

You need git, pandoc (3.1 or later; 3.7 or later for LaTeX), and uv on macOS, Linux, or Windows (via WSL2).

uv tool install git+https://github.com/BWBrook/scrivmark
scrivmark launcher install

That's the last terminal command you need for day-to-day reviewing:

  1. Open Scrivmark from the Desktop / Start Menu shortcut (Windows WSL), ~/Applications/Scrivmark.app (macOS), or simply bookmark http://localhost:8765.
  2. Set your name once at the top of the Manuscripts home screen (or run scrivmark whoami).
  3. Click Practice tutorial to try the 5-minute wombat manuscript, or click Open folder… to pick any git repository (scrivmark detects its manuscript files and writes scrivmark.toml for you).

Using Claude Code, Codex, or Gemini? Run scrivmark skill --install once so your agents know the scrivmark CLI (~/.claude, ~/.codex, and ~/.gemini/config). Run scrivmark doctor anytime to check your setup and check for newer releases.


How a review round works (in the browser)

You never need to type git or CLI commands during a review:

  1. Open a manuscript & start a round — pick a repository from the Manuscripts hub (⌂ or m), click the round pill at top-left (r), and click Start review round.
  2. Read, edit, and comment — hover over any paragraph and press ✎ to edit its Markdown or LaTeX in place (redline appears straight away). Select any passage (including reference-list entries) to leave a yellow margin Comment or a blue Ask agent card. Edit comment text or commenter attribution freely until handover.
  3. Decide changes & adjust your view — click any redline inline (or open Items with q) to Accept, Reject, or Undo changes one by one (with optional Move to next) or in bulk. Switch Markup view between All markup, Simple markup (clean prose + red left change bars + comments), No markup, and Original (the pre-round text). Click § (o) to jump by section or file and toggle resolved comments or source notes.
  4. Hand back, respond, and merge — click Return review… (or press r) to inspect the live preflight checklist, edit the AI/review statement, push the branch, and open/update a GitHub PR. Authors open the same round, accept or reject each change (with optional reasons), reply to comments, and either Close & merge… into the author branch or Send back for sign-off… for another turn.
  5. Compare versions or import an offline edit — click Compare (c) to inspect a read-only redline between any two git branches, tags, or commits — or drag-and-drop an offline-edited .md, .qmd, or .tex file from a collaborator to Preview redline and Import as tracked changes directly into a review round.

Key capabilities

Familiar Word "Review" workflow — over plain text

  • Manuscripts Hub & zero-bash setup. A lightweight local background service (systemd --user on WSL/Linux, launchd on macOS — 0% CPU when idle, ~35–45 MB RAM) keeps http://localhost:8765 ready at all times. Switch manuscripts, browse folders, run init, or launch the practice tutorial right in the browser.
  • Progressive & bulk change triage. Accept, reject, or undo tracked changes both while reviewing (accept hides local redline while keeping the edit for handover; reject restores the original text with fail-closed undo) and when responding as author.
  • Four Markup views + display filters. Switch in-tab between All markup, Simple markup, No markup, and Original. Toggle resolved comments and HTML/TeX source notes or jump across sections/files from § (o). A synced second-tab Reading view (/read, linked in ?) stays available for dual-monitor reading.
  • Items panel (q). Every change, comment, agent draft, and ask grouped by section, with type/new filters, live handover readiness, and a one-click HTML Summary download. j/k step through unresolved items.
  • Compare Documents & offline import (c). Compare any two git refs read-only, or "scrivmark" an edited file emailed back from an IDE or Overleaf (normalizing Windows CRLF/BOM automatically) so every offline edit becomes a clickable tracked change.
  • Nothing is lost on reload. Unsent comments, replies, and source edits persist in browser storage per round; live updates via SSE keep the page in sync whenever an agent or editor touches the repository.
Items panel, filtered by type and grouped by section Clean reading view (in-tab No markup or synced second tab)
The Items panel beside the review The reading view: the same manuscript with every edit applied and nothing marked

Human–AI collaboration (in both directions)

scrivmark treats AI agents (Claude Code, Codex, and Gemini) as first-class collaborators using the same review state via structured --json CLI commands. Every agent action records which system and model wrote it.

When a human is reviewing with an AI assistant:

  • Pre-pass drafts. Ask an agent to read the manuscript and leave private lavender Agent drafts (comment-only, line edit, or comment + proposed wording). Keep & apply, edit, keep comment only, drop, or approve/drop ready drafts in bulk.
  • Ask agent & live selections. Select text and click Ask agent to queue blue margin questions, then tell your agent "check my asks" (or simply select text and say "look at my selection"). Turn any answer into a live comment or tracked wording edit in one click.

When AI agents are the authors and a human is reviewing:

  1. Agents initialize the repo (scrivmark init) and keep the text steady while you review in the browser (start → edit/comment → return).
  2. Agents open the round as authors (scrivmark open <round> --as "Claude and Codex"), set SCRIVMARK_AGENT, decide each change on its merits (giving --because reasons for rejections), reply to threads, and run scrivmark respond.
  3. You sign off in the browser: inspect what is new, reply or reopen threads, contest any decision you disagree with, and either Close & merge… or Send back to authors… for another turn.

Signing off on a round two agents responded to: their decisions with reasons, replies, and what is new, in the Items panel

LaTeX and Quarto manuscripts

  • LaTeX (requires pandoc ≥ 3.7, checked by scrivmark doctor): scrivmark init finds root .tex documents, follows \input/\include, and locates \bibliography{...}. Preambles expand \newcommand macros while hiding boilerplate (preamble edits appear above the text); headings and their \label form one block; \ref/\eqref/\cref/\autoref are numbered; % comments display as toggleable grey source notes; PDF figures render via pdftocairo and tikzpicture environments compile in a sandbox (pdflatex
    • macOS sandbox / Linux bubblewrap).
  • Quarto (.qmd): rendered directly via pandoc (prose, citations, equations, cross-references, and tracked changes work; executed Quarto code outputs are not rendered yet).

See a finished round

scrivmark-tutorial-example is the wombat tutorial manuscript after a full round (3–4 November 2026): Barry W. Brook reviewed it with Claude, then Claude played the fictional author (17 accepted, 2 rejected with reasons, 11 comments answered). Clone it and open it in the Hub to step through the completed record.

The returned round in the author's view: tracked changes inline, the reviewer's comments in the margin


CLI & launcher reference

Every browser action has a matching CLI command (all supporting --json for agents and scripts). Run scrivmark --help for the complete list.

Area Command What it does
Launch scrivmark launcher install Installs the lightweight background Hub service (systemd --user / launchd) and clickable Desktop / Start Menu / macOS App shortcut. Check with status; remove with uninstall.
Launch scrivmark hub Runs the multi-manuscript Hub directly (--ensure starts it detached if needed; --stop stops it).
Launch scrivmark serve / stop / url Runs or controls a single-repository viewer in the current directory.
Setup scrivmark tutorial Creates a standalone copy of the wombat practice manuscript (TUTORIAL.md inside).
Setup scrivmark init [FILES...] Detects sources, bibliography, and CSL and writes scrivmark.toml (committed on the first round branch).
Setup scrivmark whoami / doctor / skill --install Configures your identity, checks dependencies/updates, and installs the agent guide for Claude, Codex, and Gemini.
Round scrivmark start / abandon / request Starts a round branch (review/<id>), abandons an unreturned round (tagged for recovery), or requests a review.
Round scrivmark return / open <id> / respond / close Hands the review to authors, checks out a round, sends responses for sign-off, or closes and merges into the author branch (--dry-run previews safely).
Compare scrivmark compare OLD [NEW] Previews a redline between two git refs (e.g. main..HEAD) or an offline-edited file (--html -o diff.html).
Compare scrivmark import FILE... Imports offline-edited file(s) into a new (or --into-current) review round as live tracked changes (--as "Name", --dry-run).
Export scrivmark export [ROUND] [--html] [-o FILE] Exports a round's changes, comments, and decisions as Markdown or standalone HTML.

Ports, security, and IDE browser panes

  • The viewer binds strictly to 127.0.0.1 (default port 8765, configurable via --port, $PORT, or [viewer] port in scrivmark.toml), checks the Host and Origin headers, and uses an HttpOnly SameSite=Strict cookie so external websites cannot reach it.
  • In Hub mode, file watching pauses automatically whenever no browser tab is open, keeping idle usage at 0% CPU and ~35–45 MB RAM.
  • For desktop-app browser panes (e.g. Claude Desktop's .claude/launch.json), run scrivmark serve with "port": 8765 and "autoPort": false.

Updating

uv tool install --reinstall git+https://github.com/BWBrook/scrivmark
scrivmark skill --install
scrivmark launcher install   # refreshes the background Hub service if installed

How it works & safety guarantees

The full architecture and design rationale live in docs/DESIGN.md, and independent adversarial audits live in docs/audits/. The core invariants:

  • Each review round is a git branch (review/<round>); returning freezes every change into reviews/<round>.json with snapshot tags, and closing merges with --no-ff so the full review stays in git history.
  • Comments anchor to exact source text plus surrounding context and track across edits; if a passage is rewritten past recognition or becomes ambiguous, scrivmark flags it for manual re-attachment rather than guessing.
  • Rejecting a change restores original text only when the text and its neighbourhood match exactly; otherwise it fails closed without modifying the file.
  • Every mutating action checks the revision (rev) the user or agent last saw, refusing stale writes rather than overwriting concurrent edits.

Current limits

  • .qmd files render via pandoc rather than Quarto, so executed Quarto code outputs are not shown yet.
  • In LaTeX, body text on the same line as \begin{document} is not shown, and an \input sharing a line with text appears after its paragraph.
  • One reviewer per round and no live multi-user co-editing (both out of scope).

How this work is done

Developed by Barry W. Brook with AI collaborators:

  • Gemini (Gemini 4 Neon, in Antigravity) built the December 2026 UX overhaul and Word-Review parity features: progressive and bulk Accept/Reject/Undo across Reviewing and Author modes, four Markup view modes (All, Simple, No markup, Original), display filters and section outline, zero-terminal browser round-lifecycle manager with preflight modals, Compare Documents and offline-edit import, the multi-manuscript Hub and systemd/launchd/desktop launcher, and Gemini skill parity.
  • Claude (Fable 5.2, in Claude Code) developed and maintained scrivmark from version 0.8 on (14 November 2026 onward).
  • Claude (Opus 5.5, in Claude Code) surveyed existing tools, ran the design interview with Barry, wrote the design and core implementation through 0.7, and adjudicated reviews (with Claude Sonnet 5.5 subagents assisting).
  • Codex (gpt-6.1-sol) carried out independent adversarial reviews of the design, implementation, and fixes.
  • GPT-6 Pro carried out an external full-repository audit commissioned by Barry.

Citation & Licence

See CITATION.cff for citation metadata. Code is released under the MIT Licence; text, figures, and documentation are released under CC BY-SA 4.0. The tutorial cites two published papers whose bibliographic details come from Crossref.

About

Markdown-native manuscript review: tracked changes and comment threads on Markdown/Quarto sources, with a rendered viewer and agent CLI

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages