document-gen-resilient-workflow
Skill by HKUDS
Resilient Document Generation Workflow is an agent skill that guides an assistant through creating DOCX and PDF files when tool errors occur. It is for users whose document tasks fail in run_shell or LaTeX conversion.
Install document-gen-resilient-workflow
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 ~/.claude/skills/document-gen-resilient-workflowRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install document-gen-resilient-workflow 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-enhanced ~/.gemini/antigravity-cli/skills/document-gen-resilient-workflowAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install document-gen-resilient-workflow in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Resilient Document Generation Workflow is an agent skill that guides an assistant through creating DOCX and PDF documents from Markdown. It splits the work into steps with explicit error capture, checks that pandoc and LaTeX engines are available, and tries several PDF engines in order. When a conversion fails, it falls back to Python libraries such as fpdf2 and python-docx.
The skill also covers Unicode sanitization for PDF output, with a replacement table and a reusable shell script. It includes an error diagnosis guide for 'unknown error' results, missing LaTeX engines, encoding problems, and workspace or permission issues. It is aimed at users whose assistant runs document tasks through run_shell and hits these failures.
Written from the project's SKILL.md and checked against it.
What it can do
- Pre-flight checksVerifies the working directory, pandoc, LaTeX engines and Python libraries before conversion.
- Progressive PDF conversionTries pandoc with several PDF engines in order, logging errors to a file at each step.
- Python library fallbackGenerates PDF with fpdf2 and DOCX with python-docx when pandoc methods fail.
- Unicode sanitizationReplaces em dashes, curly quotes, arrows and symbols that break LaTeX PDF output.
- Output verificationChecks that DOCX and PDF files exist and are readable, including page counts.
- Error diagnosis guideLists steps for 'unknown error', missing LaTeX, encoding errors and garbled PDFs.
What you need
- pandoc
- LaTeX engines such as pdflatex or xelatex, or wkhtmltopdf
- Python 3 with fpdf2 and python-docx for the fallback
Try asking
- Create a DOCX and PDF report from this Markdown, using the resilient workflow.
- My pandoc PDF failed with an unknown error. Walk me through the diagnosis steps.
- Sanitize this Markdown for LaTeX PDF output and replace the special characters.
Good to know
- Unicode sanitization is only needed for PDF conversion through LaTeX engines.
- DOCX and HTML are said to handle Unicode natively.
- Relies on run_shell, write_file and execute_code_sandbox tools in the assistant environment.
Security check
B- Makes downloaded files executableIn
openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced/SKILL.md:chmod +x sanitize_for_pdf.sh && ./sanitize_for_pdf.sh /tmp/document_source.md /tmp/
Checked automatically: openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced/SKILL.md, openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced/sanitize_for_pdf.sh. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
.skill_id53 B -
SKILL.md13 KB -
sanitize_for_pdf.sh1 KB
Alternatives to document-gen-resilient-workflow
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-workflow: common questions
When should I use this document generation skill?
The source says to use it when run_shell returns 'unknown error', PDF generation fails with LaTeX or engine errors, or shell_agent has failed several times on similar tasks.
Does it need LaTeX to make PDFs?
The main PDF method uses pandoc with LaTeX engines, but the source also lists wkhtmltopdf and a Python fpdf2 fallback that does not need pandoc.
How does it handle special characters in PDFs?
It provides a table and a sanitization script that replace characters such as em dashes, curly quotes and arrows with LaTeX-safe versions.
How do I install document-gen-resilient-workflow?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is document-gen-resilient-workflow free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is document-gen-resilient-workflow 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 document-gen-resilient-workflow?
Similar skills: obsidian-clipper-template-creator, harness-creator, xberg-extracting-with-ocr, file-edit-in-place.
