Agent skill
office-to-md
Convert Office documents (Word, Excel, PowerPoint, PDF) to Markdown format. ONLY use this skill when the user explicitly requests to CONVERT, TRANSFORM or PARSE a specific office file into Markdown. Do NOT trigger for general questions, documentation reading, or discussions about files.
Install this agent skill to your Project
npx add-skill https://github.com/shuyu-labs/WebCode/tree/main/skills/claude/office-to-md
SKILL.md
Office Document to Markdown Converter
Convert various Office document formats to structured Markdown with text, table, and image extraction.
File Description
enhanced_parser.py- Core document parserdoc_converter.py- DOC to DOCX converter (requires LibreOffice)requirements.txt- Python dependencies
Install Dependencies
pip install -r requirements.txt
Additional Dependencies for DOC Format
.doc format requires LibreOffice:
# Windows: Install LibreOffice from official website
# https://www.libreoffice.org/download/
# Linux
sudo apt install libreoffice
# Mac
brew install --cask libreoffice
Quick Start
Python Code
from enhanced_parser import EnhancedDocumentParser
# Initialize parser
parser = EnhancedDocumentParser(
image_base_url="http://localhost:5000",
image_save_dir="./static/images",
filter_headers_footers=True # Filter headers and footers
)
# Parse document
result = parser.parse_document("document.docx")
if result["success"]:
print(result["markdown"])
print(f"Extracted {result['images_count']} images")
Start API Service
# Start service using app.py from project root
python app.py
# Visit http://localhost:5000/analyzer to upload files
Supported Formats
| Format | Extensions | Notes |
|---|---|---|
| Word | .docx, .doc | .doc requires LibreOffice |
| Excel | .xlsx, .xls | Supports multiple worksheets and date formats |
| PowerPoint | .pptx | Extracts slide text and images |
| Auto-detects tables and images |
Features
Word Documents
- Automatic heading level detection
- Convert tables to Markdown tables
- Extract inline images
- Filter headers and footers
- Preserve list formatting
Excel Workbooks
- Support for multiple worksheets
- Automatic date format detection (prevents display as numbers)
- Convert to Markdown tables
- Extract embedded images
PowerPoint Presentations
- Extract content by slide
- Extract images and text boxes
- Preserve slide order
PDF Documents
- Auto-detect tables (line detection + text position detection)
- Extract page images
- Intelligently identify headings and lists
- Output content in original order
Advanced Options
DOC Conversion
# Test LibreOffice configuration
python doc_converter.py
PDF Table Strategy
parser = EnhancedDocumentParser(
pdf_table_strategy="lines_strict" # Default: strict line detection, fastest
# "lines": Normal line detection
# "text": Based on text position, more accurate but slower
)
Image Processing
parser = EnhancedDocumentParser(
image_base_url="https://your-domain.com", # Image access URL
image_save_dir="./static/images" # Image save directory
)
Return Format
{
"success": true,
"markdown": "# Document Title\n\nContent...",
"images_count": 2,
"images": [
{
"filename": "uuid.png",
"url": "http://localhost:5000/static/images/uuid.png",
"size": 12345
}
],
"file_type": "docx",
"file_info": {
"name": "document.docx",
"size": 45678,
"paragraphs": 50,
"tables": 3
}
}
Common Issues
DOC Conversion Failed
- Ensure LibreOffice is installed
- Run
python doc_converter.pyto test configuration
Dates Display as Numbers
- Excel parsing automatically handles date formats
- Ensure you're using the latest version of enhanced_parser.py
PDF Table Recognition Inaccurate
- Try different pdf_table_strategy parameters
- Use "lines_strict" for standard tables
- Use "text" for complex tables
File Limitations
- Maximum file size: 160MB
- Supported extensions: docx, doc, pdf, xlsx, xls, pptx
- Automatic cleanup of temporary files
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
canvas-design
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Didn't find tool you were looking for?