md-document — скилл для Claude Code: что делает и как установить
Конвертирует длинные Markdown-файлы в автономные HTML-страницы с поиском, оглавлением и токенами дизайн-системы. Пригодится для публикации RFC, отчётов и спек.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install markdown-html-skills@claude-code-skillsЧто делает md-document
Скилл обрабатывает тексты длиннее 100 строк через цепочку трех скриптов на стандартной библиотеке Python. Сначала markdown_parser.py строит JSON AST, затем html_renderer.py собирает страницу с 12 переменными вашей дизайн-системы, а interactivity_injector.py внедряет фильтр поиска и scrollspy.
Результат сохраняется в один файл doc-{slug}.html без фреймворков и этапа сборки. Внешние вызовы ограничены загрузкой Google Fonts и Prism.js через CDN. Конвертер поддерживает таблицы GFM, якоря для заголовков и блоки предупреждений вроде [!NOTE], но игнорирует вложенные списки и сноски. Доступны три стиля оформления: editorial шириной 720px, скругленный playful и плотный technical.
Инструмент требует обязательной настройки дизайн-системы через /cs-design-system и отказывается работать без нее. Если ваш файл короче 100 строк или содержит diff-блоки кода, ставить этот скилл нет смысла — для разбора кода лучше взять md-review, а короткие тексты удобнее читать прямо в терминале.
Какие задачи решает
- Собрать интерактивную HTML-страницу из длинной спецификации или RFC
- Добавить в документ плавающее оглавление со scrollspy и поисковый фильтр
- Оформить таблицы и предупреждающие коллауты по стандартам WCAG AA
- Встроить подсветку Prism.js и кнопки копирования кода без сборщиков проекта
Примеры запросов агенту
- /cs-md-document docs/architecture-spec.md
- Конвертируй этот отчёт в HTML со стилем editorial
- Собери RFC в интерактивный HTML-документ
Как установить md-document
1Через маркетплейс плагинов
/plugin marketplace add alirezarezvani/claude-skills/plugin install markdown-html-skills@claude-code-skillsКоманда ставит плагин markdown-html-skills целиком, со всеми его скиллами
2Через Skills CLI (Vercel)
npx skills add alirezarezvani/claude-skills --skill md-document -a claude-code3Вручную: положить файлы
~/.claude/skills/md-document/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/md-document/
Вручную: положить файлы
.agents/skills/md-document/SKILL.mdДля всех проектов — ~/.agents/skills/
Вручную: положить файлы
.cursor/skills/md-document/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install alirezarezvani/claude-skills md-document2Вручную: положить файлы
.github/skills/md-document/SKILL.mdКомандой платформы
gemini skills install https://github.com/alirezarezvani/claude-skills --path markdown-html/skills/md-documentВручную: положить файлы
.devin/skills/md-document/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
Из того же набора349
Весь набор →Похожие
Вопросы о md-document
Как установить md-document в Claude Code?
Выполните команду /plugin marketplace add alirezarezvani/claude-skills внутри Claude Code или добавьте пакет через npx skills add alirezarezvani/claude-skills --skill md-document -a claude-code.
Что делает md-document?
Преобразует Markdown в один HTML-файл с боковым оглавлением, быстрым поиском, кнопками копирования блоков кода и встроенными CSS-переменными темы оформления.
Почему скилл отказывается конвертировать файл?
Скилл прерывает работу, если документ содержит меньше 100 строк текста либо в проекте ещё не пройден онбординг через команду /cs-design-system.
Исходный текст
SKILL.md · MIT
---
name: md-document
description: Converts long-form markdown (specs, RFCs, reports, plans, explainers) into a single-file, lightly-interactive HTML document with sticky TOC, scrollspy, search filter, code-copy buttons, and design-system-driven brand tokens. Triggers when the markdown-html-orchestrator classifies an input as DOCUMENT, or when invoked directly via /cs-md-document. Reads the design-system config via config_loader.py and inlines the user's 12 derived CSS custom properties; refuses to render if onboarding hasn't run. Single-file output — Google Fonts + Prism.js CDN are the only externals; no framework runtime, no build step. Use after orchestrator routing or after design-system onboarding is confirmed.
license: MIT
metadata:
version: 2.10.1
author: Alireza Rezvani
tags: [markdown, html, documentation, single-file, toc, scrollspy, search, code-copy, design-system]
compatible_tools: [claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli]
---
# md-document — Long-form Markdown to HTML
The general-purpose converter — handles the 90% case Shihipar describes (specs, plans, RFCs, reports, explainers). Three stdlib tools pipeline together:
```
markdown_parser.py → html_renderer.py → interactivity_injector.py
(md → JSON AST) (AST + tokens → HTML) (HTML + JS behavior)
```
Output is one `.html` file with sticky TOC, search filter, scrollspy, code-copy buttons, and the user's 12 derived brand tokens. Externals limited to Google Fonts CSS + Prism.js CDN.
## When to invoke
| Symptom | Action |
|---|---|
| `markdown-html-orchestrator` routes input as DOCUMENT | Invoke this skill |
| User runs `/cs-md-document <path>.md` directly | Invoke this skill |
| User says "convert this spec/report/RFC/plan to HTML" | Invoke this skill |
| Input is a code review (has ` ```diff ` blocks) | Route to `md-review` instead |
| Input is a slide deck (clear `---` boundaries) | Route to `md-slides` instead |
| Input is < 100 lines | Refuse (Shihipar threshold — markdown still wins) |
| Design-system not onboarded | Refuse, surface `/cs-design-system` |
## Pipeline
```bash
# 1. Parse markdown → JSON AST
python3 markdown-html/skills/md-document/scripts/markdown_parser.py \
--input <path>.md --output sections.json
# 2. Render AST + design-system config → single-file HTML
python3 markdown-html/skills/md-document/scripts/html_renderer.py \
--sections sections.json --output document.html
# 3. Inject lightweight JS (search, copycode, smoothscroll, scrollspy)
python3 markdown-html/skills/md-document/scripts/interactivity_injector.py \
--file document.html \
--features search,copycode,smoothscroll,scrollspy
```
Or all-in-one (sample render):
```bash
python3 markdown-html/skills/md-document/scripts/html_renderer.py --sample \
| python3 markdown-html/skills/md-document/scripts/interactivity_injector.py \
--file /dev/stdin --output document.html
```
## What gets rendered
CommonMark subset sufficient for agent-generated artifacts:
- Headings H1-H6 (every H2+ gets an anchor id and TOC entry)
- Paragraphs with inline **bold** / *italic* / `code` / [links](url) / 
- Fenced code blocks (` ```python `) with Prism.js highlighting on demand
- GFM tables with per-column alignment
- GFM callouts (`> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`)
- Blockquotes, ordered + unordered lists (single-level), horizontal rules
Out of scope: nested lists, HTML inlines, footnotes, definition lists, task list checkboxes (rendered as plain text), reference-style links.
## Hard rules
1. **Refuses input < 100 lines.** Markdown wins below the threshold (Shihipar).
2. **Refuses without onboarding.** `config_loader.setup_completed()` must return `True`. Otherwise surface `/cs-design-system`.
3. **Single-file output.** All CSS + JS inline. Only externals are `fonts.googleapis.com` and `cdn.jsdelivr.net` (Prism). Anything else is a regression.
4. **Customization must change behavior.** `design_style=editorial` produces 720px-wide layout with 1.75 line-height; `playful` rounds the callouts and adds shadow; `technical` is dense with 0.875rem code. Smoke-tested.
5. **WCAG-compliant tokens.** Inherits the design-system's WCAG AA palette — body text ≥ 4.5:1 contrast, links iteratively walked to 4.5:1.
6. **Idempotent injection.** Re-injecting interactivity is a no-op (marker check). Re-rendering with a different design_style works cleanly.
## Forcing-question library (Matt Pocock grill discipline)
1. **What's the document for — skim, decide, or deep-read?** Recommended: name it; density follows. Canon: Shihipar; Tufte *Envisioning Information*.
2. **Sticky-sidebar TOC or collapsible-top?** Recommended: sticky-sidebar for > 800 words / 4+ H2s; collapsible-top for shorter mobile-first docs. Canon: NN/g *TOC Best Practices* (2023).
3. **All four interactive features, or a subset?** Recommended: all four — none of them cost more than ~1 KB. Canon: Wattenberger *Why React isn't great for actually building websites*.
4. **Code theme — light, dark, or auto?** Recommended: auto (follows OS `prefers-color-scheme`). Canon: WCAG 2.2 §1.4.3.
5. **Does the document have a clear H1 title?** Recommended: yes — H1 becomes the page `<title>` and is excluded from the TOC.
## Distinct from
- **`md-review`** — that converter renders diff blocks + severity-tagged margin annotations. This one renders prose + tables + code + callouts.
- **`md-slides`** — that converter splits on `---` boundaries into slides. This one renders one continuous document.
- **`marketing/landing/`** — that generates landing pages from scratch (no markdown input). This converts existing markdown.
## Output artifact
`{default_output_dir}/doc-{slug}.html` (path resolved by orchestrator's `output_path_resolver.py`; collision suffix `-2`, `-3`, … by default).
## References
- Shihipar — *Claude Code HTML output* (Medium, 2026)
- Tufte — *Envisioning Information* (1990), ch. 2 "Micro/Macro Readings"
- NN/g — *Table of Contents Best Practices* (2023)
- WCAG 2.2 — §1.4.3 contrast, §2.4.5 multiple ways
- Wattenberger — *Why React isn't great for actually building websites*
- See `references/` for full citations
© Alireza Rezvani · MIT · alirezarezvani/claude-skills