$npx -y skills add freestylefly/canghe-skills --skill paddleocr-doc-parsingAdvanced document parsing with PaddleOCR. Returns complete document structure including text, tables, formulas, charts, and layout information. The AI agent extracts relevant content based on user needs.
| 1 | # PaddleOCR Document Parsing Skill |
| 2 | |
| 3 | ## When to Use This Skill |
| 4 | |
| 5 | **Use Document Parsing for**: |
| 6 | - Documents with tables (invoices, financial reports, spreadsheets) |
| 7 | - Documents with mathematical formulas (academic papers, scientific documents) |
| 8 | - Documents with charts and diagrams |
| 9 | - Multi-column layouts (newspapers, magazines, brochures) |
| 10 | - Complex document structures requiring layout analysis |
| 11 | - Any document requiring structured understanding |
| 12 | |
| 13 | **Use Text Recognition instead for**: |
| 14 | - Simple text-only extraction |
| 15 | - Quick OCR tasks where speed is critical |
| 16 | - Screenshots or simple images with clear text |
| 17 | |
| 18 | ## How to Use This Skill |
| 19 | |
| 20 | **⛔ MANDATORY RESTRICTIONS - DO NOT VIOLATE ⛔** |
| 21 | |
| 22 | 1. **ONLY use PaddleOCR Document Parsing API** - Execute the script `python scripts/vl_caller.py` |
| 23 | 2. **NEVER parse documents directly** - Do NOT parse documents yourself |
| 24 | 3. **NEVER offer alternatives** - Do NOT suggest "I can try to analyze it" or similar |
| 25 | 4. **IF API fails** - Display the error message and STOP immediately |
| 26 | 5. **NO fallback methods** - Do NOT attempt document parsing any other way |
| 27 | |
| 28 | If the script execution fails (API not configured, network error, etc.): |
| 29 | - Show the error message to the user |
| 30 | - Do NOT offer to help using your vision capabilities |
| 31 | - Do NOT ask "Would you like me to try parsing it?" |
| 32 | - Simply stop and wait for user to fix the configuration |
| 33 | |
| 34 | ### Basic Workflow |
| 35 | |
| 36 | 1. **Execute document parsing**: |
| 37 | ```bash |
| 38 | python scripts/vl_caller.py --file-url "URL provided by user" --pretty |
| 39 | ``` |
| 40 | Or for local files: |
| 41 | ```bash |
| 42 | python scripts/vl_caller.py --file-path "file path" --pretty |
| 43 | ``` |
| 44 | |
| 45 | **Optional: explicitly set file type**: |
| 46 | ```bash |
| 47 | python scripts/vl_caller.py --file-url "URL provided by user" --file-type 0 --pretty |
| 48 | ``` |
| 49 | - `--file-type 0`: PDF |
| 50 | - `--file-type 1`: image |
| 51 | - If omitted, the service can infer file type from input. |
| 52 | |
| 53 | **Default behavior: save raw JSON to a temp file**: |
| 54 | - If `--output` is omitted, the script saves automatically under the system temp directory |
| 55 | - Default path pattern: `<system-temp>/paddleocr/doc-parsing/results/result_<timestamp>_<id>.json` |
| 56 | - If `--output` is provided, it overrides the default temp-file destination |
| 57 | - If `--stdout` is provided, JSON is printed to stdout and no file is saved |
| 58 | - In save mode, the script prints the absolute saved path on stderr: `Result saved to: /absolute/path/...` |
| 59 | - In default/custom save mode, read and parse the saved JSON file before responding |
| 60 | - In save mode, always tell the user the saved file path and that full raw JSON is available there |
| 61 | - Use `--stdout` only when you explicitly want to skip file persistence |
| 62 | |
| 63 | 2. **The output JSON contains COMPLETE content** with all document data: |
| 64 | - Headers, footers, page numbers |
| 65 | - Main text content |
| 66 | - Tables with structure |
| 67 | - Formulas (with LaTeX) |
| 68 | - Figures and charts |
| 69 | - Footnotes and references |
| 70 | - Seals and stamps |
| 71 | - Layout and reading order |
| 72 | |
| 73 | **Input type note**: |
| 74 | - Supported file types depend on the model and endpoint configuration. |
| 75 | - Always follow the file type constraints documented by your endpoint API. |
| 76 | |
| 77 | 3. **Extract what the user needs** from the output JSON using these fields: |
| 78 | - Top-level `text` |
| 79 | - `result[n].markdown` |
| 80 | - `result[n].prunedResult` |
| 81 | |
| 82 | ### IMPORTANT: Complete Content Display |
| 83 | |
| 84 | **CRITICAL**: You must display the COMPLETE extracted content to the user based on their needs. |
| 85 | |
| 86 | - The output JSON contains ALL document content in a structured format |
| 87 | - In save mode, the raw provider result can be inspected in the saved JSON file |
| 88 | - **Display the full content requested by the user**, do NOT truncate or summarize |
| 89 | - If user asks for "all text", show the entire `text` field |
| 90 | - If user asks for "tables", show ALL tables in the document |
| 91 | - If user asks for "main content", filter out headers/footers but show ALL body text |
| 92 | |
| 93 | **What this means**: |
| 94 | - **DO**: Display complete text, all tables, all formulas as requested |
| 95 | - **DO**: Present content using these fields: top-level `text`, `result[n].markdown`, and `result[n].prunedResult` |
| 96 | - **DON'T**: Truncate with "..." unless content is excessively long (>10,000 chars) |
| 97 | - **DON'T**: Summarize or provide excerpts when user asks for full content |
| 98 | - **DON'T**: Say "Here's a preview" when user expects complete output |
| 99 | |
| 100 | **Example - Correct**: |
| 101 | ``` |
| 102 | User: "Extract all the text from this document" |
| 103 | Agent: I've parsed the complete d |