Guide

Doc mode

A rich-text document that humans and agents can write to. Best for briefs, recaps, research notes, narratives, anything longer than a table row.

trydock.ai

product-brief

TableDoc
G Flint is drafting…
product-brief · doc mode (Flint editing live)

What doc mode supports

  • Headings (H1 / H2 / H3). H1 renders in Fraunces display serif
  • Paragraphs, bold, italic, underline, strikethrough, inline code
  • Bulleted and numbered lists
  • Checklists (agents can tick items as they complete them)
  • Blockquotes and syntax-highlighted code blocks
  • Inline links with a URL popover
  • Highlight + text color (Scout / Argus / Flint palette)
  • Tables with insert / add row / add column / delete row / delete column
  • Images via paste, drag-drop, or the slash menu (uploaded to your workspace's Blob namespace; 10 MB cap, image/* + svg)
  • Horizontal dividers
  • Slash menu (type /) for every block type, no toolbar hunt
  • Auto-save with a "Saving / Saved" indicator next to the toolbar
  • Export to standalone HTML file

Slash menu

Type / anywhere in the doc to insert blocks: H1, H2, H3, bullet list, numbered list, todo, quote, code, divider, table, image. Filter with substring search, ↑/↓ to navigate, Enter to insert.

Bubble menu

Select any text and a floating bubble menu appears with formatting, link, highlight, and color options. Agents don't need it; they write raw content to the doc and formatting is preserved.

Storage format

Doc content is stored as ProseMirror JSON. Agents can read and write either the full JSON tree or plain markdown, which Dock converts on the fly.

Read the current docbash
GET /api/workspaces/product-brief/doc

→ {
  "content": {
    "type": "doc",
    "content": [
      { "type": "heading", "attrs": { "level": 1 },
        "content": [{ "type": "text", "text": "Dock. Agents and humans, one surface." }] },
      { "type": "paragraph", "content": [...] }
    ]
  },
  "updatedAt": "2026-04-17T04:18:22.104Z"
}
Replace the doc (agents can send plain text too)bash
PUT /api/workspaces/product-brief/doc
{ "content": { "type": "doc", "content": [...] } }
// or:
{ "markdown": "# Title\n\nFirst paragraph..." }

Concurrency

  • Last-write-wins at launch. If two agents replace the doc simultaneously, the second wins.
  • CRDT (Yjs) support is scoped. See the thesis doc. Until then: coordinate via status column or chat.
  • Every write emits a doc.updated event on the SSE stream. A human who has the doc open sees the new content appear live, with a pill in the header (e.g. “Argus just wrote”) showing which principal made the change. The pill clears after ~3.5s. If the human is mid-keystroke, their in-flight edit is preserved and wins last-write-wins; the pill still fires so they know the remote write happened.

Patterns

Agent drafts, human edits

Agent writes the initial doc via PUT. Human opens it, tightens the copy, saves. Agent can re-read on its next turn to see the human's edits.

Table + doc on one slug

A workspace can hold any mix of doc and table surfaces, so you don't need a separate workspace for long-form writing. Keep a table tab for the pipeline and add a doc tab on the same workspace for narrative, decisions, retro notes. Switch via the tab strip in the header.

Recurring recap

Create a weekly-recapdoc. Have an agent replace it every Friday at 5pm with the week's summary. Humans read it over the weekend.

Related: Table mode

Frequently asked questions

What is doc mode in Dock?
A workspace surface that's a TipTap rich-text body instead of a typed-row table. Best for prose: briefs, summaries, status reports, design notes, changelog entries. Both humans and agents edit the same doc body in real time.
How do I create a doc-mode workspace in Dock?
Click `+ New workspace`, pick `Doc` as the default mode. Or, from an agent, `POST /api/workspaces` with `mode: "doc"`, or pass `initial_markdown: "# My doc\n\n…"` and Dock auto-resolves the mode to `doc`.
How do I write to a Dock doc from my AI agent?
MCP `update_doc` for full replacement, `append_doc_section` for additions, or `update_doc_section` for targeted heading-scoped edits. All accept Markdown directly (no need to hand-build ProseMirror JSON); CommonMark + GFM + inline images + native video + Mermaid + KaTeX + callouts + SVG + cross-refs + @-mentions + URL embeds. Learn more →
Can I embed images and videos in a Dock doc?
Yes. Inline images via standard `![alt](url)` markdown, any publicly-reachable HTTPS URL works (200 per doc cap). Native videos via a lone URL on its own line ending in `.mp4`, `.m4v`, `.webm`, `.mov`, or `.mkv`, renders a real `<video controls>` player with no compression, no provider iframe, full source quality (20 per doc, 5 GB per file). The slash menu has dedicated `/image` and `/video` items that open file pickers and push the upload through Vercel Blob (image: server-streamed up to 10 MB; video: client-multipart up to 5 GB). Learn more →
Does Dock's doc mode support Mermaid diagrams?
Yes. Triple-backtick `mermaid` fenced code blocks render as Mermaid diagrams (15 sub-types: flowchart, sequence, gantt, ER, state, class, mindmap, timeline, pie, quadrant, sankey, XY-chart, packet, block, journey). Cap of 50 diagrams per doc, 30KB per source.
Does Dock's doc mode support math equations?
Yes, KaTeX. `$x^2$` for inline, `$$x^2$$` for block. Cap of 500 expressions per doc, 8KB per source. Scripts and href are disabled at render for security.
Can I add callouts (NOTE / TIP / WARNING) in a Dock doc?
Yes, GFM-style: `> [!NOTE]`, `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, `[!CAUTION]`. Renders as styled callout blocks. Useful for agent-written status updates that need to flag attention or warnings.
Can I link from one Dock doc to another?
Yes, via cross-references. `[[slug]]`, `[[org/slug]]`, `[[slug#tab]]`, `[[slug#row-id]]`, `[[slug|display-text]]`. Cross-refs build a knowledge graph (`Backlink` rows on the target's 'Referenced from' sidebar). Cap of 200 per doc.
Can I embed YouTube or Loom videos in a Dock doc?
Yes, via the oEmbed safelist. A lone URL on its own paragraph from YouTube, Vimeo, Loom, Figma, CodePen, or GitHub gists renders as a sandboxed iframe embed. Surrounding prose disqualifies the auto-embed (so it doesn't accidentally swallow links inside sentences).
How do I validate Markdown before writing it to a Dock doc?
MCP `validate_doc_markdown(markdown=…)` returns `{ ok, errors, warnings, parsed }` with per-format counts. Pure parse + analysis, never writes. Useful when iterating on rich-format content to catch cap breaches or unresolved cross-refs before burning a write.
Can humans and AI agents edit the same Dock doc at the same time?
Yes. Real-time SSE streams updates to every connected client. Last-write-wins on the doc body level (Dock isn't CRDT yet); the activity feed shows both edits with full attribution so nothing happens silently.
Updated