file-converter
This skill handles file format conversions across documents (PDF, DOCX, Markdown, HTML, TXT), data files (JSON, CSV, YAML, XML, TOML), and images (PNG, JPG, WebP, SVG, GIF). Use when the user requests converting, transforming, or exporting files between formats. Generates conversion code dynamically based on the specific request.
Best use case
file-converter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
This skill handles file format conversions across documents (PDF, DOCX, Markdown, HTML, TXT), data files (JSON, CSV, YAML, XML, TOML), and images (PNG, JPG, WebP, SVG, GIF). Use when the user requests converting, transforming, or exporting files between formats. Generates conversion code dynamically based on the specific request.
Teams using file-converter should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/file-converter/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How file-converter Compares
| Feature / Agent | file-converter | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This skill handles file format conversions across documents (PDF, DOCX, Markdown, HTML, TXT), data files (JSON, CSV, YAML, XML, TOML), and images (PNG, JPG, WebP, SVG, GIF). Use when the user requests converting, transforming, or exporting files between formats. Generates conversion code dynamically based on the specific request.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# File Converter
## Overview
Convert files between formats across three categories: documents, data files, and images. Generate Python code dynamically for each conversion request, selecting appropriate libraries and handling edge cases.
## Conversion Categories
### Documents
| From | To | Recommended Library |
|------|-----|---------------------|
| Markdown | HTML | `markdown` or `mistune` |
| HTML | Markdown | `markdownify` or `html2text` |
| HTML | PDF | `weasyprint` or `pdfkit` (requires wkhtmltopdf) |
| PDF | Text | `pypdf` or `pdfplumber` |
| DOCX | Markdown | `mammoth` |
| DOCX | PDF | `docx2pdf` (Windows/macOS) or LibreOffice CLI |
| Markdown | PDF | Convert via HTML first, then to PDF |
### Data Files
| From | To | Recommended Library |
|------|-----|---------------------|
| JSON | YAML | `pyyaml` |
| YAML | JSON | `pyyaml` |
| JSON | CSV | `pandas` or stdlib `csv` + `json` |
| CSV | JSON | `pandas` or stdlib `csv` + `json` |
| JSON | TOML | `tomli`/`tomllib` (read) + `tomli-w` (write) |
| XML | JSON | `xmltodict` |
| JSON | XML | `dicttoxml` or `xmltodict.unparse` |
### Images
| From | To | Recommended Library |
|------|-----|---------------------|
| PNG/JPG/WebP/GIF | Any raster | `Pillow` (PIL) |
| SVG | PNG/JPG | `cairosvg` or `svglib` + `reportlab` |
| PNG | SVG | `potrace` (CLI) for tracing, limited fidelity |
## Workflow
1. Identify source format (from file extension or user statement)
2. Identify target format
3. Check `references/` for format-specific guidance
4. Generate conversion code using recommended library
5. Handle edge cases (encoding, transparency, nested structures)
6. Execute conversion and report results
## Quick Patterns
### Data: JSON to YAML
```python
import json
import yaml
with open("input.json") as f:
data = json.load(f)
with open("output.yaml", "w") as f:
yaml.dump(data, f, default_flow_style=False, allow_unicode=True)
```
### Data: CSV to JSON
```python
import csv
import json
with open("input.csv") as f:
reader = csv.DictReader(f)
data = list(reader)
with open("output.json", "w") as f:
json.dump(data, f, indent=2)
```
### Document: Markdown to HTML
```python
import markdown
with open("input.md") as f:
md_content = f.read()
html = markdown.markdown(md_content, extensions=["tables", "fenced_code"])
with open("output.html", "w") as f:
f.write(html)
```
### Image: PNG to WebP
```python
from PIL import Image
img = Image.open("input.png")
img.save("output.webp", "WEBP", quality=85)
```
### Image: SVG to PNG
```python
import cairosvg
cairosvg.svg2png(url="input.svg", write_to="output.png", scale=2)
```
## Resources
Detailed guidance for complex conversions is in `references/`:
- `references/document-conversions.md` - PDF handling, encoding issues, styling preservation
- `references/data-conversions.md` - Schema handling, type coercion, nested structures
- `references/image-conversions.md` - Quality settings, transparency, color profiles
Consult these references when handling edge cases or when the user has specific quality/fidelity requirements.Related Skills
onnx-converter
Onnx Converter - Auto-activating skill for ML Deployment. Triggers on: onnx converter, onnx converter Part of the ML Deployment skill category.
memory-profiler-setup
Memory Profiler Setup - Auto-activating skill for Performance Testing. Triggers on: memory profiler setup, memory profiler setup Part of the Performance Testing skill category.
makefile-generator
Makefile Generator - Auto-activating skill for DevOps Basics. Triggers on: makefile generator, makefile generator Part of the DevOps Basics skill category.
inference-latency-profiler
Inference Latency Profiler - Auto-activating skill for ML Deployment. Triggers on: inference latency profiler, inference latency profiler Part of the ML Deployment skill category.
generating-docker-compose-files
Execute use when you need to work with Docker Compose. This skill provides Docker Compose file generation with comprehensive guidance and automation. Trigger with phrases like "generate docker-compose", "create compose file", or "configure multi-container app".
file-format-converter
File Format Converter - Auto-activating skill for Data Pipelines. Triggers on: file format converter, file format converter Part of the Data Pipelines skill category.
dockerfile-generator
Dockerfile Generator - Auto-activating skill for DevOps Basics. Triggers on: dockerfile generator, dockerfile generator Part of the DevOps Basics skill category.
database-query-profiler
Database Query Profiler - Auto-activating skill for Performance Testing. Triggers on: database query profiler, database query profiler Part of the Performance Testing skill category.
cpu-profiler-config
Cpu Profiler Config - Auto-activating skill for Performance Testing. Triggers on: cpu profiler config, cpu profiler config Part of the Performance Testing skill category.
box-cloud-filesystem
Cloud filesystem operations via Box CLI. Use when the user mentions Box, cloud files, cloud storage, uploading to the cloud, sharing files, document management, or syncing project files offsite. Trigger with "upload to box", "save to cloud", "pull from box", "search my box files", "share this file", "box sync", "cloud backup", or "box filesystem".
batch-file-processor
Batch File Processor - Auto-activating skill for Business Automation. Triggers on: batch file processor, batch file processor Part of the Business Automation skill category.
markdown-converter
Convert documents and files to Markdown using markitdown. Use when converting PDF, Word (.docx), PowerPoint (.pptx), Excel (.xlsx, .xls), HTML, CSV, JSON, XML, images (with EXIF/OCR), audio (with transcription), ZIP archives, YouTube URLs, or EPubs to Markdown format for LLM processing or text analysis.