document-gen-unicode-safe
O que ela faz
Esta skill guia a IA na criação de documentos em vários formatos quando o texto tem caracteres especiais ou a ferramenta usual falha. Ela é para quem tem exportações que quebram com símbolos ou acentos.
Quando usar
- ✓Quando meu documento tem travessões, aspas curvas, setas ou letras acentuadas que quebram um PDF.
- ✓Quando a ferramenta usual de documentos retorna um erro pouco claro.
- ✓Quando preciso do mesmo documento em Word, PDF e HTML ao mesmo tempo.
Link da skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Meu documento tem aspas curvas e letras acentuadas, e a exportação para PDF continua falhando. Você pode criar versões em Word, PDF e HTML que funcionem?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A IA decide se o caminho simples ou o caminho manual cuidadoso é o mais adequado, substitui os caracteres que as ferramentas de PDF não conseguem exibir, converte cada formato e verifica os arquivos.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Quando usar o caminho manual?
O guia manda usá-lo quando o texto tem caracteres especiais, quando a ferramenta usual falha ou quando vários formatos são necessários.
Quais caracteres são substituídos?
O guia lista itens como travessões, meio-travessões e aspas curvas, que são trocados por caracteres mais simples.
Isso exige uma ferramenta especial?
Ele usa o pandoc para converter os arquivos, então o pandoc precisa estar disponível no computador.
Detalhes
Descrição original do autor
Unicode-safe fallback workflow for multi-format document generation with character sanitization
repo: HKUDS/AgentPilot
Popularidade
- Estrelas no GitHub
- 7,8 mil
- Posição no ranking
- #12861
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
agentpilot
7,8 milAjuda seu agente a melhorar um projeto passo a passo, preparando uma tarefa e executando o ciclo do AgentPilot, que propõe, testa e pontua mudanças.
openspace
7,8 milAjuda seu agente a configurar o OpenSpace, uma ferramenta que armazena e busca skills de agentes, e a conectá-la ao seu app de IA pelo MCP.
rsi-arena
7,8 milAjuda seu agente a configurar e rodar testes padrão de benchmark de IA, como AIME e Terminal-Bench, para comparar diferentes métodos de melhoria.
experiment-guide
7,8 milAjuda seu agente a planejar pequenos experimentos, ler seus resultados e registrar descobertas enquanto investiga como melhorar um programa.
Skills parecidas
feishu-doc
394 milAjuda seu agente a ler, criar e editar documentos na nuvem do Feishu, incluindo textos, imagens e tabelas, usando a ferramenta de documentos.
feishu-drive
394 milPermite que seu agente navegue, organize e comente arquivos de uma pasta na nuvem do Feishu que foi compartilhada com o bot.
feishu-perm
394 milAjuda seu agente a verificar e alterar quem pode acessar um arquivo do Feishu, escolhendo a menor permissão que atende ao seu pedido.