document-gen-resilient
Skill by HKUDS
Generates .docx, .pdf and .html documents from Markdown with pandoc, using tool checks, Unicode sanitization and Python fallbacks. Useful when document generation through shell_agent keeps failing.
Install document-gen-resilient
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-96865f ~/.claude/skills/document-gen-resilientRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
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-enhanced-96865f ~/.gemini/antigravity-cli/skills/document-gen-resilientAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install document-gen-resilient in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant a step-by-step workflow for creating documents when a single shell_agent call fails. The assistant checks which tools are installed, writes the content as Markdown with write_file, and converts it with pandoc. It can produce .docx, .pdf and .html files.
For PDF output, the workflow picks an engine based on what is available, such as xelatex, wkhtmltopdf, or pdflatex with a sanitized copy of the text. Sanitization replaces characters like em dashes, curly quotes and arrows. If pandoc is missing, it falls back to Python libraries such as fpdf2 or reportlab. The skill suits users who need multi-format documents and clear error visibility at each step.
Written from the project's SKILL.md and checked against it.
What it can do
- Tool availability checkChecks whether pandoc, pdflatex, xelatex and the fpdf2 Python package are installed before starting.
- Markdown source creationWrites the document content to a Markdown source file with write_file for full visibility.
- Unicode assessmentScans the source for problem characters and decides whether a sanitized copy is needed.
- DOCX and HTML conversionConverts the original Markdown to Word and HTML with pandoc, which handles Unicode well.
- PDF conversion with fallbacksTries xelatex, then wkhtmltopdf, then pdflatex with sanitization, then a Python fpdf2 method.
- Output verificationLists the created files and checks their type to confirm the outputs are valid.
- Character sanitization scriptProvides an optional shell script that replaces common special characters for LaTeX PDF output.
- Python library fallbackShows fpdf2 and reportlab examples for building a PDF when pandoc is unavailable or failing.
What you need
- pandoc
- A LaTeX engine (xelatex or pdflatex) or wkhtmltopdf for PDF output
- Python 3 with fpdf2 or reportlab for the Python fallback
- shell_agent or run_shell and write_file tools
Try asking
- Create a DOCX and PDF version of my negotiation strategy notes.
- Convert this Markdown report to HTML and check that the file was created.
- My PDF export fails with encoding errors, so generate it using a fallback.
Good to know
- pdflatex needs a sanitized copy of text that contains special characters.
- Keep the unsanitized file for DOCX and HTML conversion.
- The source says DOCX formatting may need a custom reference document.
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-enhanced-96865f/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
.skill_id60 B -
SKILL.md12 KB
Alternatives to document-gen-resilient
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-resilient: common questions
Which output formats does this skill support?
The source covers .docx, .pdf and .html output, with several engine options for PDF.
What should I do if PDF generation fails with encoding errors?
The source suggests using the xelatex engine, wkhtmltopdf, or a sanitized Markdown file when using pdflatex.
Can it generate documents without pandoc?
The source describes Python fpdf2 and reportlab fallbacks for when pandoc is missing or failing.
How do I install document-gen-resilient?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is document-gen-resilient free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is document-gen-resilient 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-resilient?
Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.
