Multi-path document generation with tool checks, Unicode handling, and Python fallbacks
Use this skill when document generation tasks encounter errors or when you need reliable multi-format output:
shell_agent returns unknown or unclear errors on document generation.docx, .pdf, .html)Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps with built-in fallbacks:
write_fileCritical: Different formats handle Unicode differently. Plan accordingly:
| Format | Unicode Support | Sanitization Needed? | Recommended Engine |
|---|---|---|---|
.docx | Excellent | No | pandoc (default) |
.html | Excellent | No | pandoc (default) |
.pdf (pdflatex) | Limited | Yes | pandoc + sanitization |
.pdf (xelatex) | Good | Rarely | pandoc --pdf-engine=xelatex |
.pdf (wkhtmltopdf) | Good | Rarely | pandoc --pdf-engine=wkhtmltopdf |
.pdf (Python) | Excellent | No | fpdf2 or reportlab |
Before starting, verify which tools are available:
run_shell