{"id":50846373,"url":"https://github.com/oubakiou/mdxg-redline","last_synced_at":"2026-06-14T10:03:05.720Z","repository":{"id":361812509,"uuid":"1241912674","full_name":"oubakiou/mdxg-redline","owner":"oubakiou","description":"Inline review tool for MDXG markdown — capture highlighted comments and export them as structured JSON for LLM agents.","archived":false,"fork":false,"pushed_at":"2026-06-10T07:16:24.000Z","size":38524,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T08:10:27.520Z","etag":null,"topics":["agent-skills","annotations","feedback","human-in-the-loop","inline-comments","llm","markdown","markdown-review","mdxg","single-html"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oubakiou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-18T00:48:17.000Z","updated_at":"2026-06-10T07:16:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/oubakiou/mdxg-redline","commit_stats":null,"previous_names":["oubakiou/mdxg-redline"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/oubakiou/mdxg-redline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oubakiou%2Fmdxg-redline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oubakiou%2Fmdxg-redline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oubakiou%2Fmdxg-redline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oubakiou%2Fmdxg-redline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oubakiou","download_url":"https://codeload.github.com/oubakiou/mdxg-redline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oubakiou%2Fmdxg-redline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34316823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skills","annotations","feedback","human-in-the-loop","inline-comments","llm","markdown","markdown-review","mdxg","single-html"],"created_at":"2026-06-14T10:03:04.985Z","updated_at":"2026-06-14T10:03:05.713Z","avatar_url":"https://github.com/oubakiou.png","language":"TypeScript","funding_links":[],"categories":["Documentation, Knowledge \u0026 Learning"],"sub_categories":[],"readme":"# MDXG Redline\n\n[![MKDN](https://img.shields.io/badge/MKDN-review-red?style=for-the-badge)](https://mkdn.review/?url=https%3A%2F%2Fraw.githubusercontent.com%2Foubakiou%2Fmdxg-redline%2Frefs%2Fheads%2Fmain%2FREADME.md#p:mdxg-redline)\n[![npm](https://img.shields.io/npm/v/mdxg-redline.svg?style=for-the-badge\u0026logo=npm)](https://www.npmjs.com/package/mdxg-redline)\n\n[![English](https://img.shields.io/badge/Language-English-blue?style=for-the-badge)](./README.md)\n[![日本語](https://img.shields.io/badge/言語-日本語-lightgrey?style=for-the-badge)](./README_ja.md)\n\n**MDXG-compliant markdown review tool — runs as a single standalone HTML file, exports review comments as structured JSON for LLM agents.**\n\n\u003e Third-party implementation of [vercel-labs/mdxg](https://github.com/vercel-labs/mdxg). Conforms to the MDXG specification, but is not affiliated with Vercel Labs or the upstream repository.\n\nhttps://github.com/user-attachments/assets/d40ccab2-c7fd-4321-aefc-3e42cc5df9af\n\nIntroduction article: [Accelerating Document Reviews: Introducing MDXG Redline, a High-Speed Markdown Review Tool](https://zenn.dev/oubakiou/articles/764d92a5018e94?locale=en)\n\nMDXG Redline is a browser tool that lets an LLM agent receive feedback on long-form markdown from a human reviewer as **location-aware structured JSON instead of free-form prose**. Sitting between LLM agents and human reviewers, it replaces the ambiguous \"paste markdown, receive prose feedback\" loop with a **machine-readable feedback artifact**.\n\n## Features\n\n- **Read-only**: Rendering conforms to [MDXG Viewer](https://github.com/vercel-labs/mdxg), the read-only renderer profile of the Markdown Experience Guidelines\n- **Location-aware inline comments**: Select any text range, leave a comment, and export JSON that pinpoints each comment with `headingPath` and `sourceLine`\n- **Virtual Pages (Stacked View)**: H1 / H2 boundaries split the document into paper-like sheets stacked vertically; the entire document can be read end-to-end with a single scroll gesture (Word / Pages style)\n- **WASD keyboard navigation**: `a / w / s / d / e / f` cover pane movement, scrolling, activation, and search entirely with the left hand\n- **Smartphone support**: drive `TOC` / `Comment` / `Search` from the footer\n- **Syntax highlighting**: Fenced code blocks render for all Shiki-bundled languages (~235 grammars)\n- **Mermaid support**: ` ```mermaid ` blocks render as SVG\n- **Math rendering**: write math with `$...$` / `$$...$$` syntax like `$i\\hbar \\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)$`, rendered via KaTeX as $i\\hbar \\frac{\\partial}{\\partial t}\\Psi(\\mathbf{r}, t) = \\hat{H}\\Psi(\\mathbf{r}, t)$.\n- **Footnotes**: GitHub Flavored Markdown footnote syntax — inline references like `text with reference[^note]` plus definitions like `[^note]: footnote body` at the end of the document. Footnotes embedded in body text[^readme-fn-example] are automatically gathered into a \"Footnotes\" section at the end of the page.\n- **Swappable markdown preview stylesheet**: Replace the body preview CSS with your own via the CLI `--markdown-css \u003cpath\u003e` flag\n\n## Usage\n\n### Online edition\n\nOpen [`https://mkdn.review/`](https://mkdn.review/) in your browser. Example: [view this README in the online viewer](https://mkdn.review/?url=https%3A%2F%2Fraw.githubusercontent.com%2Foubakiou%2Fmdxg-redline%2Frefs%2Fheads%2Fmain%2FREADME.md#p:mdxg-redline).\n\n### Standalone build\n\nDownload `standalone.html` from [GitHub Releases](https://github.com/oubakiou/mdxg-redline/releases) and open it in your browser.\n\n### CLI (recommended)\n\n#### When a human invokes the CLI directly\n\n```bash\nnpx mdxg-redline path/to/draft.md                        # generate review.html in the same directory and open it\nnpx mdxg-redline path/to/draft.md ./reviews              # when you want a separate output-dir\nnpx mdxg-redline --comments-width 0 path/to/draft.md     # hide the comments panel and open as a plain markdown viewer\n```\n\n#### When an LLM invokes the CLI via a skill\n\n```bash\n# Skill installation example with gh skill install\ngh skill install oubakiou/mdxg-redline md-review --agent claude-code --scope project\n\n# Skill installation example with npx skills add\nnpx skills add oubakiou/mdxg-redline --skill md-review --agent claude-code --yes\n```\n\nAn LLM agent (e.g. Claude Code) invokes this CLI through the `md-review` skill, ping-ponging markdown between the agent and the reviewer. Each round: the agent generates the review HTML → the reviewer comments → feedback.json is written out → the agent picks it up.\n\n```mermaid\nflowchart LR\n    Agent[\"Agent (LLM)\"]\n    Folder[(\"Shared folder\")]\n    Browser[\"Browser (MDXG Redline)\"]\n    Agent -- \"1. Generate \u0026lt;name\u0026gt;-\u0026lt;hash\u0026gt;-review.html\u003cbr/\u003evia review-request CLI\" --\u003e Folder\n    Folder -- \"2. CLI auto-launches default browser\" --\u003e Browser\n    Browser -- \"3. Write \u0026lt;name\u0026gt;-\u0026lt;hash\u0026gt;-feedback.json\u003cbr/\u003evia Write feedback.json\" --\u003e Folder\n    Folder -- \"4. Agent picks it up\" --\u003e Agent\n```\n\n`Write feedback.json` relies on the File System Access API, so only Chromium-based browsers (Chrome / Edge / Arc / Brave / Opera) support it. On Safari / Firefox, fall back to `Comments ▾ → Export as JSON` (download) or `Copy as JSON` (clipboard).\n\n#### CLI options\n\n| Option                                   | Description                                                                                                                                                                                                                                                      | Default              |\n| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |\n| `--no-open`                              | Suppress browser launch. The output path is always printed to stdout so CI scripts and agents can capture it                                                                                                                                                     | (launches browser)   |\n| `--show-open-file`                       | Keep the `Open file` item visible in the generated HTML's `Open ▾` menu. Hidden by default (prevents accidentally loading a different markdown, which would discard the current comments)                                                                        | hidden               |\n| `--show-paste-markdown`                  | Keep the `Paste markdown…` item visible in the generated HTML's `Open ▾` menu. Hidden by default for the same reason as `--show-open-file` (paste also replaces the currently loaded markdown and discards comments)                                             | hidden               |\n| `--document-name \u003cname\u003e`                 | Override the document name (used for the `data-name` attribute and the output filename prefix). Recommended when reading from stdin to get a meaningful filename                                                                                                 | input MD basename    |\n| `--theme \u003csystem\\|light\\|dark\u003e`          | Initial theme hint for the generated HTML (`\u003chtml data-theme\u003e`)                                                                                                                                                                                                  | unset                |\n| `--comments-width \u003c0\\|280-640\u003e`          | Initial width of the comments panel (px). `0` starts with the panel closed (only the right edge tab visible)                                                                                                                                                     | `360` / open         |\n| `--page-nav-width \u003c0\\|180-480\u003e`          | Initial width of the left pages panel (px). `0` starts with the panel closed (only the left edge tab visible)                                                                                                                                                    | `220` / open         |\n| `--shiki-langs \u003cauto\\|all\\|none\\|\u003ccsv\u003e\u003e` | Shiki grammar injection mode. `auto` scans the markdown for fenced languages, `all` injects all bundled grammars (~235, ~5.5 MB gzipped), `none` skips injection (plain text fallback), `\u003ccsv\u003e` takes a list like `ts,js,py`                                     | `auto`               |\n| `--mermaid \u003cauto\\|on\\|off\u003e`              | Mermaid runtime injection mode. `auto` injects only if the markdown has at least one ` ```mermaid ` block, `on` always injects, `off` never injects (Shiki-highlighted fallback). Approx. +700 KB gzipped when injected                                          | `auto`               |\n| `--math \u003cauto\\|on\\|off\u003e`                 | KaTeX runtime injection mode. `auto` injects only if the markdown has at least one `$...$` / `$$...$$` expression, `on` always injects, `off` never injects (raw plain text)                                                                                     | `auto`               |\n| `--math-fonts \u003cminimal\\|all\u003e`            | Font coverage when KaTeX is injected. `minimal` is 9 families (approx. +250 KB gzipped), `all` is 20 families including `\\mathcal` / `\\mathfrak` / `\\mathscr` etc. (approx. +340 KB). Ignored when `--math off`                                                  | `minimal`            |\n| `--markdown-css \u003cpath\u003e`                  | Replace the markdown preview stylesheet. Only the `\u003cstyle id=\"markdown-css\"\u003e` block inside the distributed HTML is swapped; layout / chrome (review.css) is untouched. Author rules under the `#doc` scope. See `dist/markdown.sample.css` for a starting point  | bundled markdown.css |\n| `--lang \u003cauto\\|en\\|ja\u003e`                  | Output language for CLI help / error messages. `auto` infers from env `$LC_ALL` → `$LC_MESSAGES` → `$LANG`. **Affects CLI output only; the generated HTML resolves its display language independently from the browser's `localStorage` / `navigator.language`** | `auto`               |\n| `--help`                                 | Print the usage help and exit                                                                                                                                                                                                                                    | —                    |\n\nOption examples:\n\n```bash\nnpx mdxg-redline \u003cinput.md\u003e ./reviews                      # writes into ./reviews\nnpx mdxg-redline --no-open \u003cinput.md\u003e                      # generate only, do not open browser\ncat spec.md | npx mdxg-redline - --document-name spec.md   # read markdown from stdin\nnpx mdxg-redline --help                                    # print full usage and exit\n```\n\n#### Browser auto-launch\n\n- By default the CLI launches the system browser via `$BROWSER` → `open` (macOS) → `xdg-open` (Linux) → `cmd.exe /c start` (Windows), in that order\n- When VS Code Remote Containers / Codespaces is detected, the CLI instead starts a tiny HTTP server on `127.0.0.1` at port `51729` (override with `MDXG_REDLINE_PORT`) and hands the host browser an `http://localhost:\u003cport\u003e/...` URL (since `file://` paths in the container are invisible to the host). If the preferred port is busy, the CLI falls back to a random port and prints a warning to stderr — **note that random ports may not be forwarded to the host browser if `forwardPorts` is not set to `auto`, so pin a known-free `MDXG_REDLINE_PORT` (or register it in `devcontainer.json` `forwardPorts`) for reliable host access**\n\n#### Generated artifacts\n\n- The review HTML filename is auto-derived as `\u003cinput-md-basename\u003e-\u003cdocHash\u003e-review.html` (per §8 file-naming protocol)\n- The feedback JSON written by the reviewer is `\u003cinput-md-basename\u003e-\u003cdocHash\u003e-feedback.json`. It shares the same prefix as the review HTML, so pairs match mechanically\n- `output-dir` defaults to the input's directory (or cwd when reading from stdin)\n\n#### Cleanup of generated artifacts\n\nBulk-remove the review / feedback pairs that accumulate in a distribution folder with the `--clean` subcommand.\n\n```bash\nnpx mdxg-redline --clean               # target the current directory (dry-run)\nnpx mdxg-redline --clean \u003cdir\u003e         # list deletion candidates (dry-run)\nnpx mdxg-redline --clean \u003cdir\u003e --yes   # actually delete\nnpx mdxg-redline --clean \u003cdir\u003e -r      # also descend into subdirectories\n```\n\n| Option              | Description                                                                                             | Default        |\n| ------------------- | ------------------------------------------------------------------------------------------------------- | -------------- |\n| `--clean [dir]`     | Target `*-\u003cdocHash\u003e-review.html` / `*-\u003cdocHash\u003e-feedback.json` directly under `\u003cdir\u003e` (defaults to cwd) | —              |\n| `--yes`             | Perform the deletion (without it, runs as a dry-run that only lists candidates)                         | dry-run        |\n| `-r`, `--recursive` | With `--clean`, also descend into subdirectories                                                        | top level only |\n| `--keep \u003cdocHash\u003e`  | Preserve the pair for the given 16-hex docHash (may be repeated)                                        | —              |\n\n#### Excluding generated artifacts from git\n\nWhen the output directory (the CLI's `output-dir` or the folder chosen via `Write feedback.json`) lives inside a git repository, add the following patterns to `.gitignore` so that review artifacts are not accidentally committed:\n\n```gitignore\n*-review.html\n*-feedback.json\n```\n\n### Keyboard shortcuts\n\nA WASD-based global keymap lets you drive the entire UI with the left hand only. All shortcuts are single keys without modifiers, so no browser-native shortcut (`Cmd/Ctrl+F` etc.) is overridden.\n\n| Key                                  | Action                                                                             |\n| ------------------------------------ | ---------------------------------------------------------------------------------- |\n| `a` / `d`                            | Move focus to the previous / next pane (TOC ↔ doc ↔ comments, cycles at both ends) |\n| `w` / `s`                            | Move focus up / down within the current pane (line scroll in the doc pane)         |\n| `e`                                  | Activate the focused item (same as `Enter` / click)                                |\n| `f`                                  | Open the in-document search                                                        |\n| `h`                                  | Open the keyboard shortcuts help                                                   |\n| `Esc`                                | Close any open modal, menu, or search                                              |\n| `↑` / `↓` / `Home` / `End` / `Enter` | Work in parallel for MDXG §13 compliance (in-pane movement / activate)             |\n\n## MDXG compliance status\n\nThe [Markdown Experience Guidelines (MDXG)](https://github.com/vercel-labs/mdxg) are currently a preview specification and may change. MDXG Redline embeds an **MDXG Viewer** (the read-only rendering conformance level) and layers inline commenting and structured feedback JSON export on top of it as review-specific features. Viewer features are being adopted incrementally.\n\n| MDXG section             | Required level | Current status |\n| ------------------------ | -------------- | -------------- |\n| §1 Theming               | MUST (Viewer)  | Compliant      |\n| §2 Code Block Rendering  | MUST (Viewer)  | Compliant      |\n| §3 Task Lists            | MUST (Viewer)  | Compliant      |\n| §4 Images                | MUST (Viewer)  | Partial        |\n| §5 Tables                | MUST (Viewer)  | Compliant      |\n| §6 Virtual Pages         | MUST (Viewer)  | Compliant      |\n| §7 Page Navigation       | MUST (Viewer)  | Compliant      |\n| §8 Page Outline          | MUST (Viewer)  | Compliant      |\n| §9 Sequential Navigation | MUST (Viewer)  | Compliant      |\n| §10 Search               | MUST (Viewer)  | Compliant      |\n| §13 Keyboard Navigation  | MUST (Viewer)  | Compliant      |\n| §14 Math Rendering       | SHOULD (Ext.)  | Compliant      |\n| §15 Diagram Rendering    | SHOULD (Ext.)  | Compliant      |\n| §16 Footnotes            | SHOULD (Ext.)  | Compliant      |\n\nFor the roadmap ahead (extension candidates), see [docs/design/roadmap.md](docs/design/roadmap.md). For MDXG per-section compliance status and design decisions, see [docs/design/DESIGN.md §12](docs/design/DESIGN.md#12-mdxg-準拠状況と設計判断).\n\n## Development\n\nThe build tool is [Vite+ (vp)](https://viteplus.dev/), installed via npm (`vite-plus`) as a dev dependency. The devcontainer and `local_setup.sh` handle setup, so using those is the fastest path for local development.\n\n`vp build` is the shortest command and only produces the main build artifacts (`dist/standalone.html` / `dist/embed-template.html`). To produce the full distribution set (mermaid runtime, KaTeX runtime, and the review-request CLI as well), run `npm run build`.\n\n```bash\nvp build        # Generates only dist/standalone.html and dist/embed-template.html (shortest)\nnpm run build   # Generates the full distribution (mermaid / katex / standalone / embed-template / review-request)\nvp check --fix  # Runs format / lint / type checks together (--fix auto-fixes)\nvp test         # Runs in-source tests\n```\n\nDesign intent, structure, and trade-offs are documented in the design document [docs/design/DESIGN.md](docs/design/DESIGN.md). Table of contents:\n\n- [1. Overview](docs/design/DESIGN.md#1-概要)\n- [2. Constraints](docs/design/DESIGN.md#2-制約)\n- [3. User flow](docs/design/DESIGN.md#3-ユーザーフロー)\n- [4. Architecture](docs/design/DESIGN.md#4-アーキテクチャ)\n- [5. Data model](docs/design/DESIGN.md#5-データモデル)\n- [6. Comment anchoring](docs/design/DESIGN.md#6-コメントのアンカリング)\n- [7. Persistence layer](docs/design/DESIGN.md#7-永続化レイヤー)\n- [8. Workspace protocol](docs/design/DESIGN.md#8-ワークスペースプロトコル)\n- [9. Boot sequence](docs/design/DESIGN.md#9-起動シーケンス)\n- [10. Browser compatibility](docs/design/DESIGN.md#10-ブラウザ互換性)\n- [11. Security and privacy](docs/design/DESIGN.md#11-セキュリティとプライバシー)\n- [12. MDXG compliance status and design decisions](docs/design/DESIGN.md#12-mdxg-準拠状況と設計判断)\n\nThe build pipeline (formerly §13) and UI internationalization (formerly §14) have been split into standalone documents:\n\n- [Build pipeline](docs/design/build-pipeline.md) — vp build / split-outputs / distribution artifacts / source responsibility boundaries\n- [UI internationalization](docs/design/i18n.md) — language resolution priority / translation dictionaries and runtime / DOM integration\n\n## License\n\nMIT\n\n[^readme-fn-example]: This is an actual footnote that renders inside the README. It ends up in the same \"Footnotes\" section both on GitHub and inside MDXG Redline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foubakiou%2Fmdxg-redline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foubakiou%2Fmdxg-redline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foubakiou%2Fmdxg-redline/lists"}