pdf-directory-inventory

OCR non-searchable PDFs and generate a _pdf_probe.md index with UUIDs.

6|Updated Feb 9, 2025
One-click install
npx skills add https://github.com/alberti42/dotfiles --skill pdf-directory-inventory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-directory-inventory
Source: https://github.com/alberti42/dotfiles/tree/main/.config/opencode/skills/pdf-directory-inventory
Command: npx skills add https://github.com/alberti42/dotfiles --skill pdf-directory-inventory

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pdftotext, ocrmypdf, pdftoppm, tesseract, qpdf, pdfinfo, and includes scripts (resource) components.

What problem does it solve?

Inventory and review all PDFs in the current directory by OCRing non-searchable PDFs, mechanically extracting a _pdf_probe.md for summarization, and writing a human-friendly index note {{NOTE_NAME}}.md with one section per PDF and Obsidian-style links. It also moves inventoried PDFs into a dedicated attachments folder named "{{NOTE_NAME}} (attachments)".

Core Features & Use Cases

  • Mechanical probe generation: creates _pdf_probe.md deterministically to support later delegation.
  • Obsidian-friendly index: writes {{NOTE_NAME}}.md with per-PDF sections and links to attachments.
  • Attachments management: moves inventoried PDFs into an attachments folder to keep originals organized.

Quick Start

Run the workflow with NOTE_NAME='YourNote' to inventory your PDFs in the current directory.

Frequently Asked Questions about pdf-directory-inventory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inventory and index PDFs in a directory automatically?

To inventory PDFs, this Skill scans the current directory and extracts metadata and text excerpts via pdftotext. It generates a human-readable markdown index file with deterministic UUIDs derived from each file's SHA-256 hash.

Can I OCR non-searchable PDFs and create a markdown index at the same time?

OCR is applied to non-searchable PDFs using ocrmypdf and tesseract before text extraction. The extracted content and metadata are then compiled into a markdown index note with per-PDF sections and attachment links.

What dependencies do I need to run an OCR-based PDF inventory workflow?

A preflight dependency check enforces that pdftotext, ocrmypdf, pdftoppm, tesseract, qpdf, and pdfinfo are installed. All must be present in your environment before the inventory process can start.

Does this PDF inventory process work with Obsidian-style links and attachments?

Obsidian compatibility is supported by writing the index note with Obsidian-style links to attachments. Each inventoried PDF is moved into a dedicated attachments folder to keep original files organized.

How do I generate a markdown probe file from PDF metadata for summarization?

A mechanical _pdf_probe.md file is generated deterministically for each PDF using extracted text and metadata. This probe file supports later delegation and summarization tasks by providing structured raw content.

What happens to PDFs inside the attachments folder during the inventory process?

PDFs located inside the attachments folder are excluded from the inventory process. Only top-level PDFs in the current directory are targeted, inventoried, and subsequently moved into the dedicated attachments folder.