mk:markdown-reader
Serves markdown files as a book-like local reader with Mermaid diagrams and plan navigation.
| Source | .claude/skills/markdown-reader/SKILL.md |
| Owner | utility |
| Runtime | claude-code |
| Risk | medium |
What it does
Serves markdown files as a book-like reader on 127.0.0.1 and opens them in the browser. Use it for long-form reading: plan phase files, RFCs, runbooks, design docs, reports and specs. A plan folder with plan.md and phase-*.md files gets a sidebar with status badges and Prev and Next buttons.
When not to use
To render code, architecture or a diff as an explainer or diagram use mk:preview. For packaged deliverables use mk:showcase.
Usage
Install the dependencies once (marked, highlight.js, gray-matter). Without them the reader returns "Error 500: Error rendering markdown".
A rendered file is treated as text, not as a program. Front-matter is parsed as YAML or JSON only, raw HTML in the markdown is shown escaped, and the page runs no script from the file. The local server answers only requests addressed to 127.0.0.1 or localhost, serves files inside the project only, and refuses dotfiles and credential-named files.
cd .claude/skills/markdown-reader && npm install
node .claude/skills/markdown-reader/scripts/server.cjs --file ./tasks/plans/my-plan/plan.md
node .claude/skills/markdown-reader/scripts/server.cjs --dir ./tasks/plans
node .claude/skills/markdown-reader/scripts/server.cjs --stop| Flag | Effect |
|---|---|
--file <path> | Open one markdown file |
--dir <path> | Browse a directory |
--port <number> | Initial port. The default is 3456, and it moves up to 3500 if busy |
--no-open | Do not open the browser |
--foreground | Keep the process attached, for task runners |
--stop | Stop all running instances |
--background is a legacy flag. Flags, routes and state are in references/reader-operations.md, and features and shortcuts are in references/reader-experience.md.
What you get
The reader has a 720px text column, light and dark themes, reading progress, syntax highlighting and Mermaid diagrams that expand on click. Shortcuts: ? help, T theme, S sidebar, arrow keys for plan phases, Esc.
Safety and state
The server binds to 127.0.0.1 only, so files are not reachable from other devices. It checks every path against its allowed directories and answers path traversal with 403. Images must use paths relative to the markdown file. PID files live in ${CLAUDE_PLUGIN_DATA}/markdown-reader/, or ~/.cache/mewkit/markdown-reader/ when that variable is unset.
Gotchas
Run --stop when you finish reading. If --stop does not clear an instance, look for stale .pid files in the state folder.