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

document-gen-unicode-safe

Skill by HKUDS

Provides a Unicode-safe fallback workflow for generating DOCX, PDF and HTML documents with pandoc. It sanitizes special characters, captures stderr, and verifies outputs. Intended for users whose shell_agent document tasks fail with unclear errors.

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

Install document-gen-unicode-safe

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 ~/.claude/skills/document-gen-unicode-safe

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

Step-by-step: install document-gen-unicode-safe in Claude Code

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

About

This skill is a fallback workflow for generating documents in DOCX, PDF and HTML when shell_agent returns unclear errors. It splits the job into separate steps: write a Markdown source file, sanitize special characters for PDF, convert with pandoc, and check the output files. Each run_shell command captures stderr so failures can be read before retrying.

The PDF step tries the xelatex engine first and falls back to wkhtmltopdf. A reference table maps characters such as em dashes, curly quotes, arrows and checkmarks to LaTeX-safe replacements. It is aimed at users who generate documents with pandoc in a shell environment and need clearer debugging than an opaque agent retry loop gives. The source also notes that simple documents may not need this workflow.

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

What it can do

  • Source file creationWrites the document content as Markdown to a temporary file using write_file.
  • Unicode sanitizationReplaces characters such as em dashes, arrows and checkmarks with LaTeX-safe text before PDF conversion.
  • DOCX and HTML conversionConverts the original Markdown to Word and HTML formats with explicit pandoc commands.
  • PDF conversion with fallbackTries the xelatex engine first and retries with wkhtmltopdf if the first attempt fails.
  • Stderr captureAppends 2>&1 to conversion commands so the full error output can be examined before retrying.
  • Output verificationLists the generated files with ls to confirm they were created.
  • Sanitization scriptProvides an optional reusable shell script, sanitize_for_pdf.sh, for repeated sanitization runs.

What you need

  • pandoc
  • xelatex or wkhtmltopdf for PDF output
  • Shell access through run_shell
  • A UTF-8 encoded Markdown source file

Try asking

  • Create a Word, PDF and HTML version of my project report from this Markdown.
  • Generate a PDF from this text, replacing curly quotes and em dashes first.
  • Convert my strategy notes to DOCX and HTML and check the files were created.

Good to know

  • PDF output via LaTeX has limited Unicode support, so sanitization is needed for some characters.
  • PDF conversion needs xelatex or wkhtmltopdf installed.
  • For heavy Unicode content, the source suggests using the manual workflow after confirming the toolchain is available.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

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

Inside the skill

  • .skill_id44 B
  • SKILL.md10 KB

Alternatives to document-gen-unicode-safe

All alternatives →

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

document-gen-unicode-safe: common questions

Why does PDF generation fail with special characters?

The source says LaTeX-based PDF generation has limited Unicode support, so characters like em dashes, arrows and checkmarks may not render. The workflow replaces them before conversion.

Which PDF engine does this workflow use?

It tries xelatex first because of its better Unicode support. If that attempt fails, it retries with wkhtmltopdf.

When should I skip this workflow?

The source says shell_agent is often sufficient for simple documents without complex Unicode content.

How do I install document-gen-unicode-safe?

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

Is document-gen-unicode-safe free?

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

Is document-gen-unicode-safe safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to document-gen-unicode-safe?

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

document-gen-unicode-safe Install

Add to stack

Loading.