fallback-doc-with-delegation
O que ela faz
Esta skill orienta o agente de IA a criar um documento depois que suas ferramentas de dados falham. É para pessoas que precisam de um documento pronto, seja um PDF formatado, seja um arquivo de texto ou markdown simples.
Quando usar
- ✓Quando a leitura de PDF ou a busca na web falha e o documento ainda precisa ser produzido.
- ✓Quando o documento é de um formato complexo, como um PDF formatado.
- ✓Quando o documento é texto simples ou markdown e pode ser escrito diretamente.
Link da skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Meu leitor de PDF e a busca na web falharam. Monte o documento de resumo mesmo assim, em PDF formatado se for possível.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente escolhe o método pela complexidade. Para documentos formatados, entrega uma tarefa clara a um agente de shell e, para texto ou markdown simples, grava o arquivo diretamente com uma ferramenta de gravação.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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_filereturns binary/image data instead of text (common with PDFs)search_webreturns errors or no resultsexecute_code_sandboxfails 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
Perguntas frequentes
Quando o agente usa um agente de shell?
A skill diz para usá-lo para PDFs e outros documentos formatados.
Quando um arquivo simples basta?
A skill diz que texto simples ou markdown pode ser gravado diretamente com uma ferramenta de gravação.
Ele ainda precisa dos dados que falharam?
A skill diz para partir para a produção do documento, em vez de ficar preso à recuperação que falhou.
Detalhes
Descrição original do autor
Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text/markdown
repo: HKUDS/AgentPilot
Popularidade
- Estrelas no GitHub
- 7,8 mil
- Posição no ranking
- #13032
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
agentpilot
7,8 milAjuda seu agente a melhorar um projeto passo a passo, preparando uma tarefa e executando o ciclo do AgentPilot, que propõe, testa e pontua mudanças.
openspace
7,8 milAjuda seu agente a configurar o OpenSpace, uma ferramenta que armazena e busca skills de agentes, e a conectá-la ao seu app de IA pelo MCP.
rsi-arena
7,8 milAjuda seu agente a configurar e rodar testes padrão de benchmark de IA, como AIME e Terminal-Bench, para comparar diferentes métodos de melhoria.
experiment-guide
7,8 milAjuda seu agente a planejar pequenos experimentos, ler seus resultados e registrar descobertas enquanto investiga como melhorar um programa.
Skills parecidas
obsidian-vault-maintainer
394 milAjuda seu agente a manter um vault de memória compatível com o Obsidian organizado, com links funcionando, propriedades consistentes e seções seguras.
wiki-maintainer
394 milAjuda seu agente a manter uma wiki de memória do OpenClaw com páginas repetíveis, blocos gerenciados seguros e verificações de contradições ou lacunas.
obsidian
394 milPermite que seu agente leia, pesquise, crie e edite notas, tarefas, links e propriedades do Obsidian usando a linha de comando oficial do Obsidian.