doc-gen-unicode-diagnostic
यह क्या करती है
यह स्किल AI को दस्तावेज़ बनाने की चरण-दर-चरण विधि देती है, जिससे अस्पष्ट एरर से बचा जा सके। यह उन लोगों के लिए है जो विशेष अक्षरों वाले दस्तावेज़ बनाते हैं या बार-बार एक्सपोर्ट विफल होने से परेशान हैं।
कब इस्तेमाल करें
- ✓जब एन्कोडिंग या LaTeX एरर की वजह से PDF बनाना विफल हो।
- ✓जब दस्तावेज़ बनाने में कोई अस्पष्ट एरर आए और उसका कोई विवरण न हो।
- ✓जब दस्तावेज़ में ऐसे चिह्न या अक्षर हों जिन्हें ध्यान से संभालना ज़रूरी है।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-3d3a9a/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा PDF एक्सपोर्ट बार-बार LaTeX एरर के साथ विफल हो रहा है, और टेक्स्ट में चिह्न हैं। कृपया कारण खोजकर PDF बनाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI पहले देखता है कि कौन से दस्तावेज़ टूल इंस्टॉल हैं, फिर विशेष चिह्न साफ़ करता है, PDF इंजनों का क्रम आज़माता है, और किसी भी विफलता का निदान करने के लिए एरर संदेश पकड़ता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
कौन से टूल इंस्टॉल होने चाहिए?
गाइड pandoc और PDF के लिए pdflatex या xelatex जैसे LaTeX इंजनों का ज़िक्र करती है।
एरर संदेश क्यों पकड़ें?
एरर आउटपुट पढ़ने से AI असली कारण ढूँढ सकता है, बिना अंधाधुंध दोबारा कोशिश किए।
Unicode के लिए सबसे अच्छा इंजन कौन सा है?
गाइड के अनुसार xelatex, pdflatex की तुलना में गैर-ASCII टेक्स्ट को बेहतर सपोर्ट करता है।
जानकारी
लेखक का मूल विवरण
Systematic document generation with unicode sanitization, engine fallback chain, and explicit error diagnosis
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12857
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
feishu-doc
394kयह आपके एजेंट को document टूल से Feishu क्लाउड दस्तावेज़ पढ़ने, बनाने और बदलने में मदद करती है, जिसमें टेक्स्ट, इमेज और टेबल शामिल हैं।
feishu-drive
394kयह आपके एजेंट को बॉट के साथ साझा किए गए Feishu क्लाउड फ़ोल्डर में फ़ाइलें देखने, व्यवस्थित करने और उन पर टिप्पणी करने देती है।
feishu-perm
394kयह आपके एजेंट को Feishu फ़ाइल तक किसकी पहुंच है, यह जांचने और बदलने देती है, और आपके अनुरोध के लिए सबसे छोटी अनुमति चुनती है।