/install besteva-file-converter
\r \r
File Converter Skill\r
\r A comprehensive file format conversion toolkit supporting documents, images, and spreadsheets.\r \r
When to Use\r
\r Activate this skill when any of these scenarios occur:\r \r
- Document conversion: User wants to convert between PDF and Word formats\r
- Image conversion: User needs images in a different format (PNG→JPG, JPG→WebP, etc.)\r
- Spreadsheet conversion: User needs to exchange data between Excel and CSV\r
- Batch operations: User has multiple files that need converting at once\r
- Format queries: User asks about supported formats or how to convert specific file types\r \r
Supported Conversions\r
\r
| Source Format | Target Format | Script | Notes |\r
|--------------|---------------|--------|-------|\r
| .pdf | .docx | scripts/pdf_to_word.py | Extracts text, tables, layout |\r
| .docx, .doc | .pdf | scripts/word_to_pdf.py | Requires MS Word on Windows |\r
| PNG/JPEG/WebP/BMP/GIF/TIFF | Any other image format | scripts/image_converter.py | Quality control, resize support |\r
| .csv | .xlsx | scripts/excel_csv_converter.py | Custom delimiter/encoding |\r
| .xlsx, .xls | .csv | scripts/excel_csv_converter.py | Multi-sheet support |\r
\r
Prerequisites\r
\r
Python Dependencies\r
\r Install required packages before first use:\r \r
pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
**Quick install command:**\r
```bash\r
pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
### Platform-Specific Requirements\r
\r
- **Word → PDF (Windows)**: Microsoft Word must be installed (`docx2pdf` uses COM automation)\r
- **PDF → Word**: No external software required; uses `pdf2docx`\r
- **Image conversion**: Uses `Pillow` only, works on all platforms\r
\r
## Workflow Guidelines\r
\r
### Step 1: Identify Conversion Type\r
\r
Determine what the user wants to convert:\r
\r
```\r
User says "convert this PDF" → PDF to Word\r
User says "turn this into PDF" → Word to PDF \r
User says "change this PNG to JPG" → Image conversion\r
User says "export this Excel as CSV" → Excel to CSV\r
```\r
\r
### Step 2: Check Dependencies\r
\r
Before running any script, verify required packages are installed:\r
\r
```bash\r
python -c "import PIL; import pdf2docx; import docx2pdf; import openpyxl"\r
```\r
\r
If imports fail, prompt user to run:\r
```bash\r
pip install Pillow pdf2docx docx2pdf openpyxl xlrd\r
```\r
\r
### Step 3: Execute Appropriate Script\r
\r
#### PDF → Word\r
\r
**Single file:**\r
```bash\r
python scripts/pdf_to_word.py \x3Cinput.pdf> [output.docx]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/pdf_to_word.py --batch ./pdf_folder --output-dir ./output_folder\r
```\r
\r
**Options:**\r
- `--start N`: Start from page N (default: 0)\r
- `--end N`: End at page N (default: all pages)\r
\r
#### Word → PDF\r
\r
**Single file:**\r
```bash\r
python scripts/word_to_pdf.py \x3Cinput.docx> [output.pdf]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/word_to_pdf.py --batch ./docs_folder --output-dir ./pdfs_folder\r
```\r
\r
**Check requirements:**\r
```bash\r
python scripts/word_to_pdf.py --check\r
```\r
\r
#### Image Format Conversion\r
\r
**Single file:**\r
```bash\r
python scripts/image_converter.py \x3Cinput_image> --format \x3Ctarget_format>\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/image_converter.py --batch ./images_dir --format webp --output-dir ./webp_dir\r
```\r
\r
**Target formats:** `png`, `jpg`/`jpeg`, `webp`, `bmp`, `gif`, `tiff`/`tif`\r
\r
**Options:**\r
- `-q/--quality N`: Quality for lossy formats (1-100, default: 95)\r
- `--resize WIDTH HEIGHT`: Resize dimensions\r
- `--no-optimize`: Disable optimization\r
- `--info`: Display image info without converting\r
\r
**Examples:**\r
```bash\r
# High-quality JPEG compression\r
python scripts/image_converter.py photo.png --format jpg -q 90\r
\r
# Convert to WebP with smaller size\r
python scripts/image_converter.py photo.png --format webp -q 80\r
\r
# Resize while converting\r
python scripts/image_converter.py large.png --format jpg --resize 1920 1080\r
\r
# View image info\r
python scripts/image_converter.py image.png --info\r
```\r
\r
#### Excel ↔ CSV\r
\r
**CSV → Excel:**\r
```bash\r
python scripts/excel_csv_converter.py data.csv --format xlsx [options]\r
```\r
\r
**Excel → CSV:**\r
```bash\r
python scripts/excel_csv_converter.py data.xlsx --format csv [options]\r
```\r
\r
**Batch mode:**\r
```bash\r
python scripts/excel_csv_converter.py --batch ./data_dir --format csv\r
```\r
\r
**Options:**\r
- `-d/--delimiter CHAR`: Custom separator (default: comma)\r
- `-e/--encoding ENC`: File encoding (default: utf-8)\r
- `--sheet NAME`: Specific sheet name (Excel→CSV)\r
- `--sheet-name NAME`: Output sheet name (CSV→Excel)\r
- `--no-header`: Skip header row\r
- `--info`: Show Excel structure info\r
\r
**Examples:**\r
```bash\r
# European-style CSV (semicolon delimited) \r
python scripts/excel_csv_converter.py data.csv --format xlsx -d ";"\r
\r
# Chinese encoding support\r
python scripts/excel_csv_converter.py data.xlsx --format csv -e gbk\r
\r
# Export specific sheet\r
python scripts/excel_csv_converter.py workbook.xlsx --format csv -s "Sales Report"\r
\r
# View Excel info\r
python scripts/excel_csv_converter.py data.xlsx --info\r
```\r
\r
### Step 4: Verify Results\r
\r
After each conversion:\r
\r
1. Confirm output file(s) exist at expected location(s)\r
2. Report file sizes to user (original vs converted)\r
3. For batch operations, report success count vs total count\r
4. If errors occurred, summarize them clearly\r
\r
## Error Handling\r
\r
### Common Issues and Solutions\r
\r
| Error | Cause | Solution |\r
|-------|-------|----------|\r
| `ModuleNotFoundError` | Missing package | Run `pip install \x3Cpackage>` |\r
| `COMError` (Word→PDF) | MS Word not installed | Install MS Office or use alternative |\r
| `UnicodeDecodeError` | Wrong encoding | Specify correct `--encoding` |\r
| `FileNotFoundError` | Wrong path | Verify input path is absolute or relative correctly |\r
| Permission denied | Read-only directory | Use writable output directory |\r
\r
### Encoding Guide\r
\r
When dealing with non-UTF-8 files, common encodings:\r
- Chinese Windows: `gbk` / `gb18030`\r
- Western Europe: `latin-1` / `cp1252`\r
- Japanese: `shift-jis` / `cp932`\r
- Auto-detect: Try `utf-8` first, then fallback\r
\r
## Best Practices\r
\r
1. **Always use absolute paths** when calling scripts to avoid path confusion\r
2. **Create output directories** before batch operations if they don't exist\r
3. **Check dependencies once** at start of session, not before every call\r
4. **Report results clearly** with file paths, sizes, and success/failure counts\r
5. **Handle transparency** appropriately — JPEG doesn't support alpha channels\r
6. **Preserve quality** defaults are high (95%) but adjust based on use case\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install besteva-file-converter - After installation, invoke the skill by name or use
/besteva-file-converter - Provide required inputs per the skill's parameter spec and get structured output
What is File Converter?
This skill provides comprehensive file format conversion capabilities. It should be used when users need to convert files between different formats, includin... It is an AI Agent Skill for Claude Code / OpenClaw, with 92 downloads so far.
How do I install File Converter?
Run "/install besteva-file-converter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is File Converter free?
Yes, File Converter is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does File Converter support?
File Converter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created File Converter?
It is built and maintained by Besteva77 (@besteva77); the current version is v1.0.0.