document-gen-unicode-safe
Qué hace
Esta skill guía a la IA para crear documentos en varios formatos cuando el texto tiene caracteres especiales o la herramienta habitual falla. Está pensada para quienes sus exportaciones se rompen con símbolos o tildes.
Cuándo usarla
- ✓Cuando mi documento tiene guiones largos, comillas tipográficas, flechas o letras acentuadas que rompen un PDF.
- ✓Cuando la herramienta de documentos habitual devuelve un error poco claro.
- ✓Cuando necesito el mismo documento en Word, PDF y HTML a la vez.
Link de la skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Mi documento tiene comillas tipográficas y letras acentuadas, y la exportación a PDF sigue fallando. ¿Puedes crear versiones en Word, PDF y HTML que funcionen?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La IA decide si conviene la vía sencilla o la vía manual y cuidadosa, reemplaza los caracteres que las herramientas PDF no pueden mostrar, convierte cada formato y revisa los archivos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Document Generation Fallback Workflow (Unicode-Safe)
When to Use
First, assess whether to delegate to shell_agent or use manual workflow:
✅ Use shell_agent Directly When:
- Document is straightforward (no special Unicode characters, symbols, or non-ASCII text)
- Single format output needed (e.g., just
.docx) - Content is primarily ASCII text with standard punctuation
- No complex formatting requirements (tables, equations, custom templates)
- You want quick iteration and
shell_agenthas succeeded on similar tasks before
⚠️ Use Manual Workflow When:
shell_agentreturns unknown or unclear errors- Document contains special characters, symbols, or non-ASCII text (see Unicode table below)
- Generating multiple formats simultaneously (e.g.,
.docx,.pdf,.html) - PDF generation fails due to LaTeX encoding issues
- You need fine-grained control over each conversion step
- Previous
shell_agentattempts failed on similar content
📋 Decision Checklist
1. Does the document contain: em-dashes (—), curly quotes (" "), arrows (→),
checkmarks (✓), or other special symbols? → Use Manual Workflow
2. Is non-ASCII text present (é, ñ, ü, 中文,العربية)? → Use Manual Workflow with sanitization
3. Did shell_agent already fail on this or similar content? → Use Manual Workflow
4. Need multiple output formats with guaranteed success? → Use Manual Workflow
5. Simple ASCII document, single format, first attempt? → Try shell_agent First
Core Technique
Quick Path (for straightforward documents): Delegate directly to shell_agent with clear instructions:
shell_agent
task: Create a Word document from markdown content. Write the markdown to
/tmp/document.md, then convert to .docx using pandoc, and verify the output exists.
Manual Path (for complex/Unicode-heavy documents): Split the workflow into discrete, observable steps:
- Content creation → Use
write_fileto create source document (Markdown) - Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
- Format conversion → Use
run_shellwithpandocfor each target format - Verification → Check output files exist and are valid
Why This Adaptive Approach?
| Scenario | Recommended Approach | Rationale |
|---|---|---|
| Simple ASCII doc, single format | shell_agent | Faster, less manual overhead |
| Unicode symbols present | Manual workflow | Prevents LaTeX encoding failures |
| Previous shell_agent failure | Manual workflow | Avoids repeat failures |
| Multiple formats needed | Manual workflow | Granular control per format |
| Time-sensitive, low-risk | shell_agent first | Try fast path, fallback if needed |
- Content creation → Use
write_fileto create source document (Markdown) - Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
- Format conversion → Use
run_shellwithpandocfor each target format - Verification → Check output files exist and are valid
⚠️ Unicode & LaTeX Compatibility Warning
Critical: PDF generation via pandoc typically uses LaTeX (pdflatex or xelatex), which has limited Unicode support. Common problematic characters include:
| Character | Issue | Safe Replacement |
|---|---|---|
— (em dash) |
May not render | -- or - |
– (en dash) |
May not render | - |
" " (curly quotes) |
Encoding errors | " " (straight quotes) |
' ' (curly apostrophe) |
Encoding errors | ' (straight apostrophe) |
… (ellipsis) |
May not render | ... |
→ ← ↑ ↓ (arrows) |
LaTeX incompatibility | -> <- ^ v |
✓ ✗ (checkmarks) |
May not render | [x] [ ] |
★ ● (symbols) |
May not render | * - |
© ® ™ |
May require packages | (c) (r) (tm) |
| Non-ASCII letters (é, ñ, ü) | Font-dependent | Use xeLaTeX or replace |
Step-by-Step Workflow
Step 1: Create Source Content with write_file
Write your document content as Markdown to a temporary source file. This gives you full visibility into the content being generated.
write_file
path: /tmp/document_source.md
content: |
# Document Title
## Section 1
Content here...
## Section 2
More content...
Step 2: Sanitize Unicode Characters (Pre-PDF Conversion)
Before PDF conversion, create a sanitized version of your markdown with LaTeX-safe
Preguntas frecuentes
¿Cuándo conviene la vía manual?
La guía indica usarla cuando el texto tiene caracteres especiales, cuando falla la herramienta habitual o cuando hacen falta varios formatos.
¿Qué caracteres se reemplazan?
La guía enumera elementos como los guiones largos, los guiones medios y las comillas tipográficas, que se cambian por caracteres más sencillos.
¿Necesita una herramienta especial?
Usa pandoc para convertir los archivos, así que pandoc debe estar disponible en el equipo.
Detalles
Descripción original del autor
Unicode-safe fallback workflow for multi-format document generation with character sanitization
repo: HKUDS/AgentPilot
Popularidad
- Estrellas en GitHub
- 7,8 mil
- Posición en el ranking
- #12861
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
agentpilot
7,8 milAyuda a tu agente a mejorar un proyecto paso a paso, preparando una tarea y ejecutando el bucle de AgentPilot que propone, prueba y puntúa cambios.
openspace
7,8 milAyuda a tu agente a configurar OpenSpace, una herramienta que guarda y recupera skills de agentes, y a conectarla a tu app de IA mediante MCP.
rsi-arena
7,8 milAyuda a tu agente a configurar y ejecutar pruebas de referencia de IA conocidas, como AIME y Terminal-Bench, para comparar distintos métodos de mejora.
experiment-guide
7,8 milAyuda a tu agente a planificar experimentos pequeños, leer sus resultados y anotar conclusiones mientras investiga cómo mejorar un programa.
Skills parecidas
feishu-doc
394 milAyuda a tu agente a leer, crear y editar documentos en la nube de Feishu, incluidos texto, imágenes y tablas, usando la herramienta de documentos.
feishu-drive
394 milPermite que tu agente explore, organice y comente archivos de una carpeta de la nube de Feishu que se haya compartido con el bot.
feishu-perm
394 milAyuda a tu agente a revisar y cambiar quién puede acceder a un archivo de Feishu, eligiendo el permiso más pequeño que cumpla tu petición.