@openpress-comment
Comment markers
Inline review markers live as MDX comments in source. The workbench renders them as numbered pins; agents resolve them with the apply-comments workflow. No external comments database.
OpenPress comments are not a separate service. Each comment is an MDX comment block written directly into the source file — the workbench reads them at render time and surfaces them as interactive pins. This means comments travel with the document in git, survive across branches, and can be resolved by any tool that edits MDX (including AI agents).
Marker format
A standard MDX comment block whose first attribute name matches @openpress-comment. The engine parses it during MDX compilation and emits a pin in the workbench.
{/* @openpress-comment id="c-2026-05-28-abc" ts="2026-05-28T12:34:00Z" text="..." */} Attributes
| Name | Type | Default | Description |
|---|---|---|---|
id required | string | Stable identifier. The workbench generates one when you create a comment from the UI; agents should re-use existing ids when editing. | |
ts required | ISO 8601 | Creation timestamp. Surfaced in the workbench tooltip and used for sort order in the pending-comments panel. | |
text required | encoded string | The comment body. Encoded so it can survive MDX parsing — line breaks, quotes, and unicode pass through unchanged. | |
author | string | Optional. Free-form label ("Q", "reviewer", "GPT-5"). |
The model assumes uniform demand across the network — see
chapter 3 for the relaxation under sparse-link conditions.
{/* @openpress-comment id="c-2026-05-28-uniform-demand" ts="2026-05-28T12:34:00Z" text="Is 'uniform' the right word here? Maybe 'isotropic'?" author="reviewer" */} Multiple markers can sit next to the same content. The workbench groups them on the same block but renders separate pins so each comment stays addressable. Position in source determines visual order in the panel.
Authoring comments
From the workbench (humans)
- Run
npm run dev, openhttp://127.0.0.1:5173/workspace. - Toggle the inspector from the toolbar.
- Click a block (or the insertion bar between blocks) → Add comment.
- Type the comment, submit with
Cmd/Ctrl + Enter. - The workbench writes the marker back into the MDX source and saves the file.
From an agent (Claude / Codex / Cursor)
- Search the source file with
open-press search . "<query>" --jsonto locate the block. - Insert a marker line directly after the target prose. Use a fresh
id(UUID-ish — convention isc-YYYY-MM-DD-<slug>) and a current ISO timestamp. - Use
open-press replace . "<old>" "<new>" --applyor write the file directly with the editor's MDX edit tool.
Resolving comments
Comments are inline TODOs for the document. The workflow is read → decide → edit source → remove marker. Removing a marker is a positive action that signals "this is handled" — never delete one without applying the change (or recording the decision to skip).
rg "@openpress-comment" press/ -n
Agents have a dedicated workflow for this — see the CLI Tools
page and the bundled openpress-apply-comments skill. The skill's contract:
- List every pending marker.
- For each, read the surrounding prose, decide on a source edit, apply it.
- Delete the marker only after the edit is in place.
- Run
npm run buildto verify nothing broke. - Report which markers were resolved and which (if any) were left because they needed a human decision.
Anti-patterns
- Don't reuse ids across documents. The
idis the addressing key for the workbench pin — duplicates break navigation. If you fork a chapter and need to keep a marker, regenerate the id. - Don't clear a marker without an action. Markers are commitments. Either apply the change, or replace the marker with a follow-up TODO comment explaining why it's being held.
- Don't hand-write the encoded
text. Use the workbench, or let the agent generate it — manual escaping of quotes / newlines is error-prone.