본문으로 건너뛰기
Skillpedia
글쓰기7.8k · #13032

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/write-file-fallback-report-enhanced/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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_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

자주 묻는 질문

에이전트는 언제 셸 에이전트를 쓰나요?

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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬