Skills

Document Gen Resilient Workflow

Multi-engine document generation with cascading PDF fallbacks and robust Unicode handling

Install

npx skills add HKUDS/AgentPilot --skill document-gen-resilient-workflow -g -a claude-code -y
Repository
HKUDS/AgentPilot7.8k
Category
Documents
Updated
3d ago
License
MIT
Context cost
Mediumabout 2,925 tokens
Runs scripts
No, instructions only

What it does

Multi-engine document generation with cascading PDF fallbacks and robust Unicode handling

Resilient Document Generation Workflow (Multi-Engine Fallback)

When to Use

Use this skill when document generation tasks fail or when shell_agent returns unknown errors, especially for:

  • Generating documents in multiple formats (.docx, .pdf, .html)
  • PDF generation fails due to missing LaTeX, encoding issues, or tool errors
  • Documents contain special characters, symbols, or non-ASCII text
  • You need maximum reliability with automatic fallback options

Core Technique

Split document generation into discrete, observable steps with cascading fallbacks for PDF generation:

  1. Content creation → Use write_file to create source Markdown
  2. Unicode sanitization → Use Python script for reliable character replacement
  3. Format conversion → Try multiple PDF engines in sequence until one succeeds
  4. Verification → Check file exists, has non-zero size, and is valid

⚠️ Unicode & PDF Engine Guide

Different PDF engines have different Unicode support:

EngineUnicode SupportBest ForFallback Position
pdflatexLimited (ASCII-focused)Simple documents1st (fastest)
xelatexFull UnicodeDocuments with non-ASCII2nd
wkhtmltopdfGood UnicodeWeb-style documents3rd
reportlab (Python)Full controlProgrammatic PDFs4th
fpdf2 (Python)Full controlSimple text PDFs5th (last resort)

Character Replacement Table

Read the whole SKILL.md on GitHub

More in Documents