Skillpedia
PDF وWord والعروض التقديمية7.8k · #12863

resilient-document-pipeline

ما الذي تفعله

هذه المهارة سير عمل للمستندات في الظروف الصعبة: أدوات متعطلة وصيغ متعددة ورموز خاصة. وهي مناسبة لمن يحتاج إلى مستند جاهز حتى عندما لا تعمل عمليات البحث.

متى تستخدمها

  • ✓عندما تستمر أخطاء قراءة الملفات أو البحث في الويب أثناء إعداد مستند.
  • ✓عندما أحتاج إلى المستند نفسه بصيغ Word وPDF وHTML من مصدر واحد.
  • ✓عندما يحتوي المستند على شرطات طويلة أو علامات اقتباس منحنية أو أسهم أو رموز أخرى.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-merged/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“يستمر البحث في الويب بالفشل أثناء كتابة تقريري. من فضلك اكتبه من معرفتك واعطني نسخة Word ونسخة PDF.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

بعد تكرار فشل الأدوات يكتب الذكاء الاصطناعي المحتوى من معرفته المدمجة، وينظف الرموز الخاصة، ويجرب طرق التحويل واحدة تلو الأخرى، ويتحقق من كل ناتج.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Resilient Document Generation Pipeline

When to Use This Skill

Use this workflow when generating documents in challenging environments where:

  • Tool failures are likely or have occurred: read_file, search_web, read_webpage, or execute_code_sandbox return errors
  • Multiple formats are needed: Generate .docx, .pdf, .html from the same source
  • Unicode/special characters are present: Documents contain em dashes, curly quotes, arrows, symbols, or non-ASCII text
  • Primary conversion methods may fail: LaTeX/pandoc may not be available or misconfigured

This skill combines early failure detection, domain-knowledge content creation, progressive conversion fallbacks, and Unicode safety into a single resilient workflow.

Core Workflow Overview

┌─────────────────────────────────────────────────────────────────┐
│  1. DETECT tool failures (2+ indicators → pivot immediately)   │
└────────────────┬────────────────────────────────────────────────┘
                 │
┌────────────────▼────────────────────────────────────────────────┐
│  2. CREATE content with write_file using embedded domain       │
│     knowledge (professionally structured markdown)              │
└────────────────┬────────────────────────────────────────────────┘
                 │
┌────────────────▼────────────────────────────────────────────────┐
│  3. SANITIZE unicode (create LaTeX-safe version for PDF)       │
└────────────────┬────────────────────────────────────────────────┘
                 │
┌────────────────▼────────────────────────────────────────────────┐
│  4. CONVERT with progressive fallbacks:                        │
│     pandoc → reportlab → fpdf2 → wkhtmltopdf                   │
└────────────────┬────────────────────────────────────────────────┘
                 │
┌────────────────▼────────────────────────────────────────────────┐
│  5. VERIFY outputs exist and are valid                          │
└─────────────────────────────────────────────────────────────────┘

Step-by-Step Workflow

Step 1: Detect Tool Failure Pattern

Before attempting document generation, check for failure indicators:

TOOL_FAILURE_INDICATORS = [
    "read_file returns binary/image data instead of text",
    "search_web returns unknown error or empty results",
    "read_webpage returns unknown error on multiple URLs",
    "execute_code_sandbox fails unexpectedly",
    "pandoc command fails with 'unknown error'",
    "Multiple consecutive tool failures on data retrieval"
]

Decision point: If 2+ indicators are present within the first 2-3 iterations:

  1. Stop attempting to fix the failing tools
  2. Acknowledge the limitation briefly in your output
  3. Commit to generating the document with available knowledge
  4. Proceed to Step 2 immediately

Step 2: Create Content with write_file

Write your document as professionally structured Markdown using embedded domain knowledge:

write_file
path: /tmp/document_source.md
content: |
  # [Document Title]
  
  ## Executive Summary
  [Brief overview of key content - use domain knowledge]
  
  ## Background
  [Context and scope - leverage embedded expertise]
  
  ## Main Content
  [Organized sections with headers, lists, tables]
  
  ## Limitations & Notes
  [Transparent about data source limitations if relevant]
  
  ## Recommendations/Next Steps
  [Actionable guidance based on available information]

Best practices for content:

  • Use general domain knowledge appropriately when external data is unavailable
  • Clearly distinguish between verified facts and general guidance
  • Include actionable frameworks rather than specific unverified data
  • Add placeholder notes where specific data would enhance the document:
> **Note**: Specific [metric/data point] would typically be sourced from 
> [expected source]. The guidance below reflects established best practices.

Step 3: Sanitize Unicode Characters (Pre-PDF Conversion)

Critical: PDF generation via pandoc typically uses LaTeX, which has limited Unicode support. Create a sanitized version:

Option A: Manual write_file (Recommended for control)

write_file
path: /tmp/document_source_sanitized.md
content: |
  [Same content as Step 2, but with these replacements:]

Character replacement table:

Character Issue Safe Replacement
— (em dash) May not render
الأسئلة الشائعة

هل يُتحقق من المحتوى بالمصادر؟

لا، عند استخدام هذا البديل يعتمد المحتوى على المعرفة المدمجة، لذلك على الذكاء الاصطناعي أن يذكر ذلك.

ما الذي يُعدّ فشلًا للأداة؟

يذكر الدليل الأخطاء المتكررة من أدوات قراءة الملفات أو البحث في الويب أو تنفيذ الشيفرة.

ما الصيغ التي يُنتجها؟

يغطي الدليل ملفات .docx و.pdf و.html مُنشأة من المصدر نفسه.

التفاصيل

الوصف الأصلي من المؤلف

Unified document generation with tool failure detection, domain knowledge fallback, progressive conversion, and Unicode safety

repo: HKUDS/AgentPilot

الشعبية

نجوم GitHub
7.8k
الترتيب
#12863
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة