Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

doc-gen-unicode-diagnostic

Skill by HKUDS

Generates DOCX, PDF and HTML documents from markdown using pandoc. It adds Unicode sanitization, an engine fallback chain and stderr capture for clearer error diagnosis.

  • Score 89
  • 8.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install doc-gen-unicode-diagnostic

Built from the published package, never by AI.

git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.claude/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-3d3a9a ~/.claude/skills/doc-gen-unicode-diagnostic

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install doc-gen-unicode-diagnostic in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

Document Generation with Diagnostic Workflow is a skill for creating .docx, .pdf and .html files from markdown source with pandoc. Before PDF conversion, it replaces characters that LaTeX handles poorly, such as em dashes, curly quotes and arrows, using a sanitized copy. DOCX and HTML are created from the original markdown because they handle Unicode natively. For PDF, it tries the xelatex, pdflatex and wkhtmltopdf engines in order and captures stderr so errors can be read.

The workflow starts with a toolchain check and ends with verification of the output files. If all pandoc engines fail, the skill describes Python fallbacks using fpdf2 or reportlab. It is aimed at agents whose document generation fails with unclear errors, or whose documents contain special characters or non-ASCII text.

Written from the project's SKILL.md and checked against it.

What it can do

  • Pre-flight validationChecks that pandoc, LaTeX engines and Python are available before generating documents.
  • Unicode sanitizationReplaces characters that LaTeX handles poorly with plain ASCII equivalents for PDF conversion.
  • Engine fallback chainTries xelatex, then pdflatex, then wkhtmltopdf when converting markdown to PDF.
  • Error captureRedirects stderr to the output so pandoc errors can be diagnosed instead of reported as unknown.
  • DOCX and HTML conversionCreates Word and HTML files from the original markdown, keeping Unicode text intact.
  • Output verificationLists generated files and checks their types and sizes to confirm the PDF exists.
  • Python fallbackDescribes generating a PDF directly with fpdf2 or reportlab when pandoc engines fail.

What you need

  • pandoc
  • LaTeX engines such as xelatex or pdflatex for PDF output
  • wkhtmltopdf for the optional PDF fallback
  • Python 3
  • fpdf2 or reportlab for the Python fallback

Try asking

  • Turn this markdown report into DOCX, PDF and HTML files.
  • Convert my client notes to PDF and tell me if the conversion fails.
  • Make a PDF from this text that contains curly quotes and em dashes.

Good to know

  • LaTeX-based PDF generation has limited Unicode support, so a sanitized copy of the markdown is needed.
  • pdflatex requires sanitized input, while xelatex can keep non-ASCII characters.
  • The install commands use apt-get, so they assume a Debian or Ubuntu style system.

Security check

B
  • Makes downloaded files executableIn openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-3d3a9a/SKILL.md: chmod +x /tmp/sanitize_for_pdf.sh && /tmp/sanitize_for_pdf.sh /tmp/document_source.md /tmp/

Checked automatically: openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-3d3a9a/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • .skill_id60 B
  • SKILL.md10 KB

Alternatives to doc-gen-unicode-diagnostic

All alternatives →

Compare with obsidian-clipper-template-creator, harness-creator or xberg-extracting-with-ocr

doc-gen-unicode-diagnostic: common questions

Why does the skill sanitize markdown before making a PDF?

The source says PDF generation via LaTeX has limited Unicode support, so characters such as em dashes, arrows and checkmarks are replaced before conversion. DOCX and HTML use the original markdown.

Which PDF engine does the skill try first?

It tries xelatex first because the source describes it as having the best Unicode support. If that fails, it tries pdflatex and then wkhtmltopdf.

What happens if every pandoc engine fails?

The source says to diagnose the markdown file and, if needed, use Python libraries such as fpdf2 or reportlab to create the PDF directly.

How do I install doc-gen-unicode-diagnostic?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is doc-gen-unicode-diagnostic free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is doc-gen-unicode-diagnostic safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (makes downloaded files executable). Review the code before you install. How grades work.

What are alternatives to doc-gen-unicode-diagnostic?

Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.

doc-gen-unicode-diagnostic Install

Add to stack

Loading.