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

document-gen-unicode-safe

하는 일

이 스킬은 텍스트에 특수 문자가 있거나 일반 도구가 실패할 때 여러 형식의 문서를 만드는 과정을 안내합니다. 기호나 악센트 때문에 내보내기가 깨지는 사람에게 맞습니다.

사용하는 경우

  • ✓문서에 긴 대시(—), 곡선 따옴표, 화살표 또는 악센트 문자가 있어 PDF가 깨질 때.
  • ✓일반 문서 도구가 알아보기 어려운 오류를 반환하는 경우.
  • ✓같은 문서를 Word, PDF, HTML로 한 번에 만들어야 할 때.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/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-c5d426/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 내보내기가 계속 실패합니다. 잘 작동하는 Word, PDF, HTML 버전을 만들어 주시겠어요?”

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

작동 방식

AI는 간단한 방식과 신중한 수동 방식 중 무엇이 맞는지 정하고, PDF 도구가 표시하지 못하는 문자를 바꾼 뒤 각 형식으로 변환하고 파일을 확인합니다.

기술 내용 (원본 SKILL.md)

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

Document Generation Fallback Workflow (Unicode-Safe)

When to Use

First, assess whether to delegate to shell_agent or use manual workflow:

✅ Use shell_agent Directly When:

  • Document is straightforward (no special Unicode characters, symbols, or non-ASCII text)
  • Single format output needed (e.g., just .docx)
  • Content is primarily ASCII text with standard punctuation
  • No complex formatting requirements (tables, equations, custom templates)
  • You want quick iteration and shell_agent has succeeded on similar tasks before

⚠️ Use Manual Workflow When:

  • shell_agent returns unknown or unclear errors
  • Document contains special characters, symbols, or non-ASCII text (see Unicode table below)
  • Generating multiple formats simultaneously (e.g., .docx, .pdf, .html)
  • PDF generation fails due to LaTeX encoding issues
  • You need fine-grained control over each conversion step
  • Previous shell_agent attempts failed on similar content

📋 Decision Checklist

1. Does the document contain: em-dashes (—), curly quotes (" "), arrows (→), 
   checkmarks (✓), or other special symbols? → Use Manual Workflow

2. Is non-ASCII text present (é, ñ, ü, 中文,العربية)? → Use Manual Workflow with sanitization

3. Did shell_agent already fail on this or similar content? → Use Manual Workflow

4. Need multiple output formats with guaranteed success? → Use Manual Workflow

5. Simple ASCII document, single format, first attempt? → Try shell_agent First

Core Technique

Quick Path (for straightforward documents): Delegate directly to shell_agent with clear instructions:

shell_agent
task: Create a Word document from markdown content. Write the markdown to 
      /tmp/document.md, then convert to .docx using pandoc, and verify the output exists.

Manual Path (for complex/Unicode-heavy documents): Split the workflow into discrete, observable steps:

  1. Content creation → Use write_file to create source document (Markdown)
  2. Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
  3. Format conversion → Use run_shell with pandoc for each target format
  4. Verification → Check output files exist and are valid

Why This Adaptive Approach?

Scenario Recommended Approach Rationale
Simple ASCII doc, single format shell_agent Faster, less manual overhead
Unicode symbols present Manual workflow Prevents LaTeX encoding failures
Previous shell_agent failure Manual workflow Avoids repeat failures
Multiple formats needed Manual workflow Granular control per format
Time-sensitive, low-risk shell_agent first Try fast path, fallback if needed
  1. Content creation → Use write_file to create source document (Markdown)
  2. Unicode sanitization → Preprocess markdown to replace problematic characters before PDF conversion
  3. Format conversion → Use run_shell with pandoc for each target format
  4. Verification → Check output files exist and are valid

⚠️ Unicode & LaTeX Compatibility Warning

Critical: PDF generation via pandoc typically uses LaTeX (pdflatex or xelatex), which has limited Unicode support. Common problematic characters include:

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 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: Sanitize Unicode Characters (Pre-PDF Conversion)

Before PDF conversion, create a sanitized version of your markdown with LaTeX-safe

자주 묻는 질문

수동 방식은 언제 써야 하나요?

특수 문자가 있거나 일반 도구가 실패하거나 여러 형식이 필요할 때 쓰라고 가이드가 안내합니다.

어떤 문자가 바뀌나요?

긴 대시, 짧은 대시, 곡선 따옴표 같은 문자를 더 단순한 문자로 바꾸는 항목을 가이드가 담고 있습니다.

특별한 도구가 필요한가요?

파일 변환에 pandoc을 쓰므로 컴퓨터에 pandoc이 있어야 합니다.

상세 정보

작성자의 원본 설명

Unicode-safe fallback workflow for multi-format document generation with character sanitization

repo: HKUDS/AgentPilot

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬