doc-gen-unicode-diagnostic
Fungsinya
Skill ini memberi AI metode langkah demi langkah untuk pembuatan dokumen yang menghindari galat yang tidak jelas. Skill ini cocok untuk orang yang membuat dokumen dengan karakter khusus, atau menghadapi kegagalan ekspor yang berulang.
Kapan dipakai
- ✓Saat pembuatan PDF gagal dengan galat encoding atau LaTeX.
- ✓Saat pembuatan dokumen mengembalikan galat yang tidak jelas tanpa rincian.
- ✓Saat dokumen memuat karakter atau simbol khusus yang perlu ditangani dengan hati-hati.
Link skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-3d3a9a/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Ekspor PDF saya terus gagal dengan galat LaTeX, dan teksnya memuat simbol. Tolong temukan penyebabnya dan buat PDF-nya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI pertama-tama memeriksa alat dokumen mana yang terpasang, lalu membersihkan karakter khusus, mencoba serangkaian mesin PDF, dan menangkap pesan galat agar bisa mendiagnosis kegagalan apa pun.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Document Generation with Diagnostic Workflow (Unicode-Safe)
When to Use
Use this skill when document generation tasks fail or return unclear errors, especially when:
- Generating documents in multiple formats (
.docx,.pdf,.html) - PDF generation fails with encoding/LaTeX errors
shell_agentreturns "unknown error" without diagnostics- Documents contain special characters, symbols, or non-ASCII text
- You need systematic error diagnosis rather than blind retries
⚠️ Critical: Why This Skill Exists
Recent executions show 43% effectiveness because agents:
- Skip unicode sanitization before PDF conversion
- Don't try
xelatexengine (better Unicode support) - Don't capture stderr for proper diagnosis
- Exhaust iterations on repeated failures without systematic troubleshooting
This skill fixes those gaps with mandatory steps.
Pre-Flight Validation (NEW - Required Step 0)
Before starting document generation, verify your toolchain:
run_shell
command: which pandoc && pandoc --version | head -3
run_shell
command: which pdflatex xelatex wkhtmltopdf 2>/dev/null || echo "Some engines missing"
run_shell
command: python3 -c "import sys; print(sys.version)"
If pandoc is missing, install it:
run_shell
command: apt-get update && apt-get install -y pandoc
For PDF support, install LaTeX engines:
run_shell
command: apt-get install -y texlive-latex-recommended texlive-fonts-recommended texlive-xetex
Core Technique
Manually split the workflow into observable, diagnostic steps:
- Pre-flight → Verify toolchain availability
- Content creation → Use
write_filefor markdown source (visible content) - Unicode sanitization → MANDATORY for PDF: Create sanitized version
- Format conversion with fallback → Try engines in order, capture stderr
- Verification → Check outputs exist and validate content
Unicode & LaTeX Compatibility (MANDATORY for PDF)
PDF generation via LaTeX has limited Unicode support. Before PDF conversion, you MUST sanitize:
| Character | Issue | Safe Replacement |
|---|---|---|
— (em dash) |
LaTeX incompatibility | -- |
– (en dash) |
LaTeX incompatibility | - |
" " (curly quotes) |
Encoding errors | " " (straight) |
' ' (curly apostrophe) |
Encoding errors | ' (straight) |
… (ellipsis) |
May not render | ... |
→ ← ↑ ↓ (arrows) |
LaTeX incompatibility | -> <- ^ v |
✓ ✗ (checkmarks) |
May not render | [x] [ ] |
★ ● (symbols) |
May not render | * - |
© ® ™ |
Require packages | (c) (r) (tm) |
| Non-ASCII (é, ñ, ü) | Font-dependent | Keep for xelatex, sanitize for pdflatex |
DOCX and HTML handle Unicode natively - use original markdown for these formats.
Step-by-Step Workflow
Step 0: Pre-Flight Validation
run_shell
command: which pandoc || (apt-get update && apt-get install -y pandoc)
run_shell
command: which xelatex || echo "xelatex not available - will use fallback"
Step 1: Create Source Content with write_file
write_file
path: /tmp/document_source.md
content: |
# Document Title
## Section 1
Your content here with full Unicode support...
## Section 2
Special chars: "quotes" — dashes … ellipsis ✓ checkmarks
Step 2: Create Sanitized Version for PDF (MANDATORY)
Option A: Manual sanitization with write_file
write_file
path: /tmp/document_source_sanitized.md
content: |
# Document Title
## Section 1
Your content here...
## Section 2
Special chars: "quotes" -- dashes ... ellipsis [x] checkmarks
Option B: Automated sanitization script
First create the script:
write_file
path: /tmp/sanitize_for_pdf.sh
content: |
#!/bin/bash
INPUT="$1"
OUTPUT="${2:-${1%.md}_sanitized.md}"
sed -e 's/—/--/g' -e 's/–/-/g' \
-e 's/"([^"]*)"/"\1"/g' -e "s/'([^']*)'/\`\1\`/g" \
-e 's/…/.../g' -e 's/→/->/g' -e 's/←/<-/g' \
-e 's/✓/[x]/g' -e 's/✗/[ ]/g' \
-e 's/©/(c)/g' -e 's/®/(r)/g' -e 's/™/(tm)/g' \
"$INPUT" > "$OUTPUT"
echo "Sanitized: $INPUT -> $OUTPUT"
run_shell
command: chmod +x /tmp/sanitize_for_pdf.sh && /tmp/sanitize_for_pdf.sh /tmp/document_source.md /tmp/document_source_sanitized.md
Step 3: Convert to DOCX (from original, supports Unicode)
run_shell
command: pandoc /tmp/document_source.md -o output.docx 2>&1
Capture stderr with 2>&1 t
Pertanyaan umum
Alat apa yang harus dipasang?
Panduan ini menyebut pandoc, serta mesin LaTeX seperti pdflatex atau xelatex untuk keluaran PDF.
Mengapa pesan galat ditangkap?
Membaca keluaran galat memungkinkan AI menemukan penyebab sebenarnya, alih-alih mencoba ulang secara membabi buta.
Mesin mana yang paling baik menangani Unicode?
Panduan ini menyatakan bahwa xelatex mendukung teks non-ASCII lebih baik daripada pdflatex.
Detail
Deskripsi asli dari pembuat
Systematic document generation with unicode sanitization, engine fallback chain, and explicit error diagnosis
repo: HKUDS/AgentPilot
Popularitas
- Bintang GitHub
- 7.8k
- Peringkat
- #12857
- Lisensi
- MIT
- Diperbarui
- 1/11/2026
Komentar
- …
Skill lain dari repositori ini
agentpilot
7.8kMembantu agent Anda meningkatkan proyek langkah demi langkah dengan menyiapkan tugas dan menjalankan loop AgentPilot yang mengusulkan, menguji, dan memberi skor pada perubahan.
openspace
7.8kMembantu agent Anda menyiapkan OpenSpace, alat yang menyimpan dan mengambil skill agent, lalu menghubungkannya ke aplikasi AI Anda melalui MCP.
rsi-arena
7.8kMembantu agent Anda menyiapkan dan menjalankan tes benchmark AI standar, seperti AIME dan Terminal-Bench, untuk membandingkan berbagai metode perbaikan.
experiment-guide
7.8kMembantu agent Anda merencanakan eksperimen kecil, membaca hasilnya, dan mencatat temuan saat menyelidiki cara memperbaiki sebuah program.
Skill serupa
feishu-doc
394kMembantu agent Anda membaca, membuat, dan mengedit dokumen cloud Feishu, termasuk teks, gambar, dan tabel, dengan memakai alat dokumen.
feishu-drive
394kMemungkinkan agent Anda menelusuri, mengatur, dan memberi komentar pada file di folder cloud Feishu yang sudah dibagikan kepada bot.
feishu-perm
394kMembantu agent Anda memeriksa dan mengubah siapa yang dapat mengakses file Feishu, dengan memilih izin terkecil yang memenuhi permintaan Anda.