Agent skill · writing content · erichowens

document-generation-pdf

Generate, fill, and assemble PDF documents at scale. Handles legal forms, contracts, invoices, certificates. Supports form filling (pdf-lib), template rendering (Puppeteer, LaTeX), digital

Why this skill is useful

Provides domain-specific knowledge on PDF generation tools and automation patterns that the AI wouldn't reliably generate on its own.

What it needs

Requires latex, npm installed locally. About 11k tokens when loaded. Last updated 2026-07-14. 180 stars on the source repository.

What this skill does

Document Generation & PDF Automation Expert in generating, filling, and assembling PDF documents programmatically for legal, HR, and business workflows. When to Use ✅ Use for: Legal form automation (expungement, immigration, contracts) Invoice/receipt generation at scale Certificate creation (completion, participation, awards) Contract assembly from templates Government form filling (IRS, court filings) Multi-document packet creation ❌ NOT for: Simple PDF viewing (use browser or pdf.js) Basic file conversion (use online tools) OCR text extraction (use Tesseract.js or AWS Textract) PDF editing by hand (use Adobe Acrobat) --- Technology Selection pdf-lib vs Puppeteer vs LaTeX Feature pdf-lib Puppeteer LaTeX --------- --------- ----------- ------- Form filling ✅ Native ❌ Complex ❌ No Template rendering ❌ No ✅ HTML/CSS ✅ Templates Performance (1000 PDFs) 5s 60s 30s File size Small Medium Small Signature fields ✅ Yes ❌ No ❌ No Best for Government forms Invoices, reports Academic papers Timeline: 2000s: LaTeX for academic documents 2010: PDFKit (Node.js) for generation 2017: Puppeteer for HTML → PDF 2019: pdf-lib for pure JS form filling 2024: pdf-lib is gold standard for forms Decision tree: --- Common Anti-Patterns Anti-Pattern 1: Using Puppeteer for Simple Form Filling Novice thinking: "I'll use Puppeteer for everything, it's versatile" Problem: 12x slower, 10x more memory, can't preserve form fields. Wrong approach: Why wrong: Browser overhead (200MB+ RAM per instance) Can't access native PDF form fields Loses interactive form capabilities 12x slower than pdf-lib Correct approach: Performance comparison (1000 PDFs): Puppeteer: 60 seconds, 4GB RAM pdf-lib: 5 seconds, 200MB RAM Timeline context: 2017: Puppeteer released, everyone used it for PDFs 2019: pdf-lib released, proper form handling 2024: pdf-lib is standard for government forms --- Anti-Pattern 2: Not Flattening Forms Problem: Users can edit filled forms, causing data inconsistencies. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills erichowens/document-generation-pdf

View the source on GitHub

Browse the @skills marketplace