Ky Markdown Rebuilder
KyrieCheungYep/ky-markdown-rebuilder
Rebuild visual documents into reliable Markdown by combining text extraction with page or screenshot alignment.
Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS.
$ npx skills add borghei/Claude-Skills --skill md-document -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install borghei/Claude-Skills md-document --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/markdown-html/md-document .claude/skills/md-document && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .claude/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-documentType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add borghei/Claude-Skills --skill md-document -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install borghei/Claude-Skills md-document --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/markdown-html/md-document .agents/skills/md-document && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .agents/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add borghei/Claude-Skills --skill md-document -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install borghei/Claude-Skills md-document --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/markdown-html/md-document .cursor/skills/md-document && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .cursor/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/borghei/Claude-Skills.git --path markdown-html/md-document--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add borghei/Claude-Skills --skill md-document -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install borghei/Claude-Skills md-document --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/markdown-html/md-document .gemini/skills/md-document && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .gemini/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install borghei/Claude-Skills md-documentInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add borghei/Claude-Skills --skill md-document -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/markdown-html/md-document .github/skills/md-document && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .github/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add borghei/Claude-Skills --skill md-document -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install borghei/Claude-Skills md-document --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/markdown-html/md-document .opencode/skills/md-document && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "md-document" agent skill from https://github.com/borghei/Claude-Skills/tree/main/markdown-html/md-document into .opencode/skills/md-document/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "md-document", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
md-documentConvert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS.
Md Document is an agent skill from borghei/Claude-Skills. Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS. Use when publishing a report, whitepaper, or memo.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files, including scripts, reference files and assets (for example `assets/document_outline_template.md`, `assets/sample_document.md` and `assets/sample_print_profile.json`).
It sits in Documents & Office, covering Report writing and Markdown. The repository describes itself as: 385 AI skills, 77 expert agents, and 900 stdlib Python tools for every team: engineering, PM, marketing, C-level, compliance, business ops, research, and a LinkedIn toolkit… The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 4a698e8. It shows what the files ask for, not the result of running them.
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.
Ships 4 files in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
python3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Md Document loads about 3k tokens when it runs, and up to ~8.4k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 1,459 words of instructions outside code blocks.
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.
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); the scripts in this folder are not scanned.
The full file from borghei/Claude-Skills at commit 4a698e8, republished under its MIT licence (© borghei). 1,459 words, ~2,956 tokens.
.claude/skills/md-document/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.Turn an authored markdown file into a single HTML document you can email, host, or print — semantic structure, an automatic table of contents, figures and tables numbered and referenceable by number, footnotes, and a print stylesheet that survives contact with a PDF exporter. One file out, no runtime dependencies, no external assets.
Before converting, confirm these inputs. If any is unknown or vague, ASK — do not assume:
Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
--css to override.[?fig:name] markers where numbers should be.python3 markdown-html/md-document/scripts/crossref_auditor.py \
--input markdown-html/md-document/assets/sample_document.md --format text
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md \
--out build/report.html --toc-depth 2 --format text@page and will clip content.python3 markdown-html/md-document/scripts/print_profile.py \
--input markdown-html/md-document/assets/sample_print_profile.json \
--out build/print.css --format text
cat markdown-html/md-document/assets/document_theme.css build/print.css > build/full.css
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md \
--css build/full.css --out build/report.htmlwarning severity so unlabelled figures block, not just
broken references.python3 markdown-html/md-document/scripts/crossref_auditor.py \
--input markdown-html/md-document/assets/sample_document.md --max-severity warning --format json
python3 markdown-html/md-document/scripts/md_to_html.py \
--input markdown-html/md-document/assets/sample_document.md --out build/report.html --format json| Document length | TOC | --toc-depth |
|---|---|---|
| Under 3 pages | none — omit [TOC] | n/a |
| 3-10 pages | yes | 1 (## only) |
| 10-30 pages | yes | 2 (default) [PROVEN] |
| Over 30 pages | yes | 2, plus per-section navigation |
If the TOC exceeds one screen, reduce the depth. A contents list longer than the first section is a navigation failure, not thoroughness.
| Situation | Write | Not |
|---|---|---|
| Pointing at a figure | [@fig:access] | "the chart below" |
| Pointing at a table | [@tbl:policies] | "see the table above" |
| Pointing at a section | [@sec:context] | "as discussed earlier" |
| A caveat that breaks the sentence | a footnote | a parenthetical |
| Evidence the argument depends on | body text | a footnote |
[PROVEN] Never use positional language in a document that may be paginated. "Below" breaks when the table lands on the next page, breaks silently when a section is reordered, and means nothing to a reader navigating by heading.
| Alt text | Caption | |
|---|---|---|
| Audience | Non-sighted readers | Everyone |
| Length | 15-125 characters | One or two sentences |
| Says | What the image depicts | What to conclude, plus the number |
| Fails as | "chart", "figure 3", "" | "See above" |
The auditor flags placeholder alt text (chart, image, screenshot, empty) at
error severity and alt text under 15 or over 125 characters at warning.
| Decision | Default | Change when |
|---|---|---|
| Page size | A4 [RECOMMENDED] | Audience is exclusively North American → Letter |
| Side margins | 25-30mm | Never below 20mm — the measure exceeds 90 characters |
| Body size | 11pt | 12pt for older audiences or dense reference material |
| Mirrored margins | off | The document will be bound double-sided |
break-inside: avoid | figures, tables, code | Never on an element taller than one page |
At A4 with 20mm margins the text column is ~92 characters — well outside the
55-85 comfort band. Widening the margins is the fix; max-width: none on main
is what causes the problem.
Mistake: Writing positional prose — "the chart below", "as shown above" — instead of a numbered cross-reference.
Why it happens: It reads naturally while drafting, when the author can see the whole document at once and the table genuinely is below.
Instead: Write [@tbl:policies]. Pagination moves content, reordering breaks positional claims silently, and a reader navigating by heading has no "below". The auditor cannot detect a broken "below"; it fails the build on a broken [@tbl:policies].
Mistake: Adding an escape hatch so authors can drop <div class="..."> or an embed into the markdown.
Why it happens: A real formatting need appears that the subset does not cover, and passing HTML through is a one-line change.
Instead: Extend the subset or the stylesheet. The escape-then-render ordering is the entire security model — the moment raw HTML passes through, every document becomes an injection vector, and the converter can no longer be pointed at contributed content. There is deliberately no --allow-html flag.
Mistake: Writing one string and letting it serve as both the figure caption and the alt attribute. Why it happens: The converter falls back to exactly this when no caption is given, which makes it look sanctioned. Instead: Write both. The caption tells a sighted reader what to conclude; the alt text describes what the figure shows to someone who cannot see it. "Figure 3. Costs fall 40% under Policy B" is a fine caption and useless alt text — it states the conclusion without describing the chart.
Mistake: Building the document for screen, then bolting on a print stylesheet when someone asks for a PDF.
Why it happens: Print feels like a rendering detail rather than a design constraint, and the screen version already looks finished.
Instead: Decide print-or-not before converting. Retrofitted print CSS produces the classic failures — stranded headings, tables split mid-row, dark theme reaching paper as invisible gray text, a 92-character measure. print_profile.py exists so the geometry is a reviewed input, not an afterthought.
Mistake: Treating a passing conversion as evidence the document is ready to publish. Why it happens: The gate is automated and green, which reads as authoritative. Instead: The gate checks that references resolve and footnotes are defined. It cannot see a stranded heading, a figure separated from its caption, a table split across pages, or a PDF whose margins clipped the content. Proof every page of the actual output at 100% zoom before publishing.
| File | Purpose |
|---|---|
scripts/md_to_html.py | CLI: convert markdown to a self-contained HTML document; gates on broken references |
scripts/md_render.py | Markdown subset parser, escaping-first inline renderer, label numbering — imported by md_to_html.py, not a CLI |
scripts/crossref_auditor.py | Audit labels, references, alt text, and heading hierarchy; CI gate |
scripts/print_profile.py | Generate a print/PDF stylesheet from a JSON page profile |
references/markdown-conventions.md | Supported syntax, labelling contract, escaping and URL-allowlist model |
references/print-and-pdf-production.md | Paged media, break control, export mechanics, proofing checklist |
assets/sample_document.md | Working document exercising every construct; converts clean |
assets/sample_print_profile.json | A4 double-sided print profile with running heads |
assets/document_theme.css | Bundled theme inlined by default — this skill's own copy |
assets/document_outline_template.md | Starting structure for a new report or memo |
All scripts share one exit-code contract: 0 clean, 2 gate failed (findings at or above the threshold), 1 the tool itself errored. A CI job can therefore tell a real defect from a broken invocation.
Three CLI tools, one module. md_render.py is a library, not a fourth
command — it holds the parser that md_to_html.py imports. A single-file
converter came to 429 lines, well over the 300-line ceiling. Splitting CLI from
parser is the remedy the tool-design standard prescribes for an oversized script,
and same-directory imports keep the package self-contained: md-slides carries
its own separate slide_render.py rather than importing this one.
© borghei, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 10 other files (scripts, references, assets) in markdown-html/md-document of borghei/Claude-Skills.
Open the folder on GitHubat commit 4a698e8
Md Document 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Md Document this skillborghei/Claude-Skills | 881 | — | ~3k | Automated safety check: Pass | MIT | |
| Ky Markdown RebuilderKyrieCheungYep/ky-markdown-rebuilder | 117 | — | ~5.7k | Automated safety check: Pass | None | |
| HTML Summarytestdouble/han | 279 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Bookforge Korean Ebook PDF Makergongnyang/bookforge | 314 | 1 repos | ~1.7k | Automated safety check: Pass | MIT | |
| Markdown to HTML ReportMegaSuperKitty/WeClaw | 370 | — | ~456 | Automated safety check: Pass | MIT | |
| Markdown to Word Convertercat-xierluo/SuitAgent | 206 | — | ~559 | Automated safety check: Pass | MIT |
KyrieCheungYep/ky-markdown-rebuilder
Rebuild visual documents into reliable Markdown by combining text extraction with page or screenshot alignment.
testdouble/han
Convert a stakeholder summary markdown file into a single self-contained HTML executive report — bottom line and decision asks up front, supporting detail later — styled with a Test Double-derived…
gongnyang/bookforge
Produces book-style Korean ebook PDFs from a topic or finished manuscript, with six design styles, real book parts and quality-check gates before output.
MegaSuperKitty/WeClaw
Drafts a report in Markdown with numbered inline citations and a references section, then renders it to a styled HTML file through a Jinja2 template on Windows.
cat-xierluo/SuitAgent
Converts Markdown files into Word documents formatted to Chinese typesetting conventions, with presets for academic, legal, report and book layouts.
garrytan/gstack
Renders a markdown file into a finished PDF with margins, page numbers, a cover page, running headers, a clickable table of contents and an optional DRAFT watermark.
borghei/Claude-Skills
Run delivery when AI coding and ops agents take tickets. An agent skill from borghei/Claude-Skills.
borghei/Claude-Skills
Check AI-generated marketing content and reviews for required disclosures under the EU AI Act, FTC rules and platform AI-label policies.
borghei/Claude-Skills
Idea to AI-generated prototype to customer validation to engineering handoff.
borghei/Claude-Skills
Analytics engineering across data modeling, dbt, transformation, and semantic layers.
borghei/Claude-Skills
Ansoff Matrix — 4-quadrant framework for growth options: market penetration, market/product development, and diversification.
borghei/Claude-Skills
OKR brainstorming and validation using the Radical Focus framework — outcome objectives, measurable key results, counter-metrics.
Categories
Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS. Md Document is an agent skill from borghei/Claude-Skills. Convert authored markdown into a polished self-contained HTML document with a table of contents, numbered figures and tables, cross-references, footnotes, and print-ready CSS.
Md Document fits situations like: publishing a report; tasks that involve Report writing; tasks that involve Markdown.
Run `npx skills add borghei/Claude-Skills --skill md-document -a claude-code`. Or copy the skill folder (markdown-html/md-document in borghei/Claude-Skills) into .claude/skills/md-document in your project. Claude Code loads it when a task matches its description.
Run `npx skills add borghei/Claude-Skills --skill md-document -a codex`. Or copy the skill folder (markdown-html/md-document in borghei/Claude-Skills) into .agents/skills/md-document in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add borghei/Claude-Skills --skill md-document -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/md-document, .gemini/skills/md-document, .github/skills/md-document and .opencode/skills/md-document in your project.
Going by SKILL.md and its folder, Md Document needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.
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.
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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Md Document is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
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. Its references folder adds about 5.4k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Md Document: Ky Markdown Rebuilder (KyrieCheungYep/ky-markdown-rebuilder, 117 stars), HTML Summary (testdouble/han, 279 stars), Bookforge Korean Ebook PDF Maker (gongnyang/bookforge, 314 stars) and Markdown to HTML Report (MegaSuperKitty/WeClaw, 370 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
borghei (a GitHub user) maintains it in borghei/Claude-Skills, which has 881 GitHub stars. The repository holds 349 skills in this directory. The repository was last updated on October 7, 2026.
Source: borghei/Claude-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.