name: office-document-assistant description: Read, extract, summarize, and compare office documents including PDF, Word, Excel, and PowerPoint. Use when a user provides .pdf/.doc/.docx/.xls/.xlsx/.ppt/.pptx files and asks for summaries, key point extraction, page-by-page outlines, field extraction, table explanation, or multi-document comparison. Prefer the bundled extraction script for deterministic text extraction; for PDFs, fall back to OCR when embedded text is missing.
Read, extract, summarize, and compare common office documents:
- PDF
- Word (.docx, .doc)
- Excel (.xlsx, .xls)
- PowerPoint (.pptx, .ppt)
Use this skill when the user wants the contents of a document explained, summarized, searched, or extracted into a simpler structure.
Use this skill when the user:
- uploads a .pdf / .doc / .docx / .xls / .xlsx / .ppt / .pptx
- asks to summarize a document
- asks to extract dates, amounts, contacts, conclusions, specifications, risks, or action items
- asks for page-by-page / slide-by-slide structure
- asks what a spreadsheet or slide deck is saying
- asks to compare two or more documents after extracting their text
Do not position this skill as a high-fidelity layout or visual analysis system.
It is not ideal for: - precise preservation of original layout, formatting, or pagination - detailed chart / diagram / image interpretation - password-protected or encrypted files - OCR-heavy image understanding beyond basic text recovery - advanced spreadsheet analytics or formula auditing - tracked-changes / redline reconstruction in Office documents
python3 {skill_dir}/scripts/extract_office_text.py <file> --jsontypeextractionwarningtruncatedtextpypdf.chi_sim+eng, then chi_sim, then eng.pdftoppm and tesseract..docx: extract paragraphs and tables directly..doc: try antiword, then catdoc, then LibreOffice conversion to .docx.Document clearly what is required versus optional.
python3pypdf — embedded text extraction from PDFspython-docx — .docx extractionopenpyxl — .xlsx extractionpython-pptx — .pptx extractionpoppler-utils — provides pdftoppm for PDF → image conversion before OCRtesseract-ocr — OCR enginetesseract-ocr-chi-sim — Simplified Chinese OCR language packlibreoffice — conversion fallback for legacy .doc, .xls, .pptantiword — direct .doc extraction fallbackcatdoc — additional .doc extraction fallbackpypdf: try text-layer extraction from PDFs firstpdftoppm: rasterize PDF pages when OCR is neededtesseract: recover text from scanned/image PDFspython-docx: read paragraphs and tables from .docxopenpyxl: read sheets and rows from .xlsxpython-pptx: read slide text and notes from .pptxlibreoffice: convert older Office formats into newer parseable formatsantiword / catdoc: lightweight extraction options for .docIf only modern documents matter, the minimum practical setup is:
- python3
- Python packages: pypdf, python-docx, openpyxl, python-pptx
For the most robust behavior across real-world files, install:
- python3
- Python packages: pypdf, python-docx, openpyxl, python-pptx
- system tools: poppler-utils, tesseract-ocr, tesseract-ocr-chi-sim, libreoffice, antiword, catdoc
訪問小蔥技能站7w4.net,解鎖更多實用的AI技能外掛。
Use the bundled checker to quickly see what is missing in the current environment:
python3 {skill_dir}/scripts/check_deps.py
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.pdf" --json
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.docx" --json
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.xlsx" --json
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.pptx" --json
Useful flags:
# limit PDF pages scanned/extracted
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.pdf" --page-limit 10 --json
# limit rows per sheet when probing spreadsheets
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.xlsx" --row-limit 30 --json
# cap output text size
python3 {skill_dir}/scripts/extract_office_text.py "/path/to/file.pdf" --max-chars 30000 --json
Default to a compact answer: - one-sentence summary - 3–8 key points - then expand only if the user asks for: - detailed summary - page-by-page / slide-by-slide notes - field extraction - document comparison
tesseract-ocr-chi-sim is installed..doc / .xls / .ppt extraction fails, check libreoffice, antiword, and catdoc.Read these only when needed:
- references/capabilities.md — capability boundaries and what each format can/can't do well
- references/troubleshooting.md — dependency checks and common failure modes
這個文件處理工具質量不錯,能可靠地提取 PDF、Word、Excel、PPT 等常見格式的文本內容,配套文件和故障排查指南非常實用。優點是使用簡單、相容性好,能自動處理掃描件的中英文識別。不足之處是對於複雜排版、合併表格、圖表解讀等場景效果有限,掃描件質量差時識別準確率也會下降。適合日常辦公文件的閱讀和摘要,不適合高精度的版面還原或資料分析場景。