---
name: analyst-pdf
description: Default PDF generator for this setup — produces high-design branded PDFs from any content (reports, decks, memos, analyses, pitches, diagnostics, one-pagers, briefs, audits, dossiers, research writeups, case studies). Black + hot-pink pentboyz/dem0nhub aesthetic with embedded custom fonts (Anton / Space Grotesk / Bebas Neue / JetBrains Mono), matplotlib SVG charts (radar, density, delta bars, heatmaps, donuts), metric tiles, keyword focus-highlighting, themeable. Powered by Jinja2 + headless Chromium. USE THIS WHENEVER THE USER ASKS FOR A PDF — "make a PDF", "turn this into a PDF", "export as PDF", "save as PDF", "PDF of this", "PDF report", "PDF version", "beat bible PDF", "pen bible PDF", "analyst deck", "branded report", "one-pager", "deck", "brief" — unless they specifically ask for plain/unstyled or a .docx/.pptx/.xlsx file. Has a `standard` template that accepts arbitrary section-based content and a `beat-bible` template for catalog audits. Add new templates for recurring report shapes.
---


# analyst-pdf

**The default PDF generator.** Whenever the user wants a PDF, reach for this skill — it renders branded, publication-grade output with embedded fonts, inline SVG charts, and the pentboyz · dem0nhub design language.

```
content  ─►  Jinja2 template  ─►  HTML + inline SVG  ─►  Chromium  ─►  PDF
```

## When to invoke

**Default to this skill for any PDF request.** Examples:
- "make this a PDF" / "export as PDF" / "save as PDF" / "PDF of this"
- "turn this into a PDF report" / "PDF version" / "render as a PDF"
- "one-pager" / "brief" / "memo" / "report" / "writeup" / "dossier" / "case study"
- "deck" / "analyst deck" / "beat bible" / "pen bible" / "pentboyz-style PDF"
- Drops structured data and wants a presentation-grade output

**Skip only when** the user explicitly asks for:
- Plain/unstyled markdown-to-PDF (use a vanilla converter)
- `.docx` → `anthropic-skills:docx`
- `.pptx` → `anthropic-skills:pptx`
- `.xlsx` → `anthropic-skills:xlsx`
- PDF manipulation (merge/split/OCR/extract) → `anthropic-skills:pdf`

## Quick start

### Standard template (any content)
For arbitrary reports — takes a section-based JSON schema (cover, stats, headings, paragraphs, bullets, tables, charts, callouts). This is the go-to for one-off PDFs.

```bash
python3 ~/.claude/skills/analyst-pdf/scripts/render.py \
  --data /path/to/content.json \
  --template standard \
  --out /path/to/output.pdf
```

Minimal `content.json`:
```json
{
  "title": "YOUR REPORT TITLE",
  "subtitle": "one-line framing",
  "kicker": "PROJECT · DATE",
  "sections": [
    {
      "heading": "§I · OVERVIEW",
      "lede": "A short lede paragraph explaining what this section covers.",
      "body": "Longer prose. Use [[keyword]] for pink accent, {{{focus-pos|+18%}}} for green, {{{focus-neg|-3.0}}} for red.",
      "bullets": ["First takeaway", "Second takeaway"],
      "stats": [
        {"label":"N SONGS","value":"743","sub":"/ 780"},
        {"label":"DELTA","value":"+4.7","sub":"vs baseline"}
      ]
    }
  ]
}
```

### Beat-bible template (catalog audits)
```bash
python3 ~/.claude/skills/analyst-pdf/scripts/render.py \
  --data /path/to/beat-data.json \
  --template beat-bible \
  --out /path/to/bible.pdf
```

### First-time setup
```bash
bash ~/.claude/skills/analyst-pdf/scripts/setup.sh
```
Installs: matplotlib, jinja2, playwright, pdfplumber. Runs `playwright install chromium`.

## Templates available
- **standard** — generic section-based report (headings, prose, bullets, stat tiles, callouts) — use for most PDFs
- **beat-bible** — sonic + producer + key/BPM cross-reference deck (6 pages)

Add new templates as `templates/<name>.html.j2` with a matching builder in `scripts/render.py::BUILDERS`.

## Theming
- Default theme: `pentboyz` (black + hot pink + leopard)
- Add themes: `themes/<name>.json` (color overrides) + optional `themes/<name>.css`
- Invoke with `--theme <name>`

## Focus keyword highlighting
Template copy supports inline markup that auto-wraps with accent styling:
- `[[keyword]]` → pink bold (`focus`)
- `{{{focus-pos|+18%}}}` → green positive
- `{{{focus-neg|-3.0}}}` → red negative
- `{{{focus-box|HEADLINE}}}` → boxed accent
- `{{{focus-underline|name}}}` → underline
- `{{{focus-warn|flag}}}` → warn-yellow

## Charts (`scripts/charts.py`)
- `delta_bar(rows)` — horizontal bars from zero, green pos / red neg
- `density_colored(buckets)` — histogram, N = height, Δ = color
- `radar(values, labels)` — polar radar with positive/negative fill
- `heatmap_symbolic(rows, cols, grid)` — cell grid with symbol overlay
- `donut_stat(pct, label, caption)` — single-stat donut

All return inline SVG — embedded directly in the HTML, zero external deps.

## Extending

To add a new template (e.g., `pen-bible`):
1. Create `templates/pen-bible.html.j2` (copy `standard.html.j2` or `beat-bible.html.j2`)
2. Add a builder in `scripts/render.py`: `def build_pen_bible(data, theme): ...`
3. Register: `BUILDERS["pen-bible"] = build_pen_bible`
4. Ship it.

## Dependencies
- Python 3.9+
- matplotlib (charts)
- jinja2 + markupsafe (templating)
- playwright + chromium (PDF rendering)
- Embedded fonts in `static/fonts/`: Space Grotesk, Anton, Bebas Neue, JetBrains Mono

## Output
Writes both `.html` and `.pdf` next to `--out`. HTML is portable, browser-openable, useful for iteration.
