Skip to main content
skill CX Codex

batch-processor — Claude Code skill: bulk document processing

A skill for running one operation across hundreds of files at once: convert, extract text, rename, or update headers, with parallel workers and progress tracking.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add claude-office-skills/skills --skill batch-processor -a claude-code
Open on GitHub

What batch-processor does

Point batch-processor at a folder and it runs a single operation over every file that matches — convert, extract text, rename, edit headers and footers. The skill ships a Python pattern built on ProcessPoolExecutor from concurrent.futures, with tqdm for progress and a BatchProcessor class that writes a checkpoint to checkpoint.json after each file. Kill a long job halfway and the next run skips what is already done.

Worker count is yours to set; the example uses max_workers=8, and you want that near your core count or the parallelism starts fighting itself. A file that throws does not take down the run — it lands in the results with an error status so you can review the failures later.

You need Python plus the dependencies from the install line: python-docx, openpyxl, python-pptx, reportlab, jinja2. The skill hooks into the office-mcp MCP server and calls its batch_convert tool, so document operations depend on that server being available. English and Chinese are supported.

What it helps with

  • convert a hundred PDFs to Word in one pass
  • pull text out of every image in a folder
  • rename files and sort them into subfolders
  • update headers and footers across all documents
  • resume a failed run without redoing finished files

Example prompts for the agent

  • Convert every PDF in /documents/invoices to Word
  • Extract text from all the images in this directory
  • Rename these files by pattern and sort them into subfolders

How to install batch-processor

1Skills CLI (Vercel)

npx skills add claude-office-skills/skills --skill batch-processor -a claude-code

2Manually: put the files in place

~/.claude/skills/batch-processor/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/batch-processor/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about batch-processor

How do I install batch-processor in Claude?

Run npx skills add claude-office-skills/skills --skill batch-processor -a claude-code. The skill lands at ~/.claude/skills/batch-processor/SKILL.md.

What does batch-processor do?

It runs one operation across many files in parallel: conversion, text extraction, renaming, header edits. Progress shows through tqdm, and checkpointing lets a run continue after a failure.

What does batch-processor need to work?

Python with python-docx, openpyxl, python-pptx, reportlab and jinja2, plus access to the office-mcp MCP server and its batch_convert tool.

Source text

SKILL.md · MIT
---
# ═══════════════════════════════════════════════════════════════════════════════
# CLAUDE OFFICE SKILL - Enhanced Metadata v2.0
# ═══════════════════════════════════════════════════════════════════════════════

# Basic Information
name: batch-processor
description: "Process multiple documents in bulk with parallel execution"
version: "1.0"
author: claude-office-skills
license: MIT

# Categorization
category: workflow
tags:
  - batch
  - processor
  - bulk
  - automation
department: All

# AI Model Compatibility
models:
  recommended:
    - claude-sonnet-4
    - claude-opus-4
  compatible:
    - claude-3-5-sonnet
    - gpt-4
    - gpt-4o

# MCP Tools Integration
mcp:
  server: office-mcp
  tools:
    - batch_convert

# Skill Capabilities
capabilities:
  - batch_processing
  - automation

# Language Support
languages:
  - en
  - zh
---

# Batch Processor Skill

## Overview

This skill enables efficient bulk processing of documents - convert, transform, extract, or analyze hundreds of files with parallel execution and progress tracking.

## How to Use

1. Describe what you want to accomplish
2. Provide any required input data or files
3. I'll execute the appropriate operations

**Example prompts:**
- "Convert 100 PDFs to Word documents"
- "Extract text from all images in a folder"
- "Batch rename and organize files"
- "Mass update document headers/footers"

## Domain Knowledge


### Batch Processing Patterns

```
Input: [file1, file2, ..., fileN]
         │
         ▼
    ┌─────────────┐
    │  Parallel   │  ← Process multiple files concurrently
    │  Workers    │
    └─────────────┘
         │
         ▼
Output: [result1, result2, ..., resultN]
```

### Python Implementation

```python
from concurrent.futures import ProcessPoolExecutor, as_completed
from pathlib import Path
from tqdm import tqdm

def process_file(file_path: Path) -> dict:
    """Process a single file."""
    # Your processing logic here
    return {"path": str(file_path), "status": "success"}

def batch_process(input_dir: str, pattern: str = "*.*", max_workers: int = 4):
    """Process all matching files in directory."""
    
    files = list(Path(input_dir).glob(pattern))
    results = []
    
    with ProcessPoolExecutor(max_workers=max_workers) as executor:
        futures = {executor.submit(process_file, f): f for f in files}
        
        for future in tqdm(as_completed(futures), total=len(files)):
            file = futures[future]
            try:
                result = future.result()
                results.append(result)
            except Exception as e:
                results.append({"path": str(file), "error": str(e)})
    
    return results

# Usage
results = batch_process("/documents/invoices", "*.pdf", max_workers=8)
print(f"Processed {len(results)} files")
```

### Error Handling & Resume

```python
import json
from pathlib import Path

class BatchProcessor:
    def __init__(self, checkpoint_file: str = "checkpoint.json"):
        self.checkpoint_file = checkpoint_file
        self.processed = self._load_checkpoint()
    
    def _load_checkpoint(self):
        if Path(self.checkpoint_file).exists():
            return json.load(open(self.checkpoint_file))
        return {}
    
    def _save_checkpoint(self):
        json.dump(self.processed, open(self.checkpoint_file, "w"))
    
    def process(self, files: list, processor_func):
        for file in files:
            if str(file) in self.processed:
                continue  # Skip already processed
            
            try:
                result = processor_func(file)
                self.processed[str(file)] = {"status": "success", **result}
            except Exception as e:
                self.processed[str(file)] = {"status": "error", "error": str(e)}
            
            self._save_checkpoint()  # Resume-safe
```


## Best Practices

1. **Use progress bars (tqdm) for user feedback**
2. **Implement checkpointing for long jobs**
3. **Set reasonable worker counts (CPU cores)**
4. **Log failures for later review**

## Installation

```bash
# Install required dependencies
pip install python-docx openpyxl python-pptx reportlab jinja2
```

## Resources

- [Custom Repository](https://github.com/claude-office-skills/skills)
- [Claude Office Skills Hub](https://github.com/claude-office-skills/skills)

© claude-office-skills · MIT · claude-office-skills/skills

Similar skills

Everything for Office documents →

From the same set109

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor