Agent skill

Md2html

by haidang1810 in haidang1810/md2html

Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC.

MITAuto-check passedDevOps & Cloud

Install Md2html

skills CLI
$ npx skills add haidang1810/md2html --skill md2html -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install haidang1810/md2html md2html --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
md2html
GitHub stars
421
Token cost
~3k tokens
SKILL.md length
1,471 words
Files
10
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC.

  • Works in 4 steps: Resolve inputs → Analyze the source document → Build the output HTML → …
  • Tasks that involve Runbooks and postmortems
  • SKILL.md covers Usage, Skill files (resolved relative…, What you must do when invoked and Critical rules, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Md2html is an agent skill from haidang1810/md2html. Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC. Claude-orange light+dark theme. Multi-language. Portable across Claude Code / Codex / Antigravity / any AI agent.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files (for example `README.md`, `components.md` and `examples/example-plan.md`).

It sits in DevOps & Cloud, covering Runbooks and postmortems, Brainstorming and HTML artifacts. The repository describes itself as: Your AI writes docs — md2html turns them into pages people actually read. A portable skill for Claude Code / Codex / Antigravity that converts long-form Markdown (plans, specs… The licence is MIT.

When your agent uses it

  • Tasks that involve Runbooks and postmortems
  • Tasks that involve Brainstorming
  • Tasks that involve HTML artifacts

Example prompts

  • “/md2html”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Resolve inputs
  2. Analyze the source document
  3. Build the output HTML
  4. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 82fa59c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Md2html loads about 3k tokens when it runs. Until then it costs about 81 tokens; SKILL.md has 1,471 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from haidang1810/md2html at commit 82fa59c, republished under its MIT licence (© haidang1810). 1,471 words, ~3,026 tokens.

Download SKILL.mdSave it as .claude/skills/md2html/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
md2html
description
Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC. Claude-orange light+dark theme. Multi-language. Portable across Claude Code / Codex / Antigravity / any AI agent.
trigger
/md2html

/md2html

Convert a verbose Markdown document into a single, self-contained HTML file that a tired human can actually scan: diagrams instead of paragraphs, step cards instead of numbered lists, callouts for the parts that matter.

Usage

/md2html <file.md>             # output <file>.html next to source
/md2html <file.md> --out X.html # custom output path
/md2html                       # if no arg, ask user which file

Skill files (resolved relative to this SKILL.md)

  • template.html — HTML skeleton with embedded CSS (Claude orange light+dark), Mermaid CDN, theme toggle, TOC sidebar, footer. Contains {{PLACEHOLDER}} strings and <!-- COMMENT --> slots.
  • components.md — catalog of HTML snippets you must copy verbatim (step cards, callouts, mermaid blocks, pros-cons, comparison cards, collapsibles).
  • examples/ — at least one reference <doc>.md → <doc>.html pair. Read one to calibrate output quality before starting.

You MUST read all three before writing output. Do not invent CSS classes or skip the catalog.

What you must do when invoked

Follow these steps in order. Do not skip.

Step 1 — Resolve inputs
  1. Determine the source file from the user's invocation. If none given, ask: "Tệp .md nào cần convert?" and stop.
  2. Read the source .md fully.
  3. Read template.html and components.md from the same directory as this SKILL.md.
  4. Read one example pair under examples/ to calibrate.
Step 2 — Analyze the source document

Do this analysis silently in your head (or as one short summary line to the user). Identify:

  • Language of the source — detect from the actual prose, not the filename. Set <html lang="..."> to the ISO 639-1 code (en, vi, zh, ja, ko, es, fr, de, ru, ar, th, …) and translate every UI label to that language.

    Common samples (extend to any language using the same scheme):

    KeyENVIZH (中文)JA (日本語)KO (한국어)ES (Español)
    TOC titleContentsMục lục目录目次목차Contenido
    Read-time~N min read~N phút đọc~N 分钟阅读~N 分で読了~N분 소요~N min de lectura
    Recommended★ Recommended★ Đề xuất★ 推荐★ 推奨★ 추천★ Recomendado
    Key pointKey pointÝ chính要点要点핵심Idea clave
    Pros✓ Pros✓ Ưu điểm✓ 优点✓ 長所✓ 장점✓ Ventajas
    Cons✕ Cons✕ Nhược điểm✕ 缺点✕ 短所✕ 단점✕ Desventajas
    Print tooltipPrint / Save PDFIn / Lưu PDF打印 / 保存 PDF印刷 / PDF 保存인쇄 / PDF 저장Imprimir / Guardar
    Theme tooltipToggle themeĐổi theme切换主题テーマ切替테마 전환Cambiar tema
    Source: prefixSource:Nguồn:来源:ソース:소스:Fuente:

    For any language not listed, translate using the same conventions. The "Recommended" badge is configured via the --rec-label CSS variable set on <html> (no per-language CSS needed) — see {{REC_LABEL}} below.

    RTL languages (Arabic, Hebrew, Persian) — current template is LTR-only. If source is RTL, also add dir="rtl" to <html> and consider it a known visual limitation (sidebar will stay on the left).

  • Title — from first H1 or filename. Title should be ≤ 80 chars.

  • Subtitle — first paragraph after H1, or the document's TL;DR sentence. ≤ 200 chars.

  • Doc type — infer one of: PLAN, SPEC, SYSTEM DESIGN, RFC, RUNBOOK, POSTMORTEM, BRAINSTORM, NOTES. Pick the closest match based on the document's purpose, not its filename. Brainstorm = exploring options with rationale; Plan = ordered steps to a goal; Spec = exact behavior contract; System design = architecture + tradeoffs; RFC = proposal seeking feedback; Runbook = operational procedure; Postmortem = incident review. The uppercase code in the eyebrow stays universal; the topbar BRAND_LABEL localizes (Plan / Kế hoạch / 计划 / etc).

  • Reading time — words ÷ 250, round to nearest minute. Format: ~N min read (EN) or ~N phút đọc (VI).

  • Section map — walk each H2/H3 and tag with the BEST component using §11 cheatsheet in components.md:

    • numbered action list → Timeline
    • architecture/flow prose → Mermaid
    • "ưu/nhược", "pros/cons" → Pros-Cons
    • "option A vs B" → Comparison cards
    • critical conclusion → Key-point highlight
    • warnings/decisions → Callouts
    • long appendix → Collapsible
    • everything else → plain <h2> + <p>
Step 3 — Build the output HTML
  1. Copy the full template.html content into a string. Do NOT use Read-then-Edit on a file you haven't created; instead, build the output buffer in memory then Write once.
  2. Replace placeholders in the template (all values come from Step 2 analysis, language-matched):
    • {{LANG}} → ISO 639-1 code: en / vi / zh / ja / ko / es / …
    • {{REC_LABEL}} → text shown on the "Recommended" comparison-card badge, e.g. ★ Recommended / ★ Đề xuất / ★ 推荐 / ★ 추천. Sets the --rec-label CSS variable on <html>. If you forget this, CSS falls back to ★ Recommended.
    • {{TITLE}} (appears twice: <title> and .doc-title)
    • {{SUBTITLE}}
    • {{DOC_TYPE}} → universal uppercase code: PLAN, SPEC, SYSTEM DESIGN, RFC, RUNBOOK, POSTMORTEM, BRAINSTORM, NOTES
    • {{SOURCE_FILE}} → basename of source (e.g. plan.md)
    • {{DATE}} → ISO date or localized "Updated <today>"
    • {{READ_TIME}} → localized reading time, e.g. ~3 min read / ~3 phút đọc / ~3 分钟阅读
    • {{BRAND_LABEL}} → localized doc-type label for the topbar
    • {{TOC_TITLE}} → localized "Contents" (also used as aria-label for the TOC drawer)
    • {{PRINT_TOOLTIP}} → localized print tooltip
    • {{THEME_TOOLTIP}} → localized theme-toggle tooltip
    • {{CLOSE_LABEL}} → localized "Close" (used for the mobile TOC drawer close button), e.g. Close / Đóng / 关闭 / 閉じる
    • {{SKIP_LINK_LABEL}} → localized skip-to-content link text, e.g. Skip to content / Bỏ qua menu / 跳到正文
    • {{FOOTER_NOTE}} → localized source attribution (e.g. Source: plan.md / Nguồn: plan.md / 来源: plan.md)
  3. Replace <!-- TOC_ENTRIES --> with one <a> per H2/H3 (see §2 in components.md). Generate stable kebab-case id from heading text.
  4. Replace the slot between <!-- CONTENT_START --> and <!-- CONTENT_END --> with the document body, section by section, using components from components.md. Each section must:
    • Start with <h2 id="..."> (matching the TOC entry).
    • Use ONE primary component per logical chunk (don't stack 3 callouts in a row).
    • Preserve original meaning — do not summarize away technical detail; condense only filler/repetition.
  5. Write the assembled HTML to the output path.
Show full SKILL.md (606 more words)Show less
Step 4 — Verify

After writing, do ONE quick sanity check by re-reading just the section you generated (not the whole file):

  • Every id="..." referenced in the TOC exists on a heading.
  • No leftover {{PLACEHOLDER}} strings.
  • Mermaid blocks have valid syntax (use flowchart, sequenceDiagram, erDiagram, stateDiagram-v2, or gantt — never bare graph without direction).
  • No <script> tags added beyond what template.html already includes.

Report back to the user with:

  • Output file path
  • 1-line summary of what changed (e.g. "Rendered 7 sections: 1 mermaid flow, 2 step timelines, 4 callouts. ~6 phút đọc.")
  • A reminder they can open it with xdg-open <file>.html (Linux) / open <file>.html (mac).

Critical rules

  1. Never paraphrase technical content into vague prose. A step chạy migration 0042_user_schema.sql must remain that exact filename — don't change to chạy migration mới.
  2. One component per chunk. Don't wrap a callout inside a step card inside a collapsible. Keep nesting flat.
  3. Mermaid > prose for any flow ≥ 3 hops. If the source says "A gọi B, B gọi C, C ghi DB", make a diagram.
  4. Key-point highlights are rare. Max 1 per H2 section, ideally 2-3 total per document.
  5. UI text follows the detected source language — including for non-EN/non-VI sources (Chinese, Japanese, Korean, Spanish, etc). Use the language sample table in Step 2 or translate equivalently. Code, commands, file names, library names, error messages stay verbatim regardless of language.
  6. Self-contained output. No external file references except the CDN scripts already in template.html.
  7. Do not modify template.html or components.md — those are the skill's source of truth. Only Write the output .html.
  8. Use SVG icons only — never emojis. Every icon is <svg class="..."><use href="#i-NAME"/></svg> referencing the sprite at the top of <body>. See §13 in components.md for the catalog. No emoji glyphs anywhere in callouts, doc-meta, topbar, or body content.
  9. Anchor links and copy-to-clipboard auto-inject via JS — do NOT add them manually. Just give H2/H3 a proper id, and put code in <pre><code>. The template's boot script handles the rest.
  10. Wrap wide tables in .table-wrap — see components.md §14b. Tables ≥ 4 columns or with long cells need the wrapper for mobile scroll.
  11. Use <figure> + <figcaption> for images with descriptive alt. See components.md §14a.

Cross-AI compatibility

This skill is designed to run identically on:

  • Claude Code — install at ~/.claude/skills/md2html/ (this directory, symlinked or copied). Invoke with /md2html <file>.
  • Codex CLI — copy SKILL.md content to ~/.codex/prompts/md2html.md, keep template.html and components.md at a stable absolute path, update the file references in SKILL.md if needed. Invoke with /md2html.
  • Antigravity — add SKILL.md as a custom prompt/agent instruction, ensure the agent has Read/Write tool access to the skill folder.

The only external dependency is mermaid via CDN (resolved at HTML open time, not at skill execution time). No npm/pip install required for the skill itself.

Edge cases

  • Source has no headings — wrap content in one <h2 id="content">Nội dung</h2> and infer logical breaks from blank lines + topic shifts.
  • Source has existing mermaid code blocks — keep them, just rewrap in <figure class="diagram"> with caption.
  • Source has HTML embedded — pass through as-is inside <div> if safe, else escape.
  • Source is very short (< 200 words) — skip TOC sidebar (delete <aside class="toc"> block), render as single column.
  • Source is very long (> 5000 words) — collapse low-priority sections by default with <details>.
  • Output file already exists — overwrite. The source .md is canonical; HTML is regenerated artifact.

Anti-patterns

  • ❌ Generating the HTML in many small Edit calls — produces drift. Build full string, Write once.
  • ❌ Adding new CSS via <style> — extend template.html instead and tell the user.
  • ❌ Translating proper nouns or code identifiers.
  • ❌ "Improving" the source by adding info not in the original.
  • ❌ Reporting success without running Step 4 verification.

© haidang1810, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files in the repository root of haidang1810/md2html.

  • SKILL.md
  • .gitignore
  • LICENSE
  • README.md
  • components.md
  • docs/preview-dark.png
  • docs/preview-light.png
  • examples/example-plan.html
  • examples/example-plan.md
  • template.html

Open the folder on GitHubat commit 82fa59c

Compare with similar skills

Md2html next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Md2html compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Md2html this skillhaidang1810/md2html421—~3kAutomated safety check: PassMIT
Trader Memory Coretradermonty/claude-trading-skills3k3 repos~4.3kAutomated safety check: PassMIT
OpenRig Upgrade Proceduremvschwarz/openrig5.9k1 repos~2.9kAutomated safety check: PassApache-2.0
Author Migrationnrwl/nx29k—~12kAutomated safety check: NotesMIT
Write Notes Like Deepseekczm15053/write-notes-like-deepseek484—~2kAutomated safety check: PassNone
GreptimeDB Release RunbookGreptimeTeam/greptimedb6.7k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Trader Memory Core

    tradermonty/claude-trading-skills

    Track investment theses across their lifecycle — from screening idea to closed position with postmortem.

    3k GitHub starsUsed in 3 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • OpenRig Upgrade Procedure

    mvschwarz/openrig

    Walks an agent through upgrading the OpenRig CLI and daemon one observed step at a time, keeping live seats alive and reconciling managed plugin files.

    5.9k GitHub starsUsed in 1 repo~2.9k tokens
    DevOps & CloudAuto-check passed
  • Author or scope a first-party Nx migration. An agent skill from nrwl/nx.

    29k GitHub stars~12k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Write Notes Like Deepseek

    czm15053/write-notes-like-deepseek

    A skill your agent uses when a change is non-trivial by DSH standards (behavior, architecture, cross-file contracts, process/tooling, testing strategy, or on-disk/wire/config formats), when choosing…

    484 GitHub stars~2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • GreptimeDB Release Runbook

    GreptimeTeam/greptimedb

    Runbook for publishing a GreptimeDB version: pick the release branch, verify the Cargo version, then tag, create the GitHub release and open the docs note PR.

    6.7k GitHub stars~1.4k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Statem

    henryqin1997/statem

    A skill your agent uses when a long coding or research task should be managed with statem state-machine runbooks, including creating specs, starting or resuming runs, checking current state…

    1.3k GitHub stars~1.2k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed

Categories

Questions about Md2html

What does Md2html do?

Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC. Md2html is an agent skill from haidang1810/md2html. Convert long-form Markdown (plan, spec, system design, RFC, runbook, postmortem, brainstorm, notes) into a single self-contained HTML page with Mermaid diagrams, step timelines, callouts, sidebar TOC.

When should I use Md2html?

Md2html fits situations like: tasks that involve Runbooks and postmortems; tasks that involve Brainstorming; tasks that involve HTML artifacts.

How do I install Md2html in Claude Code?

Run `npx skills add haidang1810/md2html --skill md2html -a claude-code`. Or copy the skill folder (the haidang1810/md2html repository) into .claude/skills/md2html in your project. Claude Code loads it when a task matches its description.

How do I install Md2html in Codex?

Run `npx skills add haidang1810/md2html --skill md2html -a codex`. Or copy the skill folder (the haidang1810/md2html repository) into .agents/skills/md2html in your project. Codex loads it when a task matches its description.

Can I use Md2html in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add haidang1810/md2html --skill md2html -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/md2html, .gemini/skills/md2html, .github/skills/md2html and .opencode/skills/md2html in your project.

What does Md2html need to run?

SKILL.md names no scripts, command-line tools or credentials: Md2html is instructions for the agent only. Our summary lists: Python 3.

Does Md2html access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Md2html safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Md2html use?

Md2html is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Md2html use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Md2html?

Skills that share tags, products or a category with Md2html: Trader Memory Core (tradermonty/claude-trading-skills, 3k stars), OpenRig Upgrade Procedure (mvschwarz/openrig, 5.9k stars), Author Migration (nrwl/nx, 29k stars) and Write Notes Like Deepseek (czm15053/write-notes-like-deepseek, 484 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Md2html?

haidang1810 (a GitHub user) maintains it in haidang1810/md2html, which has 421 GitHub stars. The repository was last updated on May 14, 2026.

Source: haidang1810/md2html on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.