agentleFS
yohei1126yohei1126/agent-skills/pdf-to-markdown/SKILL.md

pdf-to-markdown

Skill2 starsChanged 21 days agoMITView on GitHub

Converts a PDF file to a Markdown file. Uses pdftotext (poppler) to extract text with layout preservation, then applies heuristics to identify headings and format the output as clean Markdown with YAML front matter. Use when the user wants to convert a PDF document to Markdown for editing, archiving, or ingestion into a knowledge base.

  • Installs packages

16 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the conversion script from the agent-skills/ directory.

    line 22
  2. Very specific:

    If pdftotext is not installed, the script exits with an error message.

    line 62
  3. Distinctive:

    If the input PDF does not exist, the script exits with an error.

    line 63
  4. Distinctive:

    If the derived output path already exists, a numeric suffix is appended rather than overwriting.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Prerequisites

Install poppler if not already present:

brew install poppler   # macOS
# or: apt-get install poppler-utils  # Debian/Ubuntu

Instructions

Run the conversion script from the agent-skills/ directory.

Usage

cd agent-skills
npx tsx pdf-to-markdown/scripts/convert.ts <input.pdf> [output.md]
ArgumentRequiredDescription
input.pdfYesPath to the source PDF file
output.mdNoOutput file path. Derived from the input filename if omitted (same directory, .md extension).

Steps

  1. Run the script with the PDF path and optional output path.
  2. pdftotext extracts text with -layout (preserves column spacing) and -nopgbrk (removes form-feed characters).
  3. Heuristics detect headings: short, ALL-CAPS lines surrounded by blank lines become ## headings.
  4. A YAML front matter block is prepended:
    ---
    source: <original filename>
    converted: <YYYY-MM-DD>
    ---
  5. The file is saved. If the output path already exists, a numeric suffix is appended (e.g. report-2.md).

Examples

# Derive output from input → saves to: documaris/_inputs/report.md
npx tsx pdf-to-markdown/scripts/convert.ts documaris/_inputs/report.pdf

# Save to a specific path
npx tsx pdf-to-markdown/scripts/convert.ts documaris/_inputs/report.pdf docs/report.md

Edge cases

  • If pdftotext is not installed, the script exits with an error message.
  • If the input PDF does not exist, the script exits with an error.
  • Scanned/image-only PDFs will produce empty or near-empty output (no OCR is performed).
  • If the derived output path already exists, a numeric suffix is appended rather than overwriting.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.