agentleFS
julismanjulisman/virtual-worker/skills/data/pdf-extractor/SKILL.md

Pdf Extractor

Skill0 starsChanged 29 days agoApache-2.0View on GitHub

Extract structured fields from one or more PDFs into JSON or CSV using a schema agreed with the user, listing per file every field that could not be found.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Write the file with write_file into the working folder.

    line 38
  2. Distinctive:

    Never guess. A field you did not read in that file's text is missing — report it, don't infer it from filenames, other files, or world …

    line 57
  3. Distinctive:

    Do not change the agreed schema mid-batch.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Pdf Extractor

You pull an agreed set of fields out of PDF files and write them to JSON or CSV, reporting per file which fields you could NOT find instead of guessing them.

Inputs

  • One or more PDF paths in the working folder (if unnamed, glob for *.pdf and confirm the list with the user).
  • A field schema: field names + a one-line meaning of each. If the user has not given one, propose it from the first PDF and get agreement BEFORE extracting.
  • Output format: json (default; one object per file) or csv (one row per file).
  • Output filename: default extracted.json / extracted.csv.

Steps

  1. Fix the schema. Restate the fields as a short list ("field — what it means") and get the user's OK. For a single ad-hoc PDF a proposed schema in the same message is fine; for a batch, wait for confirmation.
  2. For each PDF, call document_read(path). For very large PDFs call document_info(path) first and read in parts if the tool supports ranges.
  3. Extract each schema field from the text. Take values verbatim from the document; normalize only formatting (trim, join wrapped lines). Dates go to ISO YYYY-MM-DD when unambiguous, otherwise keep as printed and note it.
  4. A field not present or not readable → record null (JSON) / empty cell (CSV) and add it to that file's missing list. Never fill a gap with a guess or a value from another file.
  5. Assemble the output. JSON: an array of objects, each with source_file, the schema fields, and missing: [...]. CSV: header = source_file + schema fields; missing fields are empty cells.
  6. Write the file with write_file into the working folder.
  7. Report per file: fields found vs missing, plus anything ambiguous (two candidate values, unreadable scan) that needs the user's eye.

Output format

  • The data file in the working folder (extracted.json or extracted.csv).
  • A chat summary:
Extracted <k> fields from <n> PDFs → extracted.json
| File | Found | Missing |
|---|---|---|
| a.pdf | 6/7 | signature_date |
Notes: <ambiguities, per file>

Rules

  • Never guess. A field you did not read in that file's text is missing — report it, don't infer it from filenames, other files, or world knowledge.
  • Scanned/image-only PDF (document_read returns little or no text): report the file as unreadable and continue with the rest; do not invent content.
  • Two plausible values for one field: pick none — put both in the notes and ask.
  • Do not change the agreed schema mid-batch; if a new important field shows up, finish the batch, then propose a schema v2.
  • Local-first: nothing is sent anywhere; output stays in the working folder.
  • Reply in the user's language; keep extracted values in the document's language.

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.