agentleFS
HarnessRouterHarnessRouter/skills/pdf/SKILL.md

pdf

Skill14 starsChanged 4 months agoApache-2.0View on GitHub

Use this skill whenever a PDF is the input or the output. Creating one — a one-pager, report, invoice, brochure, résumé, certificate, handout, or anything the user asks for \"as a PDF\". Reading one — extracting text or tables, answering questions about a document's contents, summarising it. Changing one — merging, splitting, extracting or rotating pages, adding a watermark, filling a fillable form, or rendering pages to images. Trigger on any mention of a .pdf filename, or on a request to produce a printable or shareable document. Do NOT trigger when the deliverable is a Word document, a spreadsheet, a slide deck, or a web page — those have their own skills.

195 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Video Generation, VLM and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • huang-x-hSkill

    Video Generation

    Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.

    Also in 6 projects that use this

  • huang-x-hSkill

    VLM

    Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

    Also in 6 projects that use this

  • dav-niu474Skill

    gift-evaluator

    The PRIMARY tool for Spring Festival gift analysis and social interaction generation. Use this skill when users upload photos of gifts (alcohol, tea, supplements, etc.) to inquire about their value, authenticity, or how to respond socially. Integrates visual perception, market valuation, and HTML card generation.

    Also in 5 projects that use this

  • dav-niu474Skill

    Podcast Generate

    Generate podcast episodes from user-provided content or by searching the web for specified topics. If user uploads a text file/article, creates a dual-host dialogue podcast (or single-host upon request). If no content is provided, searches the web for information about the user-specified topic and generates a podcast. Duration scales with content size (3-20 minutes, ~240 chars/min). Uses z-ai-web-dev-sdk for LLM script generation and TTS audio synthesis. Outputs both a podcast script (Markdown) and a complete audio file (WAV).

    Also in 5 projects that use this

  • Liang-MHSkill

    stock_analysis

    获取 A 股、基金和港股的实时行情和技术分析数据

    Also in 5 projects that use this

  • SeifBenayedSkill

    file-reading

    Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.

    Also in 5 projects that use this

  • +1 more from huang-x-h
  • +2 more from dav-niu474

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 181 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not place text at absolute coordinates to build a document.

    line 20
  2. Very specific:

    Write an .html file, then:

    line 26
  3. Very specific:

    Use size: A4 outside the US.

    line 42
  4. Distinctive:

    Fonts: Only what is installed will render: DejaVu Sans, DejaVu Serif, DejaVu Sans Mono, Liberation Sans, Liberation Serif, Liberation Mono.

    line 47
  5. Very specific:

    If the page count comes back above 1, cut or tighten in this order: drop the least important section, shorten prose, reduce margin on @page …

    line 55
  6. Distinctive:

    If it returns nothing, the PDF is images rather than text.

    line 70
  7. Very specific:

    Write to the working directory.

    line 112

“Common” is measured: kept by at least 6 in 10 of the 181 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

PDF

Pick the approach from the task

TaskApproach
Create a PDFWrite HTML + CSS, render with scripts/html_to_pdf.py
Create from an existing .docx/.xlsx/.pptxsoffice --headless --convert-to pdf --outdir . FILE
Read text or tablesscripts/pdf_text.py
Merge, split, rotate, watermarkscripts/pdf_pages.py
Fill a fillable formscripts/pdf_form.py
Look at the resultscripts/pdf_preview.py

Do not place text at absolute coordinates to build a document. The renderer here is a browser engine, so ordinary HTML and CSS work, and every layout problem you would otherwise solve by hand — wrapping, table widths, keeping a heading with its paragraph — is already solved.

Creating a PDF

Write an .html file, then:

python3 scripts/html_to_pdf.py page.html out.pdf

It prints the page count. That matters: "make it one page" is the most common instruction for this kind of document and the one thing you cannot check by reading your own HTML.

Control paper and margins with @page. This single rule is most of the difference between a document that looks designed and one that looks like a default:

@page { size: Letter; margin: 16mm 15mm; }

Use size: A4 outside the US. @page { size: Letter landscape; } for wide tables.

Read references/design.md before writing the HTML. It has the type scale, spacing, and colour rules that make the difference, plus a one-pager skeleton to start from.

Fonts. Only what is installed will render: DejaVu Sans, DejaVu Serif, DejaVu Sans Mono, Liberation Sans, Liberation Serif, Liberation Mono. Name one explicitly with a generic fallback — an unnamed font is not a design decision. A remote @import (Google Fonts and the like) is not worth the risk: WeasyPrint renders the page whether or not the fetch succeeded, so a slow or blocked request costs you the typeface silently rather than failing.

Fitting one page

If the page count comes back above 1, cut or tighten in this order: drop the least important section, shorten prose, reduce margin on @page to 12mm, tighten line-height toward 1.35. Shrinking body text below 9pt to force a fit is the most obvious sign a document was generated — do that last, and prefer cutting content.

To keep a block from splitting across pages: break-inside: avoid;.

Reading a PDF

python3 scripts/pdf_text.py in.pdf                 # all pages, one labelled block each
python3 scripts/pdf_text.py in.pdf --pages 1-3,7
python3 scripts/pdf_text.py in.pdf --tables        # detected tables as TSV

If it returns nothing, the PDF is images rather than text. There is no OCR installed here. Say that plainly instead of guessing at the contents — a confident summary of a document you could not read is worse than reporting that you could not read it.

Changing pages

python3 scripts/pdf_pages.py info    in.pdf
python3 scripts/pdf_pages.py merge   a.pdf b.pdf -o out.pdf
python3 scripts/pdf_pages.py split   in.pdf --pages 2-5   -o out.pdf
python3 scripts/pdf_pages.py rotate  in.pdf --pages 1 --degrees 90 -o out.pdf
python3 scripts/pdf_pages.py stamp   in.pdf --text DRAFT  -o out.pdf

Forms

python3 scripts/pdf_form.py list in.pdf                          # field names, types, current values
python3 scripts/pdf_form.py fill in.pdf -o out.pdf --set Name="Ada Lovelace" --set Agree=Yes

list first, always — field names are rarely what the visible labels say. Filled values are flattened into the page appearance so they show in every viewer, not only ones that honour form data.

Check the result before saying it is done

python3 scripts/pdf_preview.py out.pdf --outdir preview

Then read the PNGs. After writing the HTML you will see what you intended rather than what rendered. Look for:

  • text overflowing or clipped at a boundary — the most common defect, and always visible to the user
  • content colliding with the page margin, or a footer overlapping the body
  • a table wider than the page, silently cut off at the right edge
  • an orphaned heading alone at the bottom, or a single line stranded on a second page
  • low-contrast text (pale grey on white reads as broken, not subtle)

Where to write files

Write to the working directory. Files there are collected and returned to the user; anything in /tmp is lost when the task ends.

Dependencies

Installed in the image: weasyprint (HTML→PDF), pypdf (pages, forms), pdfplumber (text and tables), pdftoppm from poppler-utils (page images), LibreOffice (soffice, other formats→PDF).

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.