
Document Gen Resilient Workflow
Robust document generation with engine fallback chain, error diagnostics, and Python...
Install
npx skills add HKUDS/AgentPilot --skill document-gen-resilient-workflow -g -a claude-code -y- Repository
- HKUDS/AgentPilot7.8k
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- Yes, review before use
What it does
Robust document generation with engine fallback chain, error diagnostics, and Python alternatives
Resilient Document Generation Workflow
When to Use
Use this skill when document generation tasks encounter tool errors or failures, especially:
run_shellcommands return 'unknown error' without diagnostic details- PDF generation fails with LaTeX encoding or missing engine errors
- You need fallback options when primary conversion methods fail
- Workspace or path issues cause file access problems
- Unicode/special characters cause rendering issues in PDF output
shell_agenthas failed multiple times on similar tasks
Core Technique
Split document generation into observable, verifiable steps with explicit error capture and progressive fallback:
- Validate workspace → Confirm current directory and write permissions
- Pre-flight checks → Verify required tools (pandoc, LaTeX engines) are available
- Content creation → Use
write_filefor source Markdown with full visibility - Unicode sanitization → Preprocess for PDF conversion when needed
- Progressive conversion → Try multiple engines/methods until one succeeds
- Explicit error capture → Redirect stderr to diagnose failures
- Verification → Confirm output files exist and are readable
⚠️ Critical: Tool Error Patterns
'unknown error' from run_shell: This typically indicates:
- Sandbox execution context issues (not the command itself)
- Missing stderr capture preventing diagnosis
- Transient file access problems
Solution: Use explicit error capture with 2>&1 and verify tool availability first:
run_shell
command: pandoc --version 2>&1 || echo "PANDOC NOT AVAILABLE"
Pre-Flight Checklist
Before starting conversion, verify your environment:
## Pre-Flight Checks
### Check 1: Verify working directory
run_shell
command: pwd && ls -la
### Check 2: Verify pandoc availability
run_shell
command: pandoc --version 2>&1 | head -3 || echo "PANDOC MISSING"
