Langsung ke konten
Skillpedia
PDF, Word & slide7.8k · #12861

document-gen-unicode-safe

Fungsinya

Skill ini memandu AI membuat dokumen dalam beberapa format ketika teks memiliki karakter khusus atau alat yang biasa gagal. Skill ini cocok untuk orang yang ekspornya rusak karena simbol atau aksen.

Kapan dipakai

  • ✓Saat dokumen saya memuat tanda pisah panjang, tanda kutip melengkung, panah, atau huruf beraksen yang merusak PDF.
  • ✓Saat alat dokumen yang biasa mengembalikan galat yang tidak jelas.
  • ✓Saat saya membutuhkan dokumen yang sama dalam format Word, PDF, dan HTML sekaligus.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Dokumen saya memuat tanda kutip melengkung dan huruf beraksen, dan ekspor PDF terus gagal. Bisakah Anda membuat versi Word, PDF, dan HTML yang bisa berfungsi?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI memutuskan apakah jalur sederhana atau jalur manual yang cermat yang sesuai, mengganti karakter yang tidak bisa ditampilkan oleh alat PDF, mengonversi setiap format, dan memeriksa file-filenya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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_agent has succeeded on similar tasks before

⚠️ Use Manual Workflow When:

  • shell_agent returns 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_agent attempts 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:

  1. Content creation → Use write_file to create source document (Markdown)
  2. Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
  3. Format conversion → Use run_shell with pandoc for each target format
  4. 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
  1. Content creation → Use write_file to create source document (Markdown)
  2. Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
  3. Format conversion → Use run_shell with pandoc for each target format
  4. 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

Pertanyaan umum

Kapan jalur manual sebaiknya dipakai?

Panduan ini menyarankan jalur manual ketika teks memiliki karakter khusus, ketika alat biasa gagal, atau ketika beberapa format dibutuhkan.

Karakter apa saja yang diganti?

Panduan ini mencantumkan item seperti tanda pisah panjang, tanda pisah pendek, dan tanda kutip melengkung, yang diganti dengan karakter yang lebih sederhana.

Apakah ini membutuhkan alat khusus?

Skill ini memakai pandoc untuk mengonversi file, sehingga pandoc harus tersedia di komputer.

Detail

Deskripsi asli dari pembuat

Unicode-safe fallback workflow for multi-format document generation with character sanitization

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#12861
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa