fallback-doc-with-delegation
하는 일
이 스킬은 데이터 도구가 실패한 뒤 AI 에이전트가 문서를 만들도록 안내합니다. 서식이 갖춰진 PDF나 일반 텍스트, 마크다운 파일 중 무엇이든 완성된 문서가 필요한 사람을 위한 스킬입니다.
사용하는 경우
- ✓PDF 읽기나 웹 검색이 실패했지만 문서는 반드시 만들어야 할 때.
- ✓서식이 있는 PDF 같은 복잡한 형식의 문서가 필요할 때.
- ✓문서가 단순한 텍스트나 마크다운이어서 직접 쓸 수 있을 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“PDF 읽기와 웹 검색이 모두 실패했습니다. 그래도 요약 문서를 만들어 주세요. 가능하면 서식이 있는 PDF로 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 복잡도에 따라 방법을 고릅니다. 서식이 있는 문서는 셸 에이전트에게 분명한 작업을 주고, 단순한 텍스트나 마크다운은 파일 쓰기 도구로 직접 씁니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
에이전트는 언제 셸 에이전트를 쓰나요?
PDF나 기타 서식이 있는 문서를 만들 때 쓰라고 스킬은 안내합니다.
어떤 경우에 일반 파일로 충분한가요?
단순한 텍스트나 마크다운은 파일 쓰기 도구로 직접 쓸 수 있다고 스킬은 설명합니다.
실패한 데이터가 여전히 필요한가요?
스킬은 실패한 가져오기에 머물지 말고, 문서를 만드는 쪽으로 방향을 바꾸라고 안내합니다.
상세 정보
작성자의 원본 설명
Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text/markdown
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #13032
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.