
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:
- Content creation → Use
write_fileto create source Markdown - Unicode sanitization → Use Python script for reliable character replacement
- Format conversion → Try multiple PDF engines in sequence until one succeeds
- Verification → Check file exists, has non-zero size, and is valid
⚠️ Unicode & PDF Engine Guide
Different PDF engines have different Unicode support:
| Engine | Unicode Support | Best For | Fallback Position |
|---|---|---|---|
pdflatex | Limited (ASCII-focused) | Simple documents | 1st (fastest) |
xelatex | Full Unicode | Documents with non-ASCII | 2nd |
wkhtmltopdf | Good Unicode | Web-style documents | 3rd |
reportlab (Python) | Full control | Programmatic PDFs | 4th |
fpdf2 (Python) | Full control | Simple text PDFs | 5th (last resort) |


