Skip to content
Skill

pdfkit-generation

by agnt-gg

AI Summary

name: "PDFKit Generation" description: "Generate professional PDFs with PDFKit in Node.js. Use when creating pitch decks, reports, or styled documents with AGNT branding. Covers large script handling, Unicode-safe characters, and brand design patterns." category: "document-processing"

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "pdfkit-generation" skill in my project.

Please run this command in my terminal:
# Install skill into your project
mkdir -p .claude/skills/pdfkit-generation && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/pdfkit-generation/SKILL.md "https://raw.githubusercontent.com/agnt-gg/agnt/main/backend/skills/pdfkit-generation/SKILL.md"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Generate professional PDFs with PDFKit in Node.js. Use when creating pitch decks, reports, or styled documents with AGNT branding. Covers large script handling, Unicode-safe characters, and brand design patterns.

Description

Generate professional PDFs using PDFKit in a Node.js environment, with AGNT brand styling and proper handling of large scripts. This skill covers the critical workflow for bypassing command-line size limits, Unicode-safe character usage, and reusable design patterns.

When to Use

Use this skill when: • Creating pitch decks, reports, or styled PDF documents • Generating PDFs with AGNT brand colors and styling • Working with large PDF generation scripts that exceed CLI limits • You need Unicode-safe alternatives to emojis in PDFs • Building multi-page documents with consistent theming ---

The Problem

execute_javascript_code passes code via command line, which has ~8KB limit on Windows. Large PDF generation scripts (often 20KB+) will fail with: ` Error: spawn ENAMETOOLONG `

The Solution: 3-Step Pattern

` +-------------------------------------------------------------+ | 1. file_operations: WRITE compact script to .js/.cjs file | | 2. execute_shell_command: node filename.js | | 3. file_operations: VERIFY the PDF was created | +-------------------------------------------------------------+ ` Implementation: `javascript // Step 1: Generate self-contained script const script = ` const PDFDocument = require('pdfkit'); const fs = require('fs'); const path = require('path'); const outputPath = path.join(process.cwd(), 'output.pdf'); const doc = new PDFDocument({ size: 'letter', margin: 0 }); const stream = fs.createWriteStream(outputPath); doc.pipe(stream); // ... ALL PDF generation code ... doc.end(); stream.on('finish', () => console.log('Done')); `; // Step 2: Write to file file_operations({ operation: "write", path: "generate.cjs", content: script }); // Step 3: Execute via shell execute_shell_command({ command: "node generate.cjs" }); // Step 4: Verify file_operations({ operation: "list", path: "." }); ` ---

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted Yesterday
Active
Adoption100+ stars on GitHub
183 ★ · Growing
DocsREADME + description
Well-documented

GitHub Signals

Stars183
Forks33
Issues4
UpdatedYesterday
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code