Skill0 starsChanged 26 days agoMITView on GitHub
Create, read, merge, fill, and secure PDF files.
- Installs packages
We split this skill into the rules it gives an agent
13 rules. 0 are common, 1 is distinctive, and 12 are very specific to this project.
0
Common
Most of the 179 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
NOT for scanned/image-only PDFs (see references/ocr-extraction.md) and NOT for pixel-perfect HTML-to-PDF rendering (use a headless browser).
- Very specific: line 66
All helpers live in scripts/ and are argparse CLIs — run them with the terminal tool.
- Very specific: line 115
Inspect first: Run pdf_read.py file.pdf --meta.
- Very specific: line 116
Create: Write a JSON spec with write_file (elements: heading, paragraph, table, image, pagebreak.
- Very specific: line 119
Build forms: Write one form-spec JSON (fields with label_box/entry_box in PDF points — see references/forms.md), lint it with …
- Very specific: line 139
NeedAppearances: after filling, viewers only render values if appearance streams exist.
- Very specific: line 153
After create/merge/split: pdf_read.py out.pdf --meta — confirm page_count, and per-page rotation when you rotated.
- Distinctive: line 154
After extraction: check the JSON is non-empty and spot-check a known string or cell.
- Very specific: line 156
After building a form: pdf_read.py form.pdf --fields lists every spec field with the right type and options.
- Very specific: line 157
After form fill: pdf_read.py filled.pdf --fields and compare values (exact match, including non-ASCII).
- Very specific: line 158
After stamping: re-extract text (pypdf for rotated stamps) or render the page with pdf_page_image.py and inspect with vision_analyze.
- Very specific: line 159
After metadata/attachment edits: pdf_read.py --meta / pdf_meta.py --list-attachments, and re-extract an attachment to byte-compare.
- Very specific: line 160
After encrypt: --meta shows "encrypted": true and opening without a password fails.
“Common” is measured: kept by at least 6 in 10 of the 179 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.
Files
PDF Skill
Create PDFs from structured specs, build and fill AcroForm forms (with layout linting and visual overlays), extract text/tables/metadata, merge/split/rotate/watermark/stamp pages, export page images, manage metadata and attachments, and encrypt/decrypt — using pypdf, reportlab, and pdfplumber. Scanned (image-only) PDFs contain no text layer: when a page is image-only, stop and follow references/ocr-extraction.md instead of pretending to extract text.
When to Use
- Generate a report, invoice, or multi-page document as PDF.
- Build a fillable AcroForm (text/checkbox/radio/dropdown) from a JSON spec, linting the layout first.
- Pull text, tables (JSON/CSV), metadata, or form-field values out of a PDF.
- Merge, split, rotate, extract page subsets, watermark, stamp text/images at coordinates, bookmark, or compress PDFs.
- Export pages as PNGs for visual review or for OCR hand-off; set/clear document metadata; add/extract file attachments.
- Fill or flatten AcroForm forms; encrypt or decrypt with passwords.
- NOT for scanned/image-only PDFs (see
references/ocr-extraction.md) and NOT for pixel-perfect HTML-to-PDF rendering (use a headless browser).
Bundled toolchains
- AcroForm field inspection & fill —
scripts/acroform/carries the deeper form tooling:extract_form_structure.py,extract_form_field_info.py,check_fillable_fields.py,check_bounding_boxes.py,fill_fillable_fields.py,fill_pdf_form_with_annotations.py,convert_pdf_to_images.py,create_validation_image.py. Reach for these when the lightweightpdf_fill_form.py/pdf_make_form.pyflow is not enough — e.g. when inspecting a vendor-shipped AcroForm before filling, or validating fill geometry against bounding boxes. - Official IRS tax forms (2025) —
forms/*.pdfbundles f1040, f1040s1–s8, f1040sa–sse, f2441, f5329, f8812, f8889, f8936, f8949, f8959, f8960, f8995.references/tax-forms.mdis required reading before filling any form informs/;references/tax.mdcovers the preparation workflow. - Advanced rendering & tooling —
references/rendering-and-advanced.mdfor pypdfium2 rendering, pdf-lib / pdfjs-dist JavaScript, qpdf / poppler flags, performance tuning, and troubleshooting.
Prerequisites
- Python 3.10+ with
pypdf,reportlab,pdfplumber:python -m pip install pypdf reportlab pdfplumber - Optional, for page rasterization (
pdf_page_image.py, overlay rendering):python -m pip install pypdfium2, or poppler'spdftoppmon PATH. Scripts fall back pypdfium2 → pdftoppm and report{"rendered": false, "missing": [...]}(exit 0) when neither exists. - Each helper script checks imports lazily and prints an install hint if a dependency is missing.
How to Run
All helpers live in scripts/ and are argparse CLIs — run them with the terminal tool; every one supports --help. They read/write JSON strictly as UTF-8, print JSON results to stdout, and exit non-zero on failure.
python scripts/pdf_create.py spec.json -o out.pdf # build PDF from JSON spec
python scripts/pdf_make_form.py formspec.json -o form.pdf # build fillable AcroForm from JSON spec
python scripts/pdf_form_layout.py formspec.json # lint form layout BEFORE building
python scripts/pdf_form_layout.py formspec.json --render-overlay boxes.png [--pdf form.pdf]
python scripts/pdf_read.py doc.pdf --text # per-page text (JSON)
python scripts/pdf_read.py doc.pdf --tables --csv-dir t/ # tables to JSON + CSV files
python scripts/pdf_read.py doc.pdf --meta # metadata, page sizes, encrypted/scanned flags
python scripts/pdf_read.py form.pdf --fields # form fields: name, type, value
python scripts/pdf_merge.py a.pdf b.pdf -o merged.pdf [--bookmarks]
python scripts/pdf_split.py doc.pdf --pages 1-3,7 -o part.pdf [--rotate 90]
python scripts/pdf_fill_form.py form.pdf --fields-json values.json -o filled.pdf [--flatten]
python scripts/pdf_secure.py doc.pdf --encrypt -o enc.pdf --user-password your-password
python scripts/pdf_secure.py enc.pdf --decrypt -o dec.pdf --password your-password
python scripts/pdf_watermark.py doc.pdf --stamp mark.pdf -o stamped.pdf [--under]
python scripts/pdf_stamp.py doc.pdf -o out.pdf --text "DRAFT" --x 150 --y 400 \
--font-size 60 --rotation 45 --opacity 0.3 --color "#cc0000" [--pages 1-3]
python scripts/pdf_stamp.py doc.pdf -o out.pdf --image sig.png --x 400 --y 60 --width 120
python scripts/pdf_page_image.py doc.pdf --pages 1-3 --dpi 150 --out-dir imgs/
python scripts/pdf_meta.py doc.pdf --set-meta --title "T" --author "A" -o out.pdf
python scripts/pdf_meta.py doc.pdf --attach data.csv -o out.pdf
python scripts/pdf_meta.py doc.pdf --list-attachments | --extract-attachments dir/
```text
## Quick Reference
| Task | Tool | Command / API |
|---|---|---|
| Create doc (headings, tables, images) | reportlab platypus | `pdf_create.py spec.json -o out.pdf` |
| Build fillable form | reportlab acroForm | `pdf_make_form.py formspec.json -o form.pdf` |
| Lint form layout / overlay image | pure python + PIL | `pdf_form_layout.py formspec.json [--render-overlay o.png]` |
| Per-page text | pdfplumber | `pdf_read.py f.pdf --text` |
| Tables → JSON/CSV | pdfplumber | `pdf_read.py f.pdf --tables` |
| Metadata / sizes / encrypted / scanned | pypdf + pdfplumber | `pdf_read.py f.pdf --meta` |
| Merge (+ outline) | pypdf | `pdf_merge.py a.pdf b.pdf -o m.pdf` |
| Split / extract / rotate | pypdf | `pdf_split.py f.pdf --pages 2-5 --rotate 90` |
| List / fill / flatten form | pypdf | `pdf_read.py --fields`, `pdf_fill_form.py` |
| Encrypt / decrypt (AES-256) | pypdf | `pdf_secure.py --encrypt/--decrypt` |
| Watermark / stamp PDF page | pypdf | `pdf_watermark.py f.pdf --stamp w.pdf` |
| Stamp text/image at coordinates | reportlab + pypdf | `pdf_stamp.py f.pdf --text "Sign here" --x 400 --y 60` |
| Pages → PNG (review / OCR hand-off) | pypdfium2 or pdftoppm | `pdf_page_image.py f.pdf --pages 1-3 --out-dir imgs/` |
| Set/clear metadata, attachments | pypdf | `pdf_meta.py --set-meta / --attach / --extract-attachments` |
| Compress content streams | pypdf | `pdf_split.py f.pdf --pages 1-N --compress` |
## Procedure
1. **Inspect first.** Run `pdf_read.py file.pdf --meta`. Check `encrypted` (if true, decrypt first with `pdf_secure.py --decrypt`) and `likely_scanned_pages`. If pages are image-only, export them with `pdf_page_image.py --pages <scanned> --dpi 300 --out-dir imgs/` and follow `references/ocr-extraction.md` on the PNGs — do not report empty text as "no content".
2. **Create.** Write a JSON spec with `write_file` (elements: `heading`, `paragraph`, `table`, `image`, `pagebreak`; optional `title`/`author` metadata; page numbers are added automatically), then run `pdf_create.py`. Verify visually with `vision_analyze` on a rendered page image if layout matters.
3. **Extract.** `--text` gives a JSON list of per-page strings; `--tables` gives row arrays per page and can also emit CSV files. Read results with `read_file`; never eyeball a binary PDF directly.
4. **Manipulate.** `pdf_merge.py` concatenates and can add one bookmark per source file; `pdf_split.py` handles page ranges (1-based, e.g. `1-3,5,9-`), rotation in 90° steps, and `--compress`. Watermark by preparing a single-page stamp PDF (e.g. via `pdf_create.py`) and overlaying it with `pdf_watermark.py`; for one-liner stamps ("sign here", diagonal DRAFT, corner labels) use `pdf_stamp.py` with text or an image at explicit coordinates.
5. **Build forms.** Write one form-spec JSON (fields with `label_box`/`entry_box` in PDF points — see `references/forms.md`), lint it with `pdf_form_layout.py` and fix every reported problem, optionally review the `--render-overlay` PNG with `vision_analyze`, then build with `pdf_make_form.py` and confirm with `pdf_read.py --fields`.
6. **Fill forms.** List fields (`--fields`) to learn exact names and types, write a UTF-8 JSON of `{"FieldName": "value"}` with `write_file` (checkboxes accept `true`/`false`; radio/choice values must match the field's export options), then `pdf_fill_form.py`. Re-read with `--fields` to confirm values landed.
7. **Metadata & attachments.** `pdf_meta.py --set-meta` writes Title/Author/Subject/Keywords (DocInfo); `--clear-meta` drops them; `--attach`/`--list-attachments`/`--extract-attachments` round-trip embedded files.
8. **Secure.** Encrypt with distinct user/owner passwords and AES-256. To remove a password you know, `--decrypt` writes an unencrypted copy.
9. **Verify** (see below) before reporting success.
## References
| File | Read it when |
|---|---|
| `references/forms.md` | Building or filling AcroForms: field-spec geometry, radio groups, `NeedAppearances` behaviour |
| `references/ocr-extraction.md` | A page is image-only: pymupdf-vs-marker decision table, `scripts/extract_pymupdf.py`, `scripts/extract_marker.py --check` for disk headroom |
| `references/nano-pdf-editing.md` | The user wants text inside an existing PDF changed by description (`nano-pdf edit f.pdf 3 "…"`) rather than rebuilt — not for structural work |
Turning a document into cited obligations, deadlines, or proposed actions is a different job — see the `document-to-action-items` skill. This skill owns file mechanics; that one owns what happens to the extracted content.
## Pitfalls
- **Scanned PDFs**: empty `extract_text()` plus page images means there is no text layer. Follow `references/ocr-extraction.md`; do not fabricate text.
- **Flattening limits**: `pdf_fill_form.py --flatten` uses pypdf's flatten support, which converts widget appearances into page content. It is reliable for plain text fields and checkboxes but can drop or misrender exotic widgets (rich text, custom appearance streams, some radio groups). Verify the flattened output visually with `vision_analyze`; for bulletproof flattening use an external renderer (e.g. Ghostscript or `pdftoppm`+reassembly) as a fallback.
- **NeedAppearances**: after filling, viewers only render values if appearance streams exist. The fill script sets the AcroForm `NeedAppearances` flag so conforming viewers regenerate them; some minimal viewers ignore it — flatten if display fidelity matters.
- **Non-Latin form values**: values are stored correctly (UTF-16), but the field's default font may lack glyphs, so a viewer can show blanks even though the data round-trips. Verify with `--fields`, not just visually.
- **Compression expectations**: `--compress` only deflates content streams. Typical savings are 0–20%; it does nothing for PDFs dominated by images or already-compressed streams. It is not a substitute for image downsampling (Ghostscript territory).
- **Permission flags don't enforce**: owner-password permission bits (no-print, no-copy) are polite requests that viewers may honor; any library (including pypdf) can read and strip them. Only the user password actually gates content via encryption. Never present permission flags as security.
- **Table extraction is heuristic**: pdfplumber detects tables from ruling lines/word alignment; borderless or merged-cell tables may need `table_settings` tuning or manual cleanup.
- **Page indexing**: helper CLIs take 1-based pages; pypdf APIs are 0-based. The scripts convert — don't double-convert.
- **Rotated stamp text extraction**: pdfplumber's line grouping scrambles rotated glyphs (a 45° "DRAFT" extracts as stray letters); verify rotated stamps with `pypdf`'s `extract_text()` or a rendered image instead.
- **Radio groups**: reportlab needs ≥2 `radio()` widgets per group, fills need the slashed export value (`"/red"`), and flatten fidelity is worst for radios — see `references/forms.md`.
- **Metadata scope**: `pdf_meta.py` writes the classic DocInfo dictionary only; embedded XMP metadata (if any) is left untouched and may show different values in some viewers.
- **PDF/A is out of scope**: pypdf/reportlab cannot produce or validate conformant PDF/A. If archival conformance is required, run Ghostscript via the `terminal` tool (e.g. `gs -dPDFA=2 -dPDFACompatibilityPolicy=1 -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -o out.pdf in.pdf` with a suitable ICC profile) and validate with veraPDF — both are external installs, and the result still needs validation, not assumption.
- Rotation must be a multiple of 90; encrypted inputs must be decrypted before any other operation.
## Verification
- After create/merge/split: `pdf_read.py out.pdf --meta` — confirm `page_count`, and per-page `rotation` when you rotated.
- After extraction: check the JSON is non-empty and spot-check a known string or cell.
- Form design loop: `pdf_form_layout.py spec.json` must exit 0; then `--render-overlay boxes.png --pdf form.pdf` and review the PNG with `vision_analyze` (red = entry boxes with field names, blue = label boxes) asking about overlaps, misalignment, and labels detached from their fields. Iterate spec → lint → overlay until clean.
- After building a form: `pdf_read.py form.pdf --fields` lists every spec field with the right type and options.
- After form fill: `pdf_read.py filled.pdf --fields` and compare values (exact match, including non-ASCII).
- After stamping: re-extract text (pypdf for rotated stamps) or render the page with `pdf_page_image.py` and inspect with `vision_analyze`.
- After metadata/attachment edits: `pdf_read.py --meta` / `pdf_meta.py --list-attachments`, and re-extract an attachment to byte-compare.
- After encrypt: `--meta` shows `"encrypted": true` and opening without a password fails; after decrypt, text extraction matches the original.
- For anything visual (watermarks, flattened forms), render and inspect with `vision_analyze`.
## Scripts
- `_raster.py`Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- NousResearch/hermes-agent★ 259k75% same
- aivrar/portable-hermes-agent★ 23995% same
- wundercorp/loki★ 2893% same
- Samin12/skills★ 890% same
- abduznik/abduznik-skills★ 293% same
Wrote their own version · 187
- anthropics/skills★ 186ksame name
- shareAI-lab/learn-claude-code★ 80ksame name
- shareAI-lab/analysis_claude_code★ 78ksame name
- openai/skills★ 27ksame name
- spinabot/brigade★ 11ksame name
- netease-youdao/LobsterAI★ 6.2ksame name
- OpenBMB/PilotDeck★ 4.5ksame name
- nextlevelbuilder/goclaw★ 3.7ksame name
- awslabs/amazon-bedrock-agentcore-samples★ 3.5ksame name
- awslabs/agentcore-samples★ 3.5ksame name
177 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects 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-hSkillVideo 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-hSkillVLM
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-niu474Skillgift-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-niu474SkillPodcast 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
OpenAISkillmigrate-to-codex
Migrate supported instruction files, skills, agents, and MCP config into Codex project and global files.
Also in 6 projects that use this
SeifBenayedSkillfile-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
In this repository172 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aes-agentSkill
- aes-capabilitiesSkill
- aes-contractSkill
- aes-docsSkill
- aes-lint-arwakySkill
- aes-migrationSkill
- aes-rootSkill
- aes-surfaceSkill
- aes-taxonomySkill
- aes-testing-suiteSkill
- aes-utilitySkill
- build-with-aiSkill
- omni-model-inventorySkill
- omnirouteSkill
- xai-apiSkill
- android-emulator-linux-gpsSkill
- chromium-profile-provisioningSkill
- computer-useSkill
- flatpak-chromium-automationSkill
- qwen-web-arwaky-devSkill
- qwen-webSkill
- cleanup-consolidateSkill
- codacy-analysis-cliSkill
- codacy-cloud-cliSkill
- codacy-code-reviewSkill
- codebase-inspectionSkill
- coderabbit-reviewSkill
- code-reviewSkill
- configure-codacy-cloudSkill
- configure-codacySkill
- fix-bypassSkill
- fix-markdown-inline-htmlSkill
- fixture-dir-pruningSkill
- harness-source-auditSkill
- no-mistakesSkill
- report-linter-false-positiveSkill
- reviewSkill
- setup-coverageSkill
- strict-code-quality-reviewSkill
- architecture-diagramSkill
- ascii-artSkill
- ascii-videoSkill
- baoyu-infographicSkill
- blender-arwakySkill
- claude-designSkill
- comfyuiSkill
- design-mdSkill
- excalidrawSkill
- game-assetsSkill
- gif-searchSkill
- imagineSkill
- manim-videoSkill
- p5jsSkill
- popular-web-designsSkill
- pretextSkill
- psd-overlay-verificationSkill
- psd-timelapse-workflowSkill
- sketchSkill
- songseeSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

