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-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.

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

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-resilient

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

Step-by-step: install document-gen-resilient in Claude Code

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

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-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 →

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.

document-gen-resilient Install

Add to stack

Loading.