Langsung ke konten
Skillpedia
Menulis7.8k Β· #13032

fallback-doc-with-delegation

Fungsinya

Skill ini memandu agent AI untuk membuat dokumen setelah alat datanya gagal. Skill ini ditujukan untuk orang yang memerlukan dokumen jadi, baik berupa PDF berformat maupun file teks atau markdown biasa.

Kapan dipakai

  • βœ“Saat pembacaan PDF atau pencarian web gagal dan dokumen tetap harus dibuat.
  • βœ“Saat dokumen berupa format kompleks seperti PDF berformat.
  • βœ“Saat dokumen berupa teks atau markdown sederhana dan dapat langsung ditulis.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œPembaca PDF dan pencarian web saya sama-sama gagal. Buat dokumen ringkasan tetap, sebagai PDF berformat jika bisa.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memilih metode berdasarkan tingkat kompleksitas. Untuk dokumen berformat, agent memberikan tugas yang jelas kepada agent shell. Untuk teks atau markdown sederhana, agent langsung menulis file dengan alat tulis file.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Fallback Document Generation with Delegation

When to Use This Skill

Use this workflow when attempting to generate a document or report, but multiple primary data source tools fail simultaneously:

  • read_file returns binary/image data instead of text (common with PDFs)
  • search_web returns errors or no results
  • execute_code_sandbox fails unexpectedly
  • Other data retrieval tools are unavailable

Key insight: Rather than getting stuck on failed data retrieval, pivot immediately to generating the document using the most appropriate available methodβ€”either shell_agent for complex formats or write_file for simple text.

Step-by-Step Instructions

Step 1: Detect Tool Failure Pattern

Recognize when you're in a fallback scenario:

TOOL_FAILURE_INDICATORS = [
    "read_file returns binary or image data",
    "search_web returns unknown error or empty results",
    "execute_code_sandbox fails repeatedly",
    "Multiple consecutive tool failures on data retrieval"
]

Decision point: If 2+ indicators are present, proceed to Step 2.

Step 2: Choose the Appropriate Fallback Method

Critical Decision: Select between shell_agent and write_file based on document complexity:

Use shell_agent when... Use write_file when...
Generating PDFs or formatted documents Creating simple markdown/text files
Complex layout or styling needed Plain structured content is sufficient
External libraries required (reportlab, pandoc) No special formatting libraries needed
Multi-step generation process Single-pass content generation
Verification/validation needed Direct file creation is adequate

Decision Tree:

Is the output a PDF or complex formatted document?
β”œβ”€β”€ YES β†’ Use shell_agent (delegates to skilled agent)
└── NO β†’ Is it markdown or plain text?
    β”œβ”€β”€ YES β†’ Use write_file (direct content generation)
    └── NO β†’ Use shell_agent (handles uncertainty)

Step 3A: Execute with shell_agent (Complex Documents)

For PDFs and complex formatting:

# Delegate to shell_agent with clear task description
shell_agent(
    task="Generate a professional [document type] about [topic]. "
         "Use appropriate libraries (e.g., reportlab for PDFs). "
         "Include: [list key sections/requirements]. "
         "Save to working directory as [filename]."
)

Advantages of shell_agent:

  • Agent autonomously handles library selection and usage
  • Automatically retries and fixes errors
  • Can use multiple tools internally (run_shell, execute_code_sandbox)
  • Validates output before completion

Example:

shell_agent(
    task="Create a 1-page SBAR (Situation-Background-Assessment-Recommendation) "
         "template PDF with 4 sections. Each section should have guiding points "
         "and blank lined spaces for user input. Use reportlab library. "
         "Save as SBAR_template.pdf in current directory."
)

Step 3B: Execute with write_file (Simple Documents)

For markdown and plain text:

# Generate content with embedded domain knowledge
report_content = f"""# [Document Title]

## Executive Summary
[Brief overview of key findings/content]

## Background
[Context and scope - use embedded knowledge]

## Main Content
[Organized sections with headers, lists, tables as appropriate]

## Limitations & Notes
[Transparent about data source limitations if relevant]

## Recommendations/Next Steps
[Actionable guidance based on available information]
"""

write_file(path="output/report.md", content=report_content)

Step 4: Structure Content Professionally

Regardless of method, ensure professional organization:

# [Document Title]

## Executive Summary
[Brief overview of key findings/content]

## Background
[Context and scope - use embedded knowledge]

## Main Content
[Organized sections with headers, lists, tables as appropriate]

## Limitations & Notes
[Transparent about data source limitations if relevant]

## Recommendations/Next Steps
[Actionable guidance based on available information]

Step 5: Leverage Embedded Domain Knowledge

When external data is unavailable:

  • Use general domain knowledge appropriately
  • 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

Examp

Pertanyaan umum

Kapan agent memakai agent shell?

Skill ini menyarankan penggunaannya untuk PDF dan dokumen berformat lainnya.

Kapan file biasa sudah cukup?

Skill ini menyatakan teks atau markdown sederhana dapat langsung ditulis dengan alat tulis file.

Apakah tetap memerlukan data yang gagal?

Skill ini meminta agent beralih ke pembuatan dokumen dan tidak terus terhenti pada pengambilan yang gagal.

Detail

Deskripsi asli dari pembuat

Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text/markdown

repo: HKUDS/AgentPilot

Popularitas

Bintang GitHub
7.8k
Peringkat
#13032
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa