batch-processor — скилл для Claude Code: пакетная обработка файлов
Скилл для массовой обработки документов: конвертация, извлечение текста, переименование сотен файлов с параллельным запуском и отслеживанием прогресса.
npx skills add claude-office-skills/skills --skill batch-processor -a claude-codeЧто делает batch-processor
Скилл batch-processor берёт папку с файлами и прогоняет по ним одну операцию — конвертировать, извлечь текст, переименовать, обновить колонтитулы. Внутри описан шаблон на Python: ProcessPoolExecutor из concurrent.futures раскидывает файлы по воркерам, tqdm показывает прогресс, а класс BatchProcessor пишет чекпоинт в checkpoint.json после каждого файла. Если задача упала на середине, повторный запуск пропустит уже обработанное.
Число воркеров задаётся вручную — в примере max_workers=8, и это стоит подгонять под ядра машины, иначе параллельность начнёт мешать сама себе. Ошибки по отдельным файлам не роняют весь прогон: они собираются в результат со статусом error, чтобы потом разобрать список.
Для работы нужен Python и зависимости из установочной строки: python-docx, openpyxl, python-pptx, reportlab, jinja2. Скилл подключается к MCP-серверу office-mcp и вызывает его инструмент batch_convert — без этого сервера часть операций с документами не сработает. Поддерживаются английский и китайский.
Какие задачи решает
- конвертировать сотню PDF в Word за один прогон
- вытащить текст из всех картинок в папке
- переименовать и разложить файлы по категориям
- обновить колонтитулы сразу во всех документах
- дозапустить обработку после сбоя, не переделывая готовое
Примеры запросов агенту
- Сконвертируй все PDF из папки /documents/invoices в Word
- Извлеки текст из всех изображений в этой директории
- Переименуй файлы по шаблону и разложи по подпапкам
Как установить batch-processor
1Через Skills CLI (Vercel)
npx skills add claude-office-skills/skills --skill batch-processor -a claude-code2Вручную: положить файлы
~/.claude/skills/batch-processor/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/batch-processor/
1Через Skills CLI (Vercel)
npx skills add claude-office-skills/skills --skill batch-processor -a codex2Вручную: положить файлы
.agents/skills/batch-processor/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add claude-office-skills/skills --skill batch-processor -a cursor2Вручную: положить файлы
.cursor/skills/batch-processor/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install claude-office-skills/skills batch-processor2Вручную: положить файлы
.github/skills/batch-processor/SKILL.md1Через Skills CLI (Vercel)
npx skills add claude-office-skills/skills --skill batch-processor -a gemini-cli2Командой платформы
gemini skills install https://github.com/claude-office-skills/skills --path batch-processorВручную: положить файлы
.devin/skills/batch-processor/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add claude-office-skills/skills --skill batch-processor -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора109
Похожие
Рядом в теме «Документы и офис»
Всё по теме «Документы и офис» →Вопросы о batch-processor
Как установить batch-processor в Claude?
Выполните npx skills add claude-office-skills/skills --skill batch-processor -a claude-code. Скилл появится в ~/.claude/skills/batch-processor/SKILL.md.
Что делает batch-processor?
Прогоняет одну операцию по множеству файлов параллельно: конвертация, извлечение текста, переименование, правка колонтитулов. Прогресс виден через tqdm, а чекпоинт позволяет продолжить с места сбоя.
Что нужно для работы скилла?
Python с библиотеками python-docx, openpyxl, python-pptx, reportlab, jinja2 и доступ к MCP-серверу office-mcp с инструментом batch_convert.
Исходный текст
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