pdf-tools — скилл для Claude Code, Codex и Cursor: работа с PDF
Скилл pdf-tools для Claude Code, Codex, Cursor, GitHub Copilot и Gemini CLI, который покрывает весь цикл работы с PDF: извлечение текста и таблиц, генерацию, изменение и заполнение форм.
MIT 186 установок ★ 29 обновлён 2026-08-17
npx skills add oakoss/agent-skills --skill pdf-tools -a claude-codeЧто делает pdf-tools
Скилл задаёт агенту чёткую карту инструментов: Puppeteer и Playwright — для генерации PDF из HTML, pdf-lib и форк @cantoo/pdf-lib — для правки, слияния и работы с AcroForm-полями, unpdf — для лёгкого извлечения текста на edge и serverless, pdfplumber на Python — для таблиц со сложной разметкой. Шифрование через qpdf с AES-256, цифровые подписи через @signpdf/* с PKCS#7 и P12-сертификатами.
Скилл различает сценарии, где стандартные парсеры не справятся. Для многоколоночного текста и слитых ячеек он направляет агента к vision-модели с Zod-схемой или к pdfplumber. Для незаполнимых форм — к Python-скриптам с аннотациями по bounding box. Для архивного соответствия PDF/A — к ghostscript и verapdf. Есть отдельный раздел про очереди на BullMQ с Redis.
В скилле прямо описаны типичные ошибки: window.print() на сервере, запуск Puppeteer в edge-окружении, запись в поля сплющенной формы без инспекции AcroForm. Если нужна редакция с удалением байтов, а не визуальным перекрытием, скилл указывает на pymupdf с apply_redactions() — стандартный overlay контент не удаляет.
Какие задачи решает
- извлечь таблицы с объединёнными ячейками из PDF через vision-модель
- сгенерировать PDF из HTML-шаблона на React с точным воспроизведением верстки
- заполнить незаполнимую PDF-форму через аннотации по координатам
- зашифровать PDF с AES-256 перед сохранением в хранилище
- настроить пакетную очередь обработки PDF с повторами и отслеживанием прогресса
Примеры запросов агенту
- Извлеки таблицу из
report.pdfчерез vision-модель и верни структуру по Zod-схеме - Сгенерируй PDF из
invoice.htmlчерез Puppeteer и встрой шрифты из WOFF2 - Зашифруй
contract.pdfс AES-256 черезqpdfи задай пароль пользователя и владельца
Как установить pdf-tools
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill pdf-tools -a claude-code2Вручную: положить файлы
~/.claude/skills/pdf-tools/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/pdf-tools/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill pdf-tools -a codex2Вручную: положить файлы
.agents/skills/pdf-tools/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill pdf-tools -a cursor2Вручную: положить файлы
.cursor/skills/pdf-tools/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/pdf-tools2Вручную: положить файлы
.github/skills/pdf-tools/SKILL.md1Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill pdf-tools -a gemini-cli2Командой платформы
gemini skills install https://github.com/oakoss/agent-skills --path skills/pdf-toolsВручную: положить файлы
.devin/skills/pdf-tools/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill pdf-tools -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о pdf-tools
Как установить pdf-tools в Claude Code?
Выполни команду npx skills add oakoss/agent-skills --skill pdf-tools -a claude-code. Скилл появится по пути ~/.claude/skills/pdf-tools/SKILL.md.
Что делает скилл pdf-tools?
Он передаёт агенту карту инструментов и решений для полного цикла работы с PDF: извлечение, генерация через Puppeteer, изменение через pdf-lib, заполнение форм, шифрование и цифровые подписи.
Работает ли pdf-tools в edge и serverless-окружениях?
Для edge подходит unpdf — он совместим с serverless. Puppeteer там не запустится, потому что требует полноценного Node.js-окружения; скилл это различает.
Исходный текст
SKILL.md · MIT
--- name: pdf-tools description: 'PDF engineering for extraction, generation, modification, and form filling. Use when extracting text or tables from PDFs, generating PDFs with Puppeteer, modifying PDFs with pdf-lib, filling PDF forms, or implementing PDF security. Use for AI-assisted OCR, HTML-to-PDF conversion, and document processing pipelines.' license: MIT metadata: author: oakoss version: '1.1' --- # PDF Tools Full-lifecycle PDF engineering covering extraction, generation, modification, form filling, and security. Prioritizes JavaScript-first solutions (pdf-lib, unpdf, Puppeteer) with Python/CLI utilities for advanced scenarios. **When to use**: Extracting structured data from PDFs, generating pixel-perfect PDFs from HTML/React, modifying existing PDFs, filling forms (fillable or non-fillable), or securing documents with encryption. **When NOT to use**: Simple text file processing, image-only manipulation without PDF context, or tasks better handled by a word processor. ## Quick Reference | Task | Tool | Key Point | | -------------------------- | ----------------------------- | -------------------------------------------------------------------------- | | Generate PDF from HTML | Puppeteer / Playwright | `page.pdf()`; use `networkidle0` (Puppeteer) or `networkidle` (Playwright) | | Extract text (lightweight) | unpdf | Edge/serverless compatible | | Extract tables (AI) | Vision model + Zod schema | Multi-column and merged cell support | | Extract tables (non-AI) | pdfplumber (Python) | Precise cell boundary detection | | Modify, merge, split | pdf-lib (or `@pdfme/pdf-lib`) | Byte-level PDF manipulation in JS | | Fill fillable forms | pdf-lib (or `@pdfme/pdf-lib`) | Inspect AcroForm fields before writing | | Fill non-fillable forms | Python annotation scripts | Visual analysis + bounding box annotations | | Encrypt PDF | qpdf | AES-256: `qpdf --encrypt user owner 256 --` | | Repair corrupted PDF | qpdf | `qpdf input.pdf --replace-input` | | Fast text extraction (CLI) | poppler-utils | `pdftotext -layout input.pdf -` | | Merge thousands of files | pypdf (Python) | Lighter than headless browser | | Batch queue processing | BullMQ + unpdf | Redis-backed with retry, concurrency, progress tracking | | PDF/A archival compliance | ghostscript + verapdf | `gs -dPDFA=2` for conversion; verapdf for validation | | Tagged PDF (accessibility) | Puppeteer | `tagged: true` maps HTML semantics to PDF structure tags | | Digital signatures | @signpdf/\* | PKCS#7 signing with P12 certificates | | PDF comparison | unpdf + diff / pixelmatch | Text diff or pixel-level visual diff between versions | | Secure redaction | pymupdf (fitz) | `apply_redactions()` removes content bytes, not just visual overlay | ## Common Mistakes | Mistake | Correct Pattern | | ------------------------------------------------------ | ----------------------------------------------------------------- | | Using canvas drawing commands for PDF generation | Use Puppeteer/Playwright with HTML/CSS templates | | Running Puppeteer in edge/serverless environments | Use unpdf for edge; Puppeteer requires full Node.js | | Extracting complex layouts with basic text parsers | Use AI-assisted OCR or pdfplumber for multi-column text | | Storing unencrypted PDFs with PII in public storage | Apply AES-256 encryption via qpdf before storage | | Relying on `window.print()` for server-side generation | Use headless browser APIs (`page.pdf()`) for deterministic output | | Using pypdf for complex layout extraction | Use pdfplumber or AI OCR for multi-column or overlapping text | | Skipping font embedding in containerized environments | Embed Google Fonts or WOFF2 files with Puppeteer | | Writing to flattened PDF form fields | Inspect AcroForm fields with pdf-lib before writing | | Using unmaintained `pdf-lib` for encrypted PDFs | Use `@cantoo/pdf-lib` fork which adds encrypted PDF support | ## Delegation - **Inspect PDF structure and diagnose extraction issues**: Use `Explore` agent to examine AcroForm fields, encoding, and metadata - **Build end-to-end document processing pipelines**: Use `Task` agent to implement extraction, transformation, and generation workflows - **Design PDF architecture for a new system**: Use `Plan` agent to select tools and plan extraction, generation, or modification strategies ## References - [AI Extraction Patterns](references/ai-extraction-patterns.md) -- Vision-based table extraction, recursive summarization, multi-pass verification - [High-Fidelity Generation](references/high-fidelity-generation.md) -- Puppeteer HTML-to-PDF, CSS print tips, React templates, browser pooling - [Legacy Utilities](references/legacy-utilities.md) -- pdfplumber, pypdf, qpdf, poppler-utils for batch and forensic tasks - [Form Filling](references/form-filling.md) -- Fillable field extraction, non-fillable annotation workflow, validation scripts - [Batch Processing and Accessibility](references/batch-and-accessibility.md) -- Queue-based batch processing, PDF/A compliance, tagged PDFs, digital signatures, comparison, redaction
© oakoss · MIT · oakoss/agent-skills