ai-pdf-builder
Generate professional PDFs from Markdown using Pandoc and LaTeX with AI-powered content generation. Creates whitepapers, term sheets, memos, agreements, SAFEs, NDAs, and more.
What this skill does
# AI PDF Builder
Generate professional PDFs from Markdown with AI-powered content generation. Perfect for:
- Whitepapers & Litepapers
- Term Sheets
- SAFEs & NDAs
- Memos & Reports
- Legal Agreements
## What's New in v1.1.0
- **AI Content Generation** - Generate documents from prompts using Claude
- **`--company` Flag** - Inject company name directly via CLI
- **`enhance` Command** - Improve existing content with AI
- **`summarize` Command** - Generate executive summaries from documents
- **Content Sanitization** - Automatic cleanup of AI-generated content
## Requirements
**Option A: Local Generation (Free, Unlimited)**
```bash
# macOS
brew install pandoc
brew install --cask basictex
sudo tlmgr install collection-fontsrecommended fancyhdr titlesec enumitem xcolor booktabs longtable geometry hyperref graphicx setspace array multirow
# Linux
sudo apt-get install pandoc texlive-full
```
**Option B: Cloud API (Coming Soon)**
No install required. Get API key at ai-pdf-builder.com
**For AI Features:**
Set your Anthropic API key:
```bash
export ANTHROPIC_API_KEY="your-key-here"
```
## Usage
### Check System
```bash
npx ai-pdf-builder check
```
### Generate via CLI
```bash
# From markdown file
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf
# With company name
npx ai-pdf-builder generate whitepaper ./content.md -o output.pdf --company "Acme Corp"
# Document types: whitepaper, memo, agreement, termsheet, safe, nda, report, proposal
```
### AI Content Generation (New!)
```bash
# Generate a whitepaper from a prompt
npx ai-pdf-builder ai whitepaper "Write a whitepaper about decentralized identity" -o identity.pdf
# Generate with company branding
npx ai-pdf-builder ai whitepaper "AI in healthcare" -o healthcare.pdf --company "HealthTech Inc"
# Generate other document types
npx ai-pdf-builder ai termsheet "Series A for a fintech startup" -o termsheet.pdf
npx ai-pdf-builder ai memo "Q4 strategy update" -o memo.pdf --company "TechCorp"
```
### Enhance Existing Content (New!)
```bash
# Improve and expand existing markdown
npx ai-pdf-builder enhance ./draft.md -o enhanced.md
# Enhance and convert to PDF in one step
npx ai-pdf-builder enhance ./draft.md -o enhanced.pdf --pdf
```
### Summarize Documents (New!)
```bash
# Generate executive summary
npx ai-pdf-builder summarize ./long-document.md -o summary.md
# Summarize as PDF
npx ai-pdf-builder summarize ./report.pdf -o summary.pdf --pdf
```
### Generate via Code
```typescript
import { generateWhitepaper, generateTermsheet, generateSAFE, aiGenerate, enhance, summarize } from 'ai-pdf-builder';
// AI-Generated Whitepaper
const aiResult = await aiGenerate('whitepaper',
'Write about blockchain scalability solutions',
{ company: 'ScaleChain Labs' }
);
// Whitepaper from content
const result = await generateWhitepaper(
'# My Whitepaper\n\nContent here...',
{ title: 'Project Name', author: 'Your Name', version: 'v1.0', company: 'Acme Corp' }
);
if (result.success) {
fs.writeFileSync('whitepaper.pdf', result.buffer);
}
// Enhance existing content
const enhanced = await enhance(existingMarkdown);
// Summarize a document
const summary = await summarize(longDocument);
// Term Sheet with company
const termsheet = await generateTermsheet(
'# Series Seed Term Sheet\n\n## Investment Amount\n\n$500,000...',
{ title: 'Series Seed', subtitle: 'Your Company Inc.', company: 'Investor LLC' }
);
// SAFE
const safe = await generateSAFE(
'# Simple Agreement for Future Equity\n\n...',
{ title: 'SAFE Agreement', subtitle: 'Your Company Inc.' }
);
```
## Document Types
| Type | Function | Best For |
|------|----------|----------|
| `whitepaper` | `generateWhitepaper()` | Technical docs, litepapers |
| `memo` | `generateMemo()` | Executive summaries |
| `agreement` | `generateAgreement()` | Legal contracts |
| `termsheet` | `generateTermsheet()` | Investment terms |
| `safe` | `generateSAFE()` | SAFE agreements |
| `nda` | `generateNDA()` | Non-disclosure agreements |
| `report` | `generateReport()` | Business reports |
| `proposal` | `generateProposal()` | Business proposals |
## Custom Branding
```typescript
const result = await generateWhitepaper(content, metadata, {
customColors: {
primary: '#E85D04', // Signal Orange
secondary: '#14B8A6', // Coordinate Teal
accent: '#0D0D0D' // Frontier Dark
},
fontSize: 11,
margin: '1in',
paperSize: 'letter'
});
```
## Agent Instructions
When a user asks to generate a PDF:
1. Check what type of document they need (whitepaper, term sheet, memo, etc.)
2. Determine if they want AI generation or have existing content
3. Get the content - either from their message, a file, or use AI to generate
4. Ask for metadata if not provided (title, author, company name)
5. Use `--company` flag to inject company branding
6. Check if Pandoc is installed: `which pandoc`
7. If Pandoc missing, provide install instructions or suggest cloud API
8. Generate the PDF using the appropriate function
9. Send the PDF file to the user
**AI Commands Quick Reference:**
- `ai <type> "<prompt>"` - Generate new document from prompt
- `enhance <file>` - Improve existing content
- `summarize <file>` - Create executive summary
- `--company "Name"` - Add company branding to any command
## Links
- npm: https://www.npmjs.com/package/ai-pdf-builder
- GitHub: https://github.com/NextFrontierBuilds/ai-pdf-builder
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.