Zum Inhalt springen
Skillpedia
PDF, Word & Folien7.8k · #12861

document-gen-unicode-safe

Was er macht

Dieser Skill führt die KI durch die Erstellung von Dokumenten in mehreren Formaten, wenn der Text Sonderzeichen enthält oder das übliche Werkzeug versagt. Er richtet sich an Menschen, deren Exporte an Symbolen oder Akzenten scheitern.

Wann du ihn nutzt

  • ✓Wenn mein Dokument Gedankenstriche, typografische Anführungszeichen, Pfeile oder akzentuierte Buchstaben enthält, die ein PDF stören.
  • ✓Wenn das übliche Dokumentwerkzeug eine unklare Fehlermeldung zurückgibt.
  • ✓Wenn ich dasselbe Dokument gleichzeitig als Word, PDF und HTML brauche.

Link zum Skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/document-gen-fallback-enhanced-enhanced-c5d426/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Mein Dokument enthält typografische Anführungszeichen und akzentuierte Buchstaben, und der PDF-Export scheitert immer wieder. Kannst du Word-, PDF- und HTML-Versionen erstellen, die funktionieren?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Die KI entscheidet, ob der einfache Weg oder der sorgfältige manuelle Weg passt, ersetzt Zeichen, die PDF-Werkzeuge nicht darstellen können, konvertiert jedes Format und prüft die Dateien.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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

Häufige Fragen

Wann sollte der manuelle Weg genutzt werden?

Die Anleitung sagt, ihn zu nutzen, wenn der Text Sonderzeichen enthält, das übliche Werkzeug scheitert oder mehrere Formate nötig sind.

Welche Zeichen werden ersetzt?

Die Anleitung nennt Gedankenstriche und Halbgeviertstriche sowie typografische Anführungszeichen, die durch einfachere Zeichen ersetzt werden.

Braucht das ein spezielles Werkzeug?

Es nutzt pandoc zur Umwandlung, daher muss pandoc auf dem Computer verfügbar sein.

Details

Originalbeschreibung des Autors

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

repo: HKUDS/AgentPilot

Beliebtheit

GitHub-Sterne
7.8k
Platz im Ranking
#12861
Lizenz
MIT
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills