मुख्य सामग्री पर जाएँ
Skillpedia
PDF, Word और स्लाइड7.8k · #12861

document-gen-unicode-safe

यह क्या करती है

यह स्किल AI को कई फ़ॉर्मैट में दस्तावेज़ बनाने का मार्गदर्शन देती है, जब टेक्स्ट में विशेष अक्षर हों या सामान्य टूल विफल हो। यह उन लोगों के लिए है जिनके एक्सपोर्ट चिह्नों या उच्चारण वाले अक्षरों पर टूट जाते हैं।

कब इस्तेमाल करें

  • ✓जब मेरे दस्तावेज़ में em dash, घुमावदार कोट्स, तीर या उच्चारण चिह्न वाले अक्षर हों, जो PDF को तोड़ते हैं।
  • ✓जब सामान्य दस्तावेज़ टूल अस्पष्ट एरर लौटाए।
  • ✓जब मुझे एक ही दस्तावेज़ Word, PDF और HTML में एक साथ चाहिए।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे दस्तावेज़ में घुमावदार कोट्स और उच्चारण वाले अक्षर हैं, और PDF एक्सपोर्ट बार-बार विफल हो रहा है। क्या आप काम करने वाले Word, PDF और HTML संस्करण बना सकते हैं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

AI तय करता है कि सरल रास्ता या सावधानी वाला मैन्युअल रास्ता ठीक रहेगा, PDF टूल जो नहीं दिखा सकते उन चिह्नों को बदलता है, हर फ़ॉर्मैट में रूपांतरण करता है और फ़ाइलें जाँचता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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

अक्सर पूछे जाने वाले सवाल

मैन्युअल रास्ता कब इस्तेमाल करें?

गाइड के अनुसार जब टेक्स्ट में विशेष अक्षर हों, सामान्य टूल विफल हो, या कई फ़ॉर्मैट चाहिए हों।

कौन से चिह्न बदले जाते हैं?

गाइड em dash, en dash और घुमावदार कोट्स जैसे चिह्नों की सूची देती है, जिन्हें सरल चिह्नों से बदला जाता है।

क्या इसके लिए कोई खास टूल चाहिए?

फ़ाइलें बदलने के लिए यह pandoc इस्तेमाल करता है, इसलिए pandoc कंप्यूटर पर उपलब्ध होना चाहिए।

जानकारी

लेखक का मूल विवरण

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

repo: HKUDS/AgentPilot

लोकप्रियता

GitHub स्टार
7.8k
रैंकिंग में स्थान
#12861
लाइसेंस
MIT
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills