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

document-gen-resilient-multiformat

하는 일

이 스킬은 도구를 먼저 확인하면서 하나의 문서 원본을 여러 형식으로 바꾸는 과정을 AI에게 안내합니다. 무엇이 설치되어 있는지 추측하지 않고 한 문서를 여러 파일 형식으로 얻으려는 사람을 위한 것입니다.

사용하는 경우

  • ✓같은 문서를 Word 파일, PDF, 웹 페이지로 만들어야 할 때.
  • ✓내 컴퓨터에 pandoc이나 PDF 엔진이 없을 수 있을 때.
  • ✓텍스트에 형식마다 다르게 작동하는 특수 문자가 있는 경우.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-618c9b/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-enhanced-enhanced-618c9b/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, PDF, HTML로 쓸 수 있게 해 주세요. 도구가 없으면 알려 주세요.”

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

작동 방식

AI는 어떤 도구가 설치되어 있는지 확인하고, 원본 문서를 작성하고, 형식마다 특수 문자를 조정하고, 변환한 뒤 각 출력 파일이 존재하고 유효한지 확인합니다.

기술 내용 (원본 SKILL.md)

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

Resilient Document Generation Workflow (Multi-Format + Unicode-Safe)

When to Use

Use this skill when generating documents in multiple formats (.docx, .pdf, .html) and you need:

  • Reliable execution with pre-flight environment verification
  • Automatic Unicode handling based on target format
  • Fallback options when primary tools (pandoc/LaTeX) are unavailable
  • Clear error isolation through discrete, observable steps

Trigger this workflow when:

  • shell_agent returns unknown/unclear errors on document generation
  • You need multiple output formats from one source
  • Documents contain special characters, symbols, or non-ASCII text
  • Previous PDF generation attempts failed due to encoding or missing dependencies

Pre-Flight Environment Check

Before starting, verify your environment has the required tools:

run_shell
command: which pandoc && pandoc --version | head -1
run_shell
command: which pdflatex || which xelatex || which wkhtmltopdf || echo "No PDF engine found"
run_shell
command: python3 -c "import fpdf; print('fpdf2 available')" 2>/dev/null || echo "fpdf2 not available"
run_shell
command: python3 -c "import reportlab; print('reportlab available')" 2>/dev/null || echo "reportlab not available"

If pandoc is missing: Install via apt-get install pandoc or brew install pandoc

If no PDF engine found: Choose fallback approach:

  • Install LaTeX: apt-get install texlive-latex-recommended texlive-fonts-recommended
  • Or use wkhtmltopdf: apt-get install wkhtmltopdf
  • Or use Python fallback (fpdf2/reportlab) - see Alternative PDF Generation section

Core Technique

Split the workflow into discrete, observable steps with automatic format detection:

  1. Environment check → Verify tools are available
  2. Content creation → Use write_file to create source Markdown
  3. Auto-sanitization → Conditionally sanitize based on target format (PDF needs it, DOCX/HTML don't)
  4. Format conversion → Use appropriate tool for each format with fallback options
  5. Verification → Check output files exist and validate content

⚠️ Unicode & Format Compatibility Matrix

Format Unicode Support Sanitization Needed Recommended Engine
.docx Excellent No pandoc (default)
.html Excellent No pandoc (default)
.pdf Limited (LaTeX) Yes xelatex > pdflatex > wkhtmltopdf > fpdf2
.pptx Good No pandoc (if available) or python-pptx

Critical Unicode Characters for PDF

Character Issue Safe Replacement
— (em dash) May not render -- or -
– (en dash) May not render -
" " (curly quotes) Encoding errors " " (straight quotes)
' ' (curly apostrophe) Encoding errors ' (straight apostrophe)
… (ellipsis) May not render ...
→ ← ↑ ↓ (arrows) LaTeX incompatibility -> <- ^ v
✓ ✗ (checkmarks) May not render [x] [ ]
★ ● (symbols) May not render * -
© ® ™ May require packages (c) (r) (tm)
Non-ASCII letters (é, ñ, ü) Font-dependent Use xeLaTeX or replace

Step-by-Step Workflow

Step 0: Pre-Flight Check

Verify environment before proceeding:

run_shell
command: pandoc --version >/dev/null 2>&1 && echo "PANDOC_OK" || echo "PANDOC_MISSING"

If PANDOC_MISSING: Either install pandoc or use Alternative PDF Generation (Python-based)

Step 1: Create Source Content with write_file

Write your document content as Markdown to a source file:

write_file
path: /tmp/document_source.md
content: |
  # Document Title
  
  ## Section 1
  Content with original unicode characters...
  
  ## Section 2
  More content...

Step 2: Conditional Unicode Sanitization

Only sanitize if generating PDF. Create sanitized version for PDF conversion:

write_file
path: /tmp/document_source_sanitized.md
content: |
  # Document Title
  
  ## Section 1
  Content with unicode replaced (em-dash -> --, curly quotes -> straight, etc.)
  
  ## Section 2
  More content...

Optional: Use sanitization script (see Unicode Sanitization Script section below):

run_shell
command: ./sanitize_for_pdf.sh /tmp/document_source.md /tmp/document_source_sanitized.md

Note: Keep the original unsanitized file for DOCX/HTML conversion (these

자주 묻는 질문

PDF 엔진이 없으면 어떻게 하나요?

fpdf2나 reportlab 같은 Python 대체 방법을 안내서가 제시합니다.

빠진 도구를 설치해 주나요?

안내서는 빠진 경우 시스템 패키지 명령으로 pandoc이나 LaTeX 엔진을 설치하는 방법을 언급합니다.

왜 특수 문자가 문제인가요?

형식마다 유니코드를 다르게 처리하므로, 안내서는 이를 미리 계획하라고 말합니다.

상세 정보

작성자의 원본 설명

Resilient multi-format document generation with environment checks, auto-sanitization, and fallback engines

repo: HKUDS/AgentPilot

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬