Skills

Document Gen Unicode Safe

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

Install

npx skills add HKUDS/AgentPilot --skill document-gen-unicode-safe -g -a claude-code -y
Repository
HKUDS/AgentPilot7.8k
Category
Engineering
Updated
3d ago
License
MIT
Context cost
Mediumabout 2,926 tokens
Runs scripts
No, instructions only

What it does

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

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.
Read the whole SKILL.md on GitHub

More in Engineering