[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PYF66FRCW3KVBTFAZ4044J":3,"skill-same:01M6PYF66FRCW3KVBTFAZ4044J":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6PYF66FRCW3KVBTFAZ4044J","batch-convert",null,"Batch convert documents between multiple formats using a unified pipeline","Kernel8901\u002Fai-agent-skills-classification","Kernel8901","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F72647553?v=4","01M6KV388J2H5PNC8D8P940BJD","01M6KV38CS5B3AY63RKZB410YM",7,"MIT","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fbatch-convert\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"batch","convert","batch convert","automation","documents","code","file","office","pipeline","execution","computer","operations","conversion","sonnet","opus","formats","2026-11-10 10:12:30",false,"---\nname: batch-convert\ndescription: Batch convert documents between multiple formats using a unified pipeline\nauthor: claude-office-skills\nversion: \"1.0\"\ntags: [conversion, batch, automation, pipeline, formats]\nmodels: [claude-sonnet-4, claude-opus-4]\ntools: [computer, code_execution, file_operations]\n---\n\n# Batch Convert Skill\n\n## Overview\n\nThis skill enables batch conversion of documents between multiple formats using a unified pipeline. Convert hundreds of files at once with consistent settings, automatic format detection, and parallel processing for maximum efficiency.\n\n## How to Use\n\n1. Specify the source folder or files\n2. Choose target format(s)\n3. Optionally configure conversion options\n4. I'll process all files with progress tracking\n\n**Example prompts:**\n- \"Convert all PDFs in this folder to Word documents\"\n- \"Batch convert these markdown files to PDF and HTML\"\n- \"Process all Office files and convert to Markdown\"\n- \"Convert this folder of images to a single PDF\"\n\n## Domain Knowledge\n\n### Supported Format Matrix\n\n| From | To: DOCX | To: PDF | To: MD | To: HTML | To: PPTX |\n|------|----------|---------|--------|----------|----------|\n| DOCX | - | ✅ | ✅ | ✅ | - |\n| PDF | ✅ | - | ✅ | ✅ | - |\n| MD | ✅ | ✅ | - | ✅ | ✅ |\n| HTML | ✅ | ✅ | ✅ | - | - |\n| XLSX | - | ✅ | ✅ | ✅ | - |\n| PPTX | - | ✅ | ✅ | ✅ | - |\n\n### Core Pipeline\n\n```python\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nimport subprocess\nimport os\n\nclass DocumentConverter:\n    \"\"\"Unified document conversion pipeline.\"\"\"\n    \n    def __init__(self, max_workers=4):\n        self.max_workers = max_workers\n        self.converters = {\n            ('md', 'docx'): self._md_to_docx,\n            ('md', 'pdf'): self._md_to_pdf,\n            ('md', 'html'): self._md_to_html,\n            ('md', 'pptx'): self._md_to_pptx,\n            ('docx', 'pdf'): self._docx_to_pdf,\n            ('docx', 'md'): self._docx_to_md,\n            ('pdf', 'docx'): self._pdf_to_docx,\n            ('pdf', 'md'): self._pdf_to_md,\n            ('xlsx', 'pdf'): self._xlsx_to_pdf,\n            ('xlsx', 'md'): self._xlsx_to_md,\n            ('pptx', 'pdf'): self._pptx_to_pdf,\n            ('pptx', 'md'): self._pptx_to_md,\n            ('html', 'md'): self._html_to_md,\n            ('html', 'pdf'): self._html_to_pdf,\n        }\n    \n    def convert(self, input_path, output_format, output_dir=None):\n        \"\"\"Convert single file to target format.\"\"\"\n        input_path = Path(input_path)\n        input_format = input_path.suffix[1:].lower()\n        \n        if output_dir:\n            output_path = Path(output_dir) \u002F f\"{input_path.stem}.{output_format}\"\n        else:\n            output_path = input_path.with_suffix(f\".{output_format}\")\n        \n        converter_key = (input_format, output_format)\n        if converter_key not in self.converters:\n            raise ValueError(f\"Conversion not supported: {input_format} -> {output_format}\")\n        \n        converter = self.converters[converter_key]\n        return converter(input_path, output_path)\n    \n    def batch_convert(self, input_dir, output_format, output_dir=None, \n                      file_pattern=\"*\", recursive=False):\n        \"\"\"Batch convert all matching files.\"\"\"\n        input_path = Path(input_dir)\n        output_path = Path(output_dir) if output_dir else input_path \u002F \"converted\"\n        output_path.mkdir(exist_ok=True)\n        \n        # Find files\n        if recursive:\n            files = list(input_path.rglob(file_pattern))\n        else:\n            files = list(input_path.glob(file_pattern))\n        \n        # Filter to supported formats\n        supported_ext = ['.md', '.docx', '.pdf', '.xlsx', '.pptx', '.html']\n        files = [f for f in files if f.suffix.lower() in supported_ext]\n        \n        results = []\n        \n        with ThreadPoolExecutor(max_workers=self.max_workers) as executor:\n            future_to_file = {\n                executor.submit(self.convert, f, output_format, output_path): f\n                for f in files\n            }\n            \n            for future in as_completed(future_to_file):\n                file = future_to_file[future]\n                try:\n                    result = future.result()\n                    results.append({'file': str(file), 'status': 'success', 'output': str(result)})\n                except Exception as e:\n                    results.append({'file': str(file), 'status': 'error', 'error': str(e)})\n        \n        return results\n```\n\n### Converter Implementations\n\n```python\n# Markdown conversions (using Pandoc)\ndef _md_to_docx(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_pdf(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_html(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-s', '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_pptx(self, input_path, output_path):\n    subprocess.run(['marp', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\n# Office to Markdown (using markitdown)\ndef _docx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\ndef _xlsx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\ndef _pptx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\n# PDF conversions\ndef _pdf_to_docx(self, input_path, output_path):\n    from pdf2docx import Converter\n    cv = Converter(str(input_path))\n    cv.convert(str(output_path))\n    cv.close()\n    return output_path\n\ndef _pdf_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\n# Office to PDF (using LibreOffice)\ndef _docx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n\ndef _xlsx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n\ndef _pptx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n```\n\n### Progress Tracking\n\n```python\nfrom tqdm import tqdm\n\ndef batch_convert_with_progress(converter, input_dir, output_format, output_dir=None):\n    \"\"\"Batch convert with progress bar.\"\"\"\n    input_path = Path(input_dir)\n    files = list(input_path.glob('*'))\n    \n    results = []\n    for file in tqdm(files, desc=f\"Converting to {output_format}\"):\n        try:\n            result = converter.convert(file, output_format, output_dir)\n            results.append({'file': str(file), 'status': 'success'})\n        except Exception as e:\n            results.append({'file': str(file), 'status': 'error', 'error': str(e)})\n    \n    return results\n```\n\n## Best Practices\n\n1. **Test Sample First**: Convert a few files before batch processing\n2. **Check Disk Space**: Ensure sufficient space for output\n3. **Use Parallel Processing**: Speed up with multiple workers\n4. **Handle Errors Gracefully**: Log failures, continue processing\n5. **Verify Output**: Spot-check converted files\n\n## Common Patterns\n\n### Format Detection Pipeline\n```python\ndef detect_and_convert(file_path, target_format):\n    \"\"\"Automatically detect format and convert.\"\"\"\n    import mimetypes\n    \n    mime_type, _ = mimetypes.guess_type(str(file_path))\n    \n    format_map = {\n        'application\u002Fpdf': 'pdf',\n        'application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',\n        'application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',\n        'application\u002Fvnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',\n        'text\u002Fmarkdown': 'md',\n        'text\u002Fhtml': 'html',\n    }\n    \n    source_format = format_map.get(mime_type, Path(file_path).suffix[1:])\n    \n    converter = DocumentConverter()\n    return converter.convert(file_path, target_format)\n```\n\n### Multi-Format Output\n```python\ndef convert_to_multiple_formats(input_file, output_formats, output_dir):\n    \"\"\"Convert one file to multiple formats.\"\"\"\n    converter = DocumentConverter()\n    results = {}\n    \n    for fmt in output_formats:\n        try:\n            output = converter.convert(input_file, fmt, output_dir)\n            results[fmt] = {'status': 'success', 'path': str(output)}\n        except Exception as e:\n            results[fmt] = {'status': 'error', 'error': str(e)}\n    \n    return results\n\n# Convert README to multiple formats\nresults = convert_to_multiple_formats(\n    'README.md',\n    ['docx', 'pdf', 'html'],\n    '.\u002Fexports'\n)\n```\n\n## Examples\n\n### Example 1: Documentation Export\n```python\nfrom pathlib import Path\nimport json\n\ndef export_documentation(docs_dir, export_dir):\n    \"\"\"Export all documentation to multiple formats.\"\"\"\n    \n    converter = DocumentConverter(max_workers=8)\n    docs_path = Path(docs_dir)\n    export_path = Path(export_dir)\n    \n    # Create format directories\n    for fmt in ['pdf', 'docx', 'html']:\n        (export_path \u002F fmt).mkdir(parents=True, exist_ok=True)\n    \n    all_results = {}\n    \n    # Find all markdown files\n    md_files = list(docs_path.rglob('*.md'))\n    \n    for md_file in md_files:\n        file_results = {}\n        \n        for fmt in ['pdf', 'docx', 'html']:\n            output_dir = export_path \u002F fmt\n            try:\n                output = converter.convert(md_file, fmt, output_dir)\n                file_results[fmt] = 'success'\n            except Exception as e:\n                file_results[fmt] = f'error: {e}'\n        \n        all_results[str(md_file)] = file_results\n        print(f\"Processed: {md_file.name}\")\n    \n    # Save report\n    with open(export_path \u002F 'export_report.json', 'w') as f:\n        json.dump(all_results, f, indent=2)\n    \n    return all_results\n\nresults = export_documentation('.\u002Fdocs', '.\u002Fexports')\n```\n\n### Example 2: Legacy Document Migration\n```python\ndef migrate_legacy_docs(source_dir, target_dir):\n    \"\"\"Migrate legacy documents to modern formats.\"\"\"\n    \n    converter = DocumentConverter(max_workers=4)\n    \n    # Migration rules\n    migrations = [\n        ('*.doc', 'docx'),   # Old Word to new\n        ('*.xls', 'xlsx'),   # Old Excel to new\n        ('*.ppt', 'pptx'),   # Old PowerPoint to new\n        ('*.rtf', 'docx'),   # RTF to Word\n    ]\n    \n    source_path = Path(source_dir)\n    target_path = Path(target_dir)\n    target_path.mkdir(exist_ok=True)\n    \n    total_migrated = 0\n    errors = []\n    \n    for pattern, target_format in migrations:\n        files = list(source_path.glob(pattern))\n        \n        for file in files:\n            try:\n                # Use LibreOffice for legacy formats\n                subprocess.run([\n                    'soffice', '--headless',\n                    '--convert-to', target_format,\n                    '--outdir', str(target_path),\n                    str(file)\n                ], check=True)\n                \n                total_migrated += 1\n                print(f\"Migrated: {file.name}\")\n                \n            except Exception as e:\n                errors.append({'file': str(file), 'error': str(e)})\n    \n    print(f\"\\nMigration complete: {total_migrated} files\")\n    print(f\"Errors: {len(errors)}\")\n    \n    return {'migrated': total_migrated, 'errors': errors}\n```\n\n### Example 3: Report Generation Pipeline\n```python\ndef generate_reports_pipeline(data_files, template_dir, output_dir):\n    \"\"\"Generate reports from data files using templates.\"\"\"\n    \n    from datetime import datetime\n    \n    converter = DocumentConverter()\n    output_path = Path(output_dir)\n    output_path.mkdir(exist_ok=True)\n    \n    timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')\n    \n    reports = []\n    \n    for data_file in data_files:\n        # Load data\n        data_path = Path(data_file)\n        \n        # Generate markdown report\n        md_content = f\"\"\"---\ntitle: Report - {data_path.stem}\ndate: {datetime.now().strftime('%Y-%m-%d')}\n---\n\n# {data_path.stem} Report\n\nGenerated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n## Data Summary\n\n\"\"\"\n        \n        # Add data content (simplified)\n        if data_path.suffix == '.xlsx':\n            from markitdown import MarkItDown\n            md = MarkItDown()\n            result = md.convert(str(data_path))\n            md_content += result.text_content\n        \n        # Save markdown\n        md_file = output_path \u002F f\"{data_path.stem}_{timestamp}.md\"\n        with open(md_file, 'w') as f:\n            f.write(md_content)\n        \n        # Convert to PDF and DOCX\n        for fmt in ['pdf', 'docx']:\n            try:\n                output = converter.convert(md_file, fmt, output_path)\n                reports.append({'source': str(data_file), 'output': str(output), 'format': fmt})\n            except Exception as e:\n                print(f\"Error converting {data_file} to {fmt}: {e}\")\n    \n    return reports\n```\n\n## Limitations\n\n- Some format combinations not supported\n- Complex formatting may be lost in conversion\n- Large files may require more time\n- Some conversions need external tools (LibreOffice, Pandoc)\n- Quality varies by source document complexity\n\n## Installation\n\n```bash\n# Core dependencies\npip install pdf2docx markitdown python-docx openpyxl\n\n# Pandoc (for MD conversions)\nbrew install pandoc  # macOS\napt install pandoc   # Ubuntu\n\n# Marp (for PPTX)\nnpm install -g @marp-team\u002Fmarp-cli\n\n# LibreOffice (for Office formats)\nbrew install libreoffice  # macOS\napt install libreoffice   # Ubuntu\n```\n\n## Resources\n\n- [Pandoc Documentation](https:\u002F\u002Fpandoc.org\u002FMANUAL.html)\n- [markitdown GitHub](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmarkitdown)\n- [pdf2docx Documentation](https:\u002F\u002Fpdf2docx.readthedocs.io\u002F)\n- [LibreOffice CLI](https:\u002F\u002Fhelp.libreoffice.org\u002Flatest\u002Fen-US\u002Ftext\u002Fshared\u002Fguide\u002Fstart_parameters.html)\n","# Batch Convert Skill\n\n## Overview\n\nThis skill enables batch conversion of documents between multiple formats using a unified pipeline. Convert hundreds of files at once with consistent settings, automatic format detection, and parallel processing for maximum efficiency.\n\n## How to Use\n\n1. Specify the source folder or files\n2. Choose target format(s)\n3. Optionally configure conversion options\n4. I'll process all files with progress tracking\n\n**Example prompts:**\n- \"Convert all PDFs in this folder to Word documents\"\n- \"Batch convert these markdown files to PDF and HTML\"\n- \"Process all Office files and convert to Markdown\"\n- \"Convert this folder of images to a single PDF\"\n\n## Domain Knowledge\n\n### Supported Format Matrix\n\n| From | To: DOCX | To: PDF | To: MD | To: HTML | To: PPTX |\n|------|----------|---------|--------|----------|----------|\n| DOCX | - | ✅ | ✅ | ✅ | - |\n| PDF | ✅ | - | ✅ | ✅ | - |\n| MD | ✅ | ✅ | - | ✅ | ✅ |\n| HTML | ✅ | ✅ | ✅ | - | - |\n| XLSX | - | ✅ | ✅ | ✅ | - |\n| PPTX | - | ✅ | ✅ | ✅ | - |\n\n### Core Pipeline\n\n```python\nfrom pathlib import Path\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\nimport subprocess\nimport os\n\nclass DocumentConverter:\n    \"\"\"Unified document conversion pipeline.\"\"\"\n    \n    def __init__(self, max_workers=4):\n        self.max_workers = max_workers\n        self.converters = {\n            ('md', 'docx'): self._md_to_docx,\n            ('md', 'pdf'): self._md_to_pdf,\n            ('md', 'html'): self._md_to_html,\n            ('md', 'pptx'): self._md_to_pptx,\n            ('docx', 'pdf'): self._docx_to_pdf,\n            ('docx', 'md'): self._docx_to_md,\n            ('pdf', 'docx'): self._pdf_to_docx,\n            ('pdf', 'md'): self._pdf_to_md,\n            ('xlsx', 'pdf'): self._xlsx_to_pdf,\n            ('xlsx', 'md'): self._xlsx_to_md,\n            ('pptx', 'pdf'): self._pptx_to_pdf,\n            ('pptx', 'md'): self._pptx_to_md,\n            ('html', 'md'): self._html_to_md,\n            ('html', 'pdf'): self._html_to_pdf,\n        }\n    \n    def convert(self, input_path, output_format, output_dir=None):\n        \"\"\"Convert single file to target format.\"\"\"\n        input_path = Path(input_path)\n        input_format = input_path.suffix[1:].lower()\n        \n        if output_dir:\n            output_path = Path(output_dir) \u002F f\"{input_path.stem}.{output_format}\"\n        else:\n            output_path = input_path.with_suffix(f\".{output_format}\")\n        \n        converter_key = (input_format, output_format)\n        if converter_key not in self.converters:\n            raise ValueError(f\"Conversion not supported: {input_format} -> {output_format}\")\n        \n        converter = self.converters[converter_key]\n        return converter(input_path, output_path)\n    \n    def batch_convert(self, input_dir, output_format, output_dir=None, \n                      file_pattern=\"*\", recursive=False):\n        \"\"\"Batch convert all matching files.\"\"\"\n        input_path = Path(input_dir)\n        output_path = Path(output_dir) if output_dir else input_path \u002F \"converted\"\n        output_path.mkdir(exist_ok=True)\n        \n        # Find files\n        if recursive:\n            files = list(input_path.rglob(file_pattern))\n        else:\n            files = list(input_path.glob(file_pattern))\n        \n        # Filter to supported formats\n        supported_ext = ['.md', '.docx', '.pdf', '.xlsx', '.pptx', '.html']\n        files = [f for f in files if f.suffix.lower() in supported_ext]\n        \n        results = []\n        \n        with ThreadPoolExecutor(max_workers=self.max_workers) as executor:\n            future_to_file = {\n                executor.submit(self.convert, f, output_format, output_path): f\n                for f in files\n            }\n            \n            for future in as_completed(future_to_file):\n                file = future_to_file[future]\n                try:\n                    result = future.result()\n                    results.append({'file': str(file), 'status': 'success', 'output': str(result)})\n                except Exception as e:\n                    results.append({'file': str(file), 'status': 'error', 'error': str(e)})\n        \n        return results\n```\n\n### Converter Implementations\n\n```python\n# Markdown conversions (using Pandoc)\ndef _md_to_docx(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_pdf(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_html(self, input_path, output_path):\n    subprocess.run(['pandoc', str(input_path), '-s', '-o', str(output_path)], check=True)\n    return output_path\n\ndef _md_to_pptx(self, input_path, output_path):\n    subprocess.run(['marp', str(input_path), '-o', str(output_path)], check=True)\n    return output_path\n\n# Office to Markdown (using markitdown)\ndef _docx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\ndef _xlsx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\ndef _pptx_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\n# PDF conversions\ndef _pdf_to_docx(self, input_path, output_path):\n    from pdf2docx import Converter\n    cv = Converter(str(input_path))\n    cv.convert(str(output_path))\n    cv.close()\n    return output_path\n\ndef _pdf_to_md(self, input_path, output_path):\n    from markitdown import MarkItDown\n    md = MarkItDown()\n    result = md.convert(str(input_path))\n    with open(output_path, 'w') as f:\n        f.write(result.text_content)\n    return output_path\n\n# Office to PDF (using LibreOffice)\ndef _docx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n\ndef _xlsx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n\ndef _pptx_to_pdf(self, input_path, output_path):\n    subprocess.run([\n        'soffice', '--headless', '--convert-to', 'pdf',\n        '--outdir', str(output_path.parent), str(input_path)\n    ], check=True)\n    return output_path\n```\n\n### Progress Tracking\n\n```python\nfrom tqdm import tqdm\n\ndef batch_convert_with_progress(converter, input_dir, output_format, output_dir=None):\n    \"\"\"Batch convert with progress bar.\"\"\"\n    input_path = Path(input_dir)\n    files = list(input_path.glob('*'))\n    \n    results = []\n    for file in tqdm(files, desc=f\"Converting to {output_format}\"):\n        try:\n            result = converter.convert(file, output_format, output_dir)\n            results.append({'file': str(file), 'status': 'success'})\n        except Exception as e:\n            results.append({'file': str(file), 'status': 'error', 'error': str(e)})\n    \n    return results\n```\n\n## Best Practices\n\n1. **Test Sample First**: Convert a few files before batch processing\n2. **Check Disk Space**: Ensure sufficient space for output\n3. **Use Parallel Processing**: Speed up with multiple workers\n4. **Handle Errors Gracefully**: Log failures, continue processing\n5. **Verify Output**: Spot-check converted files\n\n## Common Patterns\n\n### Format Detection Pipeline\n```python\ndef detect_and_convert(file_path, target_format):\n    \"\"\"Automatically detect format and convert.\"\"\"\n    import mimetypes\n    \n    mime_type, _ = mimetypes.guess_type(str(file_path))\n    \n    format_map = {\n        'application\u002Fpdf': 'pdf',\n        'application\u002Fvnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',\n        'application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',\n        'application\u002Fvnd.openxmlformats-officedocument.presentationml.presentation': 'pptx',\n        'text\u002Fmarkdown': 'md',\n        'text\u002Fhtml': 'html',\n    }\n    \n    source_format = format_map.get(mime_type, Path(file_path).suffix[1:])\n    \n    converter = DocumentConverter()\n    return converter.convert(file_path, target_format)\n```\n\n### Multi-Format Output\n```python\ndef convert_to_multiple_formats(input_file, output_formats, output_dir):\n    \"\"\"Convert one file to multiple formats.\"\"\"\n    converter = DocumentConverter()\n    results = {}\n    \n    for fmt in output_formats:\n        try:\n            output = converter.convert(input_file, fmt, output_dir)\n            results[fmt] = {'status': 'success', 'path': str(output)}\n        except Exception as e:\n            results[fmt] = {'status': 'error', 'error': str(e)}\n    \n    return results\n\n# Convert README to multiple formats\nresults = convert_to_multiple_formats(\n    'README.md',\n    ['docx', 'pdf', 'html'],\n    '.\u002Fexports'\n)\n```\n\n## Examples\n\n### Example 1: Documentation Export\n```python\nfrom pathlib import Path\nimport json\n\ndef export_documentation(docs_dir, export_dir):\n    \"\"\"Export all documentation to multiple formats.\"\"\"\n    \n    converter = DocumentConverter(max_workers=8)\n    docs_path = Path(docs_dir)\n    export_path = Path(export_dir)\n    \n    # Create format directories\n    for fmt in ['pdf', 'docx', 'html']:\n        (export_path \u002F fmt).mkdir(parents=True, exist_ok=True)\n    \n    all_results = {}\n    \n    # Find all markdown files\n    md_files = list(docs_path.rglob('*.md'))\n    \n    for md_file in md_files:\n        file_results = {}\n        \n        for fmt in ['pdf', 'docx', 'html']:\n            output_dir = export_path \u002F fmt\n            try:\n                output = converter.convert(md_file, fmt, output_dir)\n                file_results[fmt] = 'success'\n            except Exception as e:\n                file_results[fmt] = f'error: {e}'\n        \n        all_results[str(md_file)] = file_results\n        print(f\"Processed: {md_file.name}\")\n    \n    # Save report\n    with open(export_path \u002F 'export_report.json', 'w') as f:\n        json.dump(all_results, f, indent=2)\n    \n    return all_results\n\nresults = export_documentation('.\u002Fdocs', '.\u002Fexports')\n```\n\n### Example 2: Legacy Document Migration\n```python\ndef migrate_legacy_docs(source_dir, target_dir):\n    \"\"\"Migrate legacy documents to modern formats.\"\"\"\n    \n    converter = DocumentConverter(max_workers=4)\n    \n    # Migration rules\n    migrations = [\n        ('*.doc', 'docx'),   # Old Word to new\n        ('*.xls', 'xlsx'),   # Old Excel to new\n        ('*.ppt', 'pptx'),   # Old PowerPoint to new\n        ('*.rtf', 'docx'),   # RTF to Word\n    ]\n    \n    source_path = Path(source_dir)\n    target_path = Path(target_dir)\n    target_path.mkdir(exist_ok=True)\n    \n    total_migrated = 0\n    errors = []\n    \n    for pattern, target_format in migrations:\n        files = list(source_path.glob(pattern))\n        \n        for file in files:\n            try:\n                # Use LibreOffice for legacy formats\n                subprocess.run([\n                    'soffice', '--headless',\n                    '--convert-to', target_format,\n                    '--outdir', str(target_path),\n                    str(file)\n                ], check=True)\n                \n                total_migrated += 1\n                print(f\"Migrated: {file.name}\")\n                \n            except Exception as e:\n                errors.append({'file': str(file), 'error': str(e)})\n    \n    print(f\"\\nMigration complete: {total_migrated} files\")\n    print(f\"Errors: {len(errors)}\")\n    \n    return {'migrated': total_migrated, 'errors': errors}\n```\n\n### Example 3: Report Generation Pipeline\n```python\ndef generate_reports_pipeline(data_files, template_dir, output_dir):\n    \"\"\"Generate reports from data files using templates.\"\"\"\n    \n    from datetime import datetime\n    \n    converter = DocumentConverter()\n    output_path = Path(output_dir)\n    output_path.mkdir(exist_ok=True)\n    \n    timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')\n    \n    reports = []\n    \n    for data_file in data_files:\n        # Load data\n        data_path = Path(data_file)\n        \n        # Generate markdown report\n        md_content = f\"\"\"---\ntitle: Report - {data_path.stem}\ndate: {datetime.now().strftime('%Y-%m-%d')}\n---\n\n# {data_path.stem} Report\n\nGenerated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n## Data Summary\n\n\"\"\"\n        \n        # Add data content (simplified)\n        if data_path.suffix == '.xlsx':\n            from markitdown import MarkItDown\n            md = MarkItDown()\n            result = md.convert(str(data_path))\n            md_content += result.text_content\n        \n        # Save markdown\n        md_file = output_path \u002F f\"{data_path.stem}_{timestamp}.md\"\n        with open(md_file, 'w') as f:\n            f.write(md_content)\n        \n        # Convert to PDF and DOCX\n        for fmt in ['pdf', 'docx']:\n            try:\n                output = converter.convert(md_file, fmt, output_path)\n                reports.append({'source': str(data_file), 'output': str(output), 'format': fmt})\n            except Exception as e:\n                print(f\"Error converting {data_file} to {fmt}: {e}\")\n    \n    return reports\n```\n\n## Limitations\n\n- Some format combinations not supported\n- Complex formatting may be lost in conversion\n- Large files may require more time\n- Some conversions need external tools (LibreOffice, Pandoc)\n- Quality varies by source document complexity\n\n## Installation\n\n```bash\n# Core dependencies\npip install pdf2docx markitdown python-docx openpyxl\n\n# Pandoc (for MD conversions)\nbrew install pandoc  # macOS\napt install pandoc   # Ubuntu\n\n# Marp (for PPTX)\nnpm install -g @marp-team\u002Fmarp-cli\n\n# LibreOffice (for Office formats)\nbrew install libreoffice  # macOS\napt install libreoffice   # Ubuntu\n```\n\n## Resources\n\n- [Pandoc Documentation](https:\u002F\u002Fpandoc.org\u002FMANUAL.html)\n- [markitdown GitHub](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmarkitdown)\n- [pdf2docx Documentation](https:\u002F\u002Fpdf2docx.readthedocs.io\u002F)\n- [LibreOffice CLI](https:\u002F\u002Fhelp.libreoffice.org\u002Flatest\u002Fen-US\u002Ftext\u002Fshared\u002Fguide\u002Fstart_parameters.html)\n",{"name":5,"tags":39,"tools":40,"author":43,"models":44,"version":47,"description":7},[30,18,21,26,33],[28,41,42],"code_execution","file_operations","claude-office-skills",[45,46],"claude-sonnet-4","claude-opus-4","1.0","main","f4cb2d49f7667e79ef7804f50396d5aaffdf1f56","工作流自动化\u002Fbatch-convert",1,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification","https:\u002F\u002Fgithub.com\u002FKernel8901","a little little little dobe in life but science geek","2026-04-05 16:43:56",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add Kernel8901\u002Fai-agent-skills-classification --skill batch-convert",{"tool":62,"command":63},"bunx","bunx skills add Kernel8901\u002Fai-agent-skills-classification --skill batch-convert",{"tool":65,"command":66},"pnpm","pnpm dlx skills add Kernel8901\u002Fai-agent-skills-classification --skill batch-convert","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fbatch-convert\u002FSKILL.md",true,[70],{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"_meta.json","REFERENCE","参考文档",286,"https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F工作流自动化\u002Fbatch-convert\u002F_meta.json",[77,101,137,148,158,188],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":34},"01M6Q5R6WZ06RRB9RQTW54B34B","zyfai","Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit\u002Fwithdraw anytime.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzyfai-sdk\u002FSKILL.md",[],[79,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100],"safe","ethereum","defi","Optimization","user","use","Wallet","base","deposit","withdraw","yield","arbitrum","non-custodial","passive","defi yield","earn","yield optimization",{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":119,"publishedAt":34},"01M6Q5R337B5JSNER4P4YS03TN","zerion-api","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api\u002FSKILL.md",[106,111,114],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":112,"categoryName":113,"taxonomyType":109,"taxonomyTypeDesc":110},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[120,121,122,123,124,125,126,86,127,90,128,129,130,131,132,133,134,135,136],"api","zerion api","zerion","MCP","mcp server","server","blockchain","transactions","crypto wallet","crypto","evm","solana","query","across","positions","token","prices",{"skillNo":138,"name":139,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":145,"publishedAt":34},"01M6Q5QZFYTDAZMZ27BN5VZXAR","zerion-api-skill","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-skill\u002FSKILL.md",[142,143,144],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},{"categoryNo":112,"categoryName":113,"taxonomyType":109,"taxonomyTypeDesc":110},{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},[120,146,147,121,122,123,124,125,126,86,127,90,129,130,131,132,133,134,135,136],"api skill","zerion api skill",{"skillNo":149,"name":150,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":156,"publishedAt":34},"01M6Q5QW17QW98RA3FE45E4RD8","zerion-api-mcp","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fzerion-api-mcp\u002FSKILL.md",[153,154,155],{"categoryNo":107,"categoryName":108,"taxonomyType":109,"taxonomyTypeDesc":110},{"categoryNo":112,"categoryName":113,"taxonomyType":109,"taxonomyTypeDesc":110},{"categoryNo":115,"categoryName":116,"taxonomyType":117,"taxonomyTypeDesc":118},[123,120,157,121,122,124,125,86,127,90,128,129,130,131,132,133,134,135,136],"zerion api mcp",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":167,"publishedAt":34},"01M6Q5QQYZB7A501BDEQWKGSJT","yahoo-finance-forex","Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR\u002FUSD, GBP\u002FUSD, USD\u002FJPY, etc.). Analyzes sentiment and provides trading context.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-forex\u002FSKILL.md",[164],{"categoryNo":165,"categoryName":166,"taxonomyType":117,"taxonomyTypeDesc":118},"01JBSEEDCAT000000000000040","财务",[168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],"finance","yahoo finance","forex","yahoo","yahoo finance forex","github","https","sentiment","real-time","python3","install","Market","usd","news","time","currency","gbp","pip","market data","for",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":195,"publishedAt":34},"01M6Q5QM6VS84WZVM7BKXXPF32","yahoo-finance","This skill should be used when the user asks to \"get stock prices\", \"check stock quotes\", \"look up earnings\", \"get financial data\", \"find trending stocks\", or needs stock market data from Yahoo Finance.","https:\u002F\u002Fgithub.com\u002FKernel8901\u002Fai-agent-skills-classification\u002Fblob\u002Fmain\u002F金融\u002Fyahoo-finance-cli\u002FSKILL.md",[194],{"categoryNo":165,"categoryName":166,"taxonomyType":117,"taxonomyTypeDesc":118},[168,169,171,196,197,198,199,200,201,179,202,203,204,205,206,207,208,209,136,186],"cli","homebrew","find","check","brew","up","local","get","stock","link","trending","sf","quotes","ln"]