Aller au contenu
Skillpedia
Rédaction7.8k · #13032

fallback-doc-with-delegation

Ce qu’il fait

Cette compétence guide l'agent IA pour créer un document après l'échec de ses outils de données. Elle s'adresse aux personnes qui ont besoin d'un document finalisé, qu'il s'agisse d'un PDF mis en forme ou d'un simple fichier texte ou markdown.

Quand l’utiliser

  • ✓Quand la lecture de PDF ou la recherche web échoue et que le document doit tout de même être produit.
  • ✓Quand le document est dans un format complexe, comme un PDF mis en forme.
  • ✓Quand le document est un texte simple ou du markdown qui peut être rédigé directement.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Ma lecture de PDF et ma recherche web ont toutes deux échoué. Rédige quand même le document de synthèse, sous forme de PDF mis en forme si possible.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent choisit la méthode selon la complexité. Pour les documents mis en forme, il confie une tâche claire à un agent shell ; pour un texte simple ou du markdown, il écrit directement le fichier avec un outil d'écriture.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

Quand l'agent utilise-t-il un agent shell ?

La compétence indique de l'utiliser pour les PDF et autres documents mis en forme.

Quand un fichier simple suffit-il ?

La compétence indique qu'un texte simple ou du markdown peut être écrit directement avec un outil d'écriture de fichier.

A-t-on encore besoin des données échouées ?

La compétence demande de passer à la production du document plutôt que de rester bloqué sur la récupération échouée.

Détails

Description originale de l’auteur

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

repo: HKUDS/AgentPilot

Popularité

Étoiles GitHub
7.8k
Position au classement
#13032
Licence
MIT
Mis à jour
01/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires