opencode-document-review

August 9, 2026 ยท View on GitHub

An OpenCode plugin for reviewing Markdown in a local browser. Select text to add a comment, suggest a replacement, or suggest deletion. The browser never edits the Markdown source.

Data contract

  • Any explicit absolute .md or .markdown path readable by the current OS user can be reviewed.
  • Relative paths resolve from the active OpenCode directory.
  • Review records are stored beside the document as <document>.review.jsonl.
  • The sidecar is an append-only log; the latest record for an annotation ID is its current state.
  • Records contain quote anchors, a source SHA-256 hash, status, timestamps, and optional replacement text.
  • Source changes are applied by an agent through normal OpenCode file-editing tools, not by the browser.

OpenCode tools

  • document_review_start: start or reuse a local review session.
  • document_review_list: read active or all review records.
  • document_review_update: mark a comment or suggestion handled.
  • document_review_stop: stop a local review session.

The HTTP server binds only to 127.0.0.1, validates the loopback Host and same-origin requests, uses a random write token, disables CORS, and serves only the selected Markdown rendering plus bundled static assets. Sidecar updates use a cross-process lock and reject symbolic-link sidecars.

Install from GitHub

Add the fixed GitHub tag to ~/.config/opencode/opencode.json:

{
  "plugin": ["github:yabo083/opencode-document-review#v0.1.1"]
}

Restart OpenCode after changing plugin configuration.

Development

npm install
npm test
npm run check

License

MIT