markdown-preview
Render a Markdown file to GitHub-flavored HTML and open a styled local preview (light + dark) in the browser. Use when the user wants to preview markdown, see how a README renders on GitHub, check that relative screenshots or images display correctly, or get a GitHub-like local preview without installing grip or glow.
- License 许可
- MIT
- 所属仓库
- drn/dots
- 最近更新
- 2026-11-12
- Stars
- ★ 23
- Forks
- 4
01 前言 Front Matter
- name
- markdown-preview
- description
- Render a Markdown file to GitHub-flavored HTML and open a styled local preview (light + dark) in the browser. Use when the user wants to preview markdown, see how a README renders on GitHub, check that relative screenshots or images display correctly, or get a GitHub-like local preview without installing grip or glow.
- allowed-tools
- Bash(bash *), Bash(gh api *), Bash(rm *-preview.html), Read, Edit
02 资源文件 21
- 参考文档references/ao-claim-pr-vs-new-pr-2026-07-27.md5.3 KB
- 参考文档references/ao-go-v1-cli-quirks.md6.4 KB
- 参考文档references/ao-spawn-agent-plugin-failures.md6.2 KB
- 参考文档references/ao-spawn-all-providers-exhausted-2026-07-23.md7.8 KB
- 参考文档references/ao-spawn-daemon-internal-error-2026-07-24.md7.6 KB
- 参考文档references/ao-spawn-internal-error-orphan-sessions-2026-07-21.md6.9 KB
- 参考文档references/ao-spawn-model-probe-failure.md6.2 KB
- 参考文档references/ao-spawn-preflight-gh-auth-vs-shell-pass-2026-07-14.md3.6 KB
- 参考文档references/ao-spawn-runner-saturation.md6.2 KB
- 参考文档references/ao-spawn-ts-cli-auth-and-20-slot-cliff-2026-07-22.md6.5 KB
- 参考文档references/ao-thread-status-reporting-2026-07-24.md10.1 KB
- 参考文档references/babysit-one-session-post_to_thread-fix.md3.9 KB
- 参考文档references/ghost-session-spawn-failure-2026-07-29.md6.4 KB
- 参考文档references/launchd-env-wrapper-github-token-gap-2026-07-14.md3.0 KB
- 脚本references/manual-babysit-template.sh4.8 KB
- 参考文档references/preflight-sibling-pr-same-campaign.md5.7 KB
- 参考文档references/project-local-beads-routing.md6.4 KB
- 参考文档references/repeated-fix-recurrence-preflight.md6.9 KB
- 参考文档references/rest-pr-create-rate-limit-fallback.md3.3 KB
- 参考文档references/worker-races-branch-reset.md5.6 KB
- 脚本scripts/render.sh8.6 KB
03 SKILL.md 正文
Markdown Preview
Render a Markdown file the way GitHub would (GFM: tables, task lists, fenced
code) and open a self-contained, GitHub-styled HTML preview with light and dark
support. Rendering goes through gh api /markdown, so no local renderer
(grip/glow) is needed — only an authenticated gh CLI and jq.
The preview is written ALONGSIDE the source file by default. This is
deliberate: relative image paths (e.g. screenshots/foo.png) only resolve when
the HTML lives in the same directory as the markdown.
When to stop and ask
- If no markdown file path is given and none is obvious from context, ask the user which file to preview. Do not guess.
- If the file is not a markdown file (
.md/.markdown), confirm before rendering.
Privacy note
gh api /markdown sends the file's contents to GitHub over the network. This
is fine for public README / docs content. If the markdown contains anything
sensitive, tell the user it will leave the machine and confirm before rendering.
Workflow
Step 1 — Resolve the file
Identify the markdown file path from the argument ($1) or conversation
context. Confirm it exists.
Step 2 — Render and open
Run the render script. <skill-dir> is the directory containing this SKILL.md:
bash <skill-dir>/scripts/render.sh <file.md>
This renders via gh api /markdown, writes <file>-preview.html next to the
source, and opens it in the default browser (macOS open, Linux xdg-open,
Windows start).
Useful flags:
--no-open— write the preview but do not launch a browser.--out <path>— choose the output path (requires a value). Use ONLY when the markdown has no relative images; a path outside the source directory breaks relativesrc.--print-path— print only the written preview path to stdout (instead of the friendly "Wrote preview:" line). Use when chaining or capturing the path.
The script prints the preview path it wrote. Note that path for the cleanup
step — it is <file>-preview.html next to the source unless --out overrode it.
If the script reports a missing dependency or a failed render, relay the error and do not retry more than once:
ghnot installed → install the GitHub CLI, or fall back togrip/glow.gh api /markdownfailed → likely an auth issue; suggestgh auth status.jqnot installed → installjq(required to encode the request body).
Step 3 — Cleanup
The preview is a temporary artifact and should not be committed. After the user is done viewing:
- Offer to remove it, using the exact preview path the script reported (the
default is
<file>-preview.html; it differs when--outwas used). Auto-run ofrmis pre-approved only for the default*-preview.htmlname; removing a custom--outpath will prompt for confirmation, which is fine. - If the file sits inside a git repository, optionally suggest adding
*-preview.htmlto.gitignoreso regenerating it does not leave untracked files (this was the original pain point this skill was built to avoid).
To re-preview after editing the markdown, just rerun Step 2 — it overwrites the existing preview.
04 同仓库更多 Skills
batch-pr-review
Review a batch of pull requests together, describe every change in plain language, and build a private Claude artifact that eases human review, with a severity-tagged and verified findings list. Use when asked to review several PRs, a stack of PRs, PRs listed in a Slack thread or message, or to summarize a batch of PRs for a reviewer.
plannotator-setup-goal
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.
plannotator-annotate
Open Plannotator's annotation UI for a markdown file, converted HTML file, URL, or folder and then respond to the returned annotations.
write-skill
Create or improve a Claude Code skill/slash command with best practices for structure, dynamic context, and safety. Use for creating new skills, improving existing ones, or learning skill authoring.
wrapup
End-of-session checklist that detects loose ends — uncommitted changes, unmerged branches, learnings to capture, handoffs needed — and routes to the right skills. Use for session closeout, wrapping up, end of day, or "anything else to capture".
tts
Read text aloud using text-to-speech. Use when the user says "speak to me", "read to me", "read this aloud", "say this", "speak the summary", or asks to hear something spoken.