document-gen-resilient
यह क्या करती है
यह स्किल AI को दस्तावेज़ बनाने को छोटे जाँचे हुए चरणों में बाँटने का निर्देश देती है, रूपांतरण विफल होने पर बैकअप के साथ। यह उन लोगों के लिए है जिनकी दस्तावेज़ बनाने की प्रक्रिया बार-बार विफल होती है या जिन्हें कई फ़ाइल फ़ॉर्मैट चाहिए।
कब इस्तेमाल करें
- ✓जब दस्तावेज़ बनाना विफल हो और शेल सहायक अस्पष्ट एरर लौटाए।
- ✓जब मुझे एक साथ .docx, .pdf और .html फ़ॉर्मैट में दस्तावेज़ चाहिए।
- ✓जब LaTeX एन्कोडिंग समस्या या गायब सॉफ़्टवेयर की वजह से PDF नहीं बन रही।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-96865f/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“दस्तावेज़ बनाना बार-बार विफल हो रहा है। कृपया मेरी रिपोर्ट को Word और PDF फ़ाइल के रूप में बनाइए, जो भी टूल यहाँ काम करें उनसे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI जाँचता है कि कौन से टूल उपलब्ध हैं, सामग्री को Markdown में लिखता है, हर फ़ॉर्मैट के लिए विशेष अक्षरों का तरीका तय करता है, मुख्य विधि और फिर बैकअप आज़माता है, और फ़ाइलों की पुष्टि करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Resilient Document Generation Workflow
When to Use
Use this skill when document generation tasks encounter errors or when you need reliable multi-format output:
shell_agentreturns unknown or unclear errors on document generation- Generating documents in multiple formats (e.g.,
.docx,.pdf,.html) - PDF generation fails due to LaTeX encoding or missing dependencies
- You need to handle special characters, symbols, or non-ASCII text safely
- Previous document generation attempts have failed
Core Technique
Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps with built-in fallbacks:
- Tool availability check → Verify pandoc and PDF engines are available
- Content creation → Use
write_fileto create source document (Markdown) - Unicode assessment → Determine if sanitization is needed based on target format
- Format conversion → Try primary method, fall back to alternatives on failure
- Verification → Check output files exist and are valid
⚠️ Format-Specific Unicode Guidance
Critical: Different formats handle Unicode differently. Plan accordingly:
| Format | Unicode Support | Sanitization Needed? | Recommended Engine |
|---|---|---|---|
.docx |
Excellent | No | pandoc (default) |
.html |
Excellent | No | pandoc (default) |
.pdf (pdflatex) |
Limited | Yes | pandoc + sanitization |
.pdf (xelatex) |
Good | Rarely | pandoc --pdf-engine=xelatex |
.pdf (wkhtmltopdf) |
Good | Rarely | pandoc --pdf-engine=wkhtmltopdf |
.pdf (Python) |
Excellent | No | fpdf2 or reportlab |
Step-by-Step Workflow
Step 0: Check Tool Availability
Before starting, verify which tools are available:
run_shell
command: which pandoc && echo "PANDOC: OK" || echo "PANDOC: MISSING"
run_shell
command: which pdflatex && echo "PDFLATEX: OK" || echo "PDFLATEX: MISSING"
run_shell
command: which xelatex && echo "XELATEX: OK" || echo "XELATEX: MISSING"
run_shell
command: python3 -c "import fpdf; print('FPDF2: OK')" 2>/dev/null || echo "FPDF2: MISSING"
Decision Tree Based on Availability:
- pandoc + xelatex available → Use pandoc with xelatex engine (best Unicode support)
- pandoc + pdflatex only → Use pandoc with sanitization (Step 2)
- pandoc missing, Python available → Use Python libraries (Step 3 Alternative)
- All missing → Install dependencies or use shell_agent with explicit instructions
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: Assess and Handle Unicode (Conditional)
Before PDF conversion, check if your content contains problematic characters:
run_shell
command: grep -P '[\x{2014}\x{2013}\x{201C}\x{201D}\x{2026}]' /tmp/document_source.md && echo "UNICODE_DETECTED" || echo "UNICODE_CLEAN"
If Unicode detected AND using pdflatex, create a sanitized version:
write_file
path: /tmp/document_source_sanitized.md
content: |
# Document Title
## Section 1
Content here... (with all special chars replaced per table below)
Common Problematic Characters:
| 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] [ ] |
© ® ™ |
May require packages | (c) (r) (tm) |
Note: Keep the original unsanitized file for DOCX/HTML conversion (these formats handle Unicode better).
Step 3: Convert to Target Formats with run_shell
Use run_shell with explicit commands for each format. Try primary method first, fall back on failure.
For DOCX (from original, no sanitization needed):
run_shell
command: pandoc /tmp/document_source.md -o output.docx
For PDF (try in order):
**Option A: xelatex (best
अक्सर पूछे जाने वाले सवाल
एक ही सहायक से सब क्यों नहीं?
गाइड कहती है कि काम को देखे जा सकने वाले चरणों में बाँटने से पता चलता है कि विफलता कहाँ हुई।
Word विशेष अक्षरों को कैसे संभालता है?
गाइड कहती है कि .docx Unicode को बहुत अच्छी तरह संभालता है और आमतौर पर सफ़ाई की ज़रूरत नहीं होती।
Python के बैकअप कौन से हैं?
जब मुख्य टूल उपलब्ध न हों, तब गाइड reportlab और fpdf2 जैसी लाइब्रेरी की ओर इशारा करती है।
जानकारी
लेखक का मूल विवरण
Multi-path document generation with tool checks, Unicode handling, and Python fallbacks
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12859
- लाइसेंस
- 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 फ़ाइल तक किसकी पहुंच है, यह जांचने और बदलने देती है, और आपके अनुरोध के लिए सबसे छोटी अनुमति चुनती है।