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.
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-safeRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install document-gen-unicode-safe in Claude Code
git clone --depth 1 https://github.com/HKUDS/AgentPilot /tmp/AgentPilot && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/AgentPilot/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced ~/.gemini/antigravity-cli/skills/document-gen-unicode-safeAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install document-gen-unicode-safe in Antigravity CLI
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
ANo 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 →Creates importable JSON templates for the Obsidian Web Clipper. It is for users who want to clip a site, understand the available variables, or format clipped content.
Harness Creator builds, audits, and improves the instruction and state files that help AI coding agents stay reliable across sessions. It is for developers whose agents forget context, drift out of scope, or claim work is done too early.
Guides an assistant through extracting text from scanned PDFs, photographed pages, and images with OCR. Covers backends, language packs, force-OCR, and performance tuning.
Edits a named local file in place to remove AI-writing patterns, using minimal targeted changes and post-edit verification. Built for users who explicitly ask to clean, rewrite, or humanize that specific file.
Polishes, translates, or tightens existing academic manuscript prose while preserving facts, terminology, and evidence boundaries. Made for researchers revising drafts, including Chinese-to-English translation and LaTeX layout fixes.
Adds PDF form analysis and filling, table extraction, OCR, validation and batch processing to an AI assistant. Aimed at developers who run complex or high-volume PDF workflows.
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.
