agentleFS
ukeSJTUukeSJTU/agents/skills/pdf-read/SKILL.md

pdf-read

Skill0 starsChanged 5 months agoMITView on GitHub

Read, review, summarize, search, compare, or answer questions about PDF files. Use this skill whenever the user attaches, names, or refers to a PDF and wants its native text, tables, images, charts, formulas, layout, or page-specific evidence understood—even when they only ask for a summary or a factual answer. This is a read-only, no-OCR skill: never create, edit, merge, annotate, fill, decrypt by bypass, or otherwise modify PDFs.

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 10 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use this skill to understand an existing PDF.

    line 17
  2. Distinctive:

    Prefer native PDF content because the user's PDFs are normally electronic.

    line 21
  3. Very specific:

    Check that uv is available.

    line 32
  4. Very specific:

    Run bundled scripts only with uv run.

    line 35
  5. Very specific:

    Do not invoke uvx, Homebrew, apt, or another unbundled CLI automatically.

    line 38
  6. Very specific:

    If a task would genuinely benefit from one, pause first and state: the missing capability, the specific tool, why it is needed, whether it …

    line 39
  7. Distinctive:

    Keep derived artifacts in a session-owned temporary directory or an explicit user-selected output directory.

    line 42
  8. Very specific:

    Run inspect_pdf.py for every PDF before making claims from it:

    line 58
  9. Distinctive:

    Use its page count, native-text diagnostics, image count, drawing count, and table-of-contents signal to choose the relevant pages and …

    line 64
  10. Very specific:

    If the PDF requires a password, ask the user for it.

    line 69
  11. Very specific:

    Read only the reference files needed for the request.

    line 84
  12. Very specific:

    Use page numbers in all substantive findings.

    line 90
  13. Distinctive:

    Do not treat native extraction order as reliable for multi-column pages, sidebars, complex footnotes, or heavily designed layouts.

    line 97
  14. Distinctive:

    Use the smallest subset that fits the request.

    line 112
  15. Distinctive:

    Do not create, edit, merge, split, watermark, annotate, fill, sign, encrypt, decrypt by bypass, or optimize PDFs.

    line 135
  16. Distinctive:

    Do not OCR pages, images, or regions.

    line 137
  17. Distinctive:

    Do not claim a table, chart, image, or visible text was absent solely because one extractor did not return it.

    line 138
  18. Distinctive:

    Do not install or use an unbundled tool without explaining the gap and waiting for the user's direction.

    line 140

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Read PDFs with page-level evidence

Scope and operating principles

Use this skill to understand an existing PDF. Treat the source PDF as immutable. It may produce JSON, Markdown table data, PNG renders, and extracted image files, but it never writes a PDF or uses OCR.

Prefer native PDF content because the user's PDFs are normally electronic. Native text is often more accurate than OCR and preserves coordinates. If a page or visible region appears to contain text but native extraction is empty, suspiciously short, or garbled, report it as an extraction exception. Do not silently omit it, infer its contents, or replace it with OCR.

Runtime policy

  1. Resolve the absolute path to this skill directory as SKILL_DIR before running a bundled script. Use its absolute script path; do not copy scripts into the user's project.
  2. Check that uv is available. If it is not, pause and tell the user that the bundled read-only scripts need uv, why it is needed, and how they can install it. Do not install it automatically.
  3. Run bundled scripts only with uv run. Their inline metadata installs the declared Python dependencies in uv-managed environments without changing the user's global Python packages.
  4. Do not invoke uvx, Homebrew, apt, or another unbundled CLI automatically. If a task would genuinely benefit from one, pause first and state: the missing capability, the specific tool, why it is needed, whether it is an uvx or system installation, and the proposed command. Wait for direction.
  5. Keep derived artifacts in a session-owned temporary directory or an explicit user-selected output directory. Never overwrite user files. Do not delete artifacts the user asked to keep.

Example setup for an invocation:

SKILL_DIR="/absolute/path/to/pdf-read"
WORK_DIR="$(mktemp -d "${TMPDIR:-/tmp}/pdf-read.XXXXXX")"
uv run "$SKILL_DIR/scripts/inspect_pdf.py" "$PDF_PATH" --output "$WORK_DIR/inspect.json"

Default workflow

1. Inspect before interpreting

Run inspect_pdf.py for every PDF before making claims from it:

uv run "$SKILL_DIR/scripts/inspect_pdf.py" "$PDF_PATH" --output "$WORK_DIR/inspect.json"

Use its page count, native-text diagnostics, image count, drawing count, and table-of-contents signal to choose the relevant pages and reading path. A low text count only signals that visual review may be needed; it is not proof that the page has no visible text.

If the PDF requires a password, ask the user for it. Use --password only when they supply one, do not echo it in the response, and do not retain it after the operation. If the password is rejected, report that fact without retrying guesses.

2. Select the smallest useful reading path

User need or PDF conditionRead this referenceUse these scripts
Narrative text, search, summary, quotation, comparisonreferences/text.mdextract_text.py; render only when layout needs checking
Charts, diagrams, formulas, screenshots, or page appearancereferences/visuals.mdrender_pages.py; use extract_images.py only for embedded originals
Tables, figures with data, or rows and columnsreferences/tables.mdextract_tables.py, then render_pages.py for verification
Empty/garbled text, password, malformed file, or missing runtimereferences/exceptions.mdinspect_pdf.py, then render the affected pages
Questions about uv, a new CLI, output locations, or licensingreferences/runtime.mdNo extra tool without user direction

Read only the reference files needed for the request. For example, a short single-column summary usually needs text.md, not the table and visuals references.

3. Preserve evidence while reading

Use page numbers in all substantive findings. For text, prefer blocks mode so each passage retains a bounding box:

uv run "$SKILL_DIR/scripts/extract_text.py" "$PDF_PATH" --pages "2-4" --mode blocks --output "$WORK_DIR/text.json"

Do not treat native extraction order as reliable for multi-column pages, sidebars, complex footnotes, or heavily designed layouts. Render the relevant page and inspect it before quoting, summarizing, or comparing content whose order matters.

4. Report what was and was not read

State conclusions first, then page evidence. When content could not be reliably extracted, add a separate exception section rather than hiding the limitation. Describe the page, approximate visual region where possible, why the region is uncertain, and its impact on the answer. Explicitly say that no OCR was performed when that matters.

Response structure

Use the smallest subset that fits the request. Do not fabricate empty sections.

## 结论

<answer, summary, or comparison>

## 依据

- <claim or quotation>(第 N 页;如有需要,说明表格、图号或区域)

## 表格或视觉内容

<only when relevant; include source page and any verification caveat>

## 提取异常

- <only when relevant: page, approximate region, native extraction problem,
  impact, and that OCR was not used>

Non-goals

  • Do not create, edit, merge, split, watermark, annotate, fill, sign, encrypt, decrypt by bypass, or optimize PDFs.
  • Do not OCR pages, images, or regions.
  • Do not claim a table, chart, image, or visible text was absent solely because one extractor did not return it.
  • Do not install or use an unbundled tool without explaining the gap and waiting for the user's direction.

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.