본문으로 건너뛰기
Skillpedia
PDF, Word, 슬라이드7.8k · #12865

document-gen-fallback

하는 일

이 스킬은 문서 생성을 원본 파일과 별도의 변환 단계로 나눕니다. 문서 작업이 실패할 때 각 단계가 무엇을 하는지 보고 싶은 사람에게 맞습니다.

사용하는 경우

  • ✓여러 형식으로 만들어야 하는 문서에서 도우미가 불분명한 오류를 낼 때.
  • ✓변환이 정확히 어디서 잘못되는지 알고 싶을 때.
  • ✓원본 텍스트를 먼저 Markdown으로 저장한 뒤 변환하고 싶은 경우.

스킬 링크

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

AI에게 요청하는 예시

“같은 보고서를 Word 파일과 HTML 파일로 받고 싶습니다. 먼저 Markdown으로 저장하고, 형식마다 따로 변환해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 내용을 Markdown 파일에 쓰고, 대상 형식마다 pandoc을 한 번씩 실행한 뒤, 각 결과 파일이 있는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Document Generation Fallback Workflow

When to Use

Use this skill when shell_agent returns unknown or unclear errors on complex document generation tasks, especially when:

  • Generating documents in multiple formats (e.g., .docx, .pdf, .html)
  • The error message doesn't provide clear debugging information
  • You need better visibility into each step of the generation process

Core Technique

Instead of delegating the entire document generation to shell_agent, manually split the workflow into discrete, observable steps:

  1. Content creation → Use write_file to create source document (Markdown)
  2. Format conversion → Use run_shell with pandoc for each target format
  3. Verification → Check output files exist and are valid

Step-by-Step Workflow

Step 1: Create Source Content with write_file

Write your document content as Markdown to a temporary source file. This gives you full visibility into the content being generated.

write_file
path: /tmp/document_source.md
content: |
  # Document Title
  
  ## Section 1
  Content here...
  
  ## Section 2
  More content...

Step 2: Convert to Target Formats with run_shell

Use run_shell with explicit pandoc commands for each format. This isolates conversion errors.

run_shell
command: pandoc /tmp/document_source.md -o output.docx
run_shell
command: pandoc /tmp/document_source.md -o output.pdf

Step 3: Verify Outputs

Check that files were created successfully:

run_shell
command: ls -lh output.docx output.pdf

Complete Example

# Generate Negotiation Strategy Document

## Step 1: Write Markdown source
write_file
path: /tmp/negotiation_strategy.md
content: |
  # Negotiation Strategy
  
  ## Executive Summary
  [Content...]
  
  ## Resolution Path
  [Content...]
  
  ## BATNA Analysis
  [Content...]

## Step 2: Convert to DOCX
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.docx

## Step 3: Convert to PDF
run_shell
command: pandoc /tmp/negotiation_strategy.md -o negotiation_strategy.pdf

## Step 4: Verify
run_shell
command: ls -lh negotiation_strategy.*

Advantages Over shell_agent

Aspect shell_agent Manual Workflow
Error visibility Opaque, may retry silently Each step shows explicit output
Recovery Automatic but may loop Manual intervention at specific step
Debugging Hard to isolate failure point Clear which step failed
Control Agent decides approach You control each conversion

Common pandoc Commands

# Markdown to Word
pandoc input.md -o output.docx

# Markdown to PDF (requires LaTeX or wkhtmltopdf)
pandoc input.md -o output.pdf

# Markdown to HTML
pandoc input.md -o output.html

# With custom template
pandoc input.md --template=template.html -o output.html

# With metadata
pandoc input.md -o output.pdf --metadata title="Document Title"

Troubleshooting

  • PDF generation fails: Ensure LaTeX is installed (texlive package) or use --pdf-engine=wkhtmltopdf
  • DOCX formatting issues: Add --reference-doc=template.docx for custom styles
  • Unicode/encoding errors: Add -f markdown+utf8 to pandoc command
  • Missing pandoc: Install via apt-get install pandoc or brew install pandoc

When to Return to shell_agent

After successfully completing the manual workflow once, you can attempt shell_agent again for similar tasks, now with a known-working fallback if errors recur.

자주 묻는 질문

Markdown 파일을 먼저 쓰는 이유는 무엇인가요?

모든 출력 형식이 함께 쓰는 하나의 명확한 원본이 되기 때문입니다.

파일을 변환하는 도구는 무엇인가요?

가이드는 대상 형식마다 pandoc을 사용합니다.

성공은 어떻게 확인하나요?

가이드는 결과 파일이 있고 올바른지 확인하라고 안내합니다.

상세 정보

작성자의 원본 설명

Fallback workflow for multi-format document generation when shell_agent encounters errors

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#12865
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬