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

document-gen-fallback

ما الذي تفعله

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

متى تستخدمها

  • ✓عندما تُرجع أداة مساعدة أخطاء غير واضحة على مستند يجب إنشاؤه بعدة صيغ.
  • ✓عندما أحتاج إلى معرفة المكان الدقيق الذي يفشل فيه التحويل.
  • ✓عندما أريد حفظ النص المصدر أولًا بصيغة Markdown ثم تحويله.

رابط المهارة

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

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

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

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

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

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

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

“أحتاج إلى التقرير نفسه بصيغة Word وبصيغة HTML. من فضلك احفظه أولًا بصيغة Markdown وحوّل كل صيغة على حدة.”

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

كيف تعمل

يكتب الذكاء الاصطناعي المحتوى في ملف Markdown، ويشغّل pandoc مرة لكل صيغة مطلوبة، ويتحقق من أن كل ملف ناتج موجود.

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

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

Document Generation Fallback Workflow

When to Use

Use this skill when shell_agent returns unknown or unclear errors on complex document generation tasks, especially when:

  • Generating documents in multiple formats (e.g., .docx, .pdf, .html)
  • The error message doesn't provide clear debugging information
  • You need better visibility into each step of the generation process

Core Technique

Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps:

  1. Content creation → Use write_file to create source document (Markdown)
  2. Format conversion → Use run_shell with pandoc for each target format
  3. Verification → Check output files exist and are valid

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: Convert to Target Formats with run_shell

Use run_shell with explicit pandoc commands for each format. This isolates conversion errors.

run_shell
command: pandoc /tmp/document_source.md -o output.docx
run_shell
command: pandoc /tmp/document_source.md -o output.pdf

Step 3: Verify Outputs

Check that files were created successfully:

run_shell
command: ls -lh output.docx output.pdf

Complete Example

# Generate Negotiation Strategy Document

## Step 1: Write Markdown source
write_file
path: /tmp/negotiation_strategy.md
content: |
  # Negotiation Strategy
  
  ## Executive Summary
  [Content...]
  
  ## Resolution Path
  [Content...]
  
  ## BATNA Analysis
  [Content...]

## Step 2: Convert to DOCX
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.docx

## Step 3: Convert to PDF
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.pdf

## Step 4: Verify
run_shell
command: ls -lh negotiation_strategy.*

Advantages Over shell_agent

Aspect shell_agent Manual Workflow
Error visibility Opaque, may retry silently Each step shows explicit output
Recovery Automatic but may loop Manual intervention at specific step
Debugging Hard to isolate failure point Clear which step failed
Control Agent decides approach You control each conversion

Common pandoc Commands

# Markdown to Word
pandoc input.md -o output.docx

# Markdown to PDF (requires LaTeX or wkhtmltopdf)
pandoc input.md -o output.pdf

# Markdown to HTML
pandoc input.md -o output.html

# With custom template
pandoc input.md --template=template.html -o output.html

# With metadata
pandoc input.md -o output.pdf --metadata title="Document Title"

Troubleshooting

  • PDF generation fails: Ensure LaTeX is installed (texlive package) or use --pdf-engine=wkhtmltopdf
  • DOCX formatting issues: Add --reference-doc=template.docx for custom styles
  • Unicode/encoding errors: Add -f markdown+utf8 to pandoc command
  • Missing pandoc: Install via apt-get install pandoc or brew install pandoc

When to Return to shell_agent

After successfully completing the manual workflow once, you can attempt shell_agent again for similar tasks, now with a known-working fallback if errors recur.

الأسئلة الشائعة

لماذا يُكتب ملف Markdown أولًا؟

لأنه يعطي مصدرًا واحدًا واضحًا تشترك فيه كل صيغ الناتج.

ما الأداة التي تحوّل الملفات؟

يستخدم الدليل pandoc لكل صيغة مطلوبة.

كيف يُتحقق من النجاح؟

يذكر الدليل التأكد من وجود ملفات الناتج وصلاحيتها.

التفاصيل

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

Fallback workflow for multi-format document generation when shell_agent encounters errors

repo: HKUDS/AgentPilot

الشعبية

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

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

0

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

التعليقات

  • …

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

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