К основному содержанию
скилл CX Codex

whitepaper — скилл для Claude Code: PDF из Markdown через pandoc и typst

Собирает вёрстанный PDF-whitepaper из Markdown-файла: титул, оглавление, шрифты. Пригодится, когда документ надо отдать в PDF, а не в .md.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add adobe/skills --skill whitepaper -a claude-code
Открыть на GitHub

Что делает whitepaper

Скилл берёт Markdown с YAML-фронтматтером и прогоняет его через pandoc с движком typst. Шаблон templates/whitepaper.typ задаёт титульную страницу, синюю линию у заголовков разделов и собственное оглавление — поэтому флаг --toc передавать не нужно, он задвоит содержание. Шрифты Source Sans 3 и Source Code Pro лежат в fonts/ рядом с шаблоном.

Перед первым запуском нужны pandoc и typst: агент проверяет их через command -v и ставит недостающие — через brew на macOS, через apt-get или архив с релизами typst на Linux. Без фронтматтера с полем title конвертация не начнётся: скилл спросит заголовок. Поле date подставится сегодняшним числом, если его нет.

Скилл работает без остановок на подтверждения: копирует шаблон в папку вывода, запускает pandoc и сразу после сборки удаляет временные файлы. В той же команде rm перечислен исходный .md — оригинал Markdown тоже пропадёт, так что держите копию в git. Из вывода остаётся только PDF.

Какие задачи решает

  • собрать PDF-whitepaper из готового Markdown
  • поставить титульную страницу и оглавление без ручной вёрстки
  • получить моноширинный шрифт в блоках кода внутри PDF
  • перевести технический документ в формат для отправки заказчику
  • задать автора, подзаголовок и дату через YAML-фронтматтер

Примеры запросов агенту

  • Собери PDF из whitepaper-source.md в docs/
  • Сделай из ARCHITECTURE.md аккуратный whitepaper с титулом и оглавлением
  • Сконвертируй security-overview.md в PDF, автора возьми из фронтматтера

Как установить whitepaper

1Через Skills CLI (Vercel)

npx skills add adobe/skills --skill whitepaper -a claude-code

2Вручную: положить файлы

~/.claude/skills/whitepaper/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/whitepaper/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о whitepaper

Как установить whitepaper в Claude Code?

Выполните npx skills add adobe/skills --skill whitepaper -a claude-code — файл скилла окажется в ~/.claude/skills/whitepaper/SKILL.md.

Что делает whitepaper?

Превращает Markdown в вёрстанный PDF: титул, оглавление, типографика по шаблону. Внутри работают pandoc и typst.

Что нужно для работы скилла?

Установленные pandoc и typst. Если их нет, скилл попробует поставить сам через brew или apt-get.

Исходный текст

SKILL.md · Apache-2.0
---
name: whitepaper
description: Creates professional PDF whitepapers from Markdown files. Use when the user wants to create a whitepaper, technical document, or PDF with professional formatting and typography.
license: Apache-2.0
allowed-tools: Read, Write, Edit, Bash
metadata:
  argument-hint: "[input.md] [output.pdf]"
  version: "1.0.0"
---

# Professional PDF Generator

This skill converts Markdown files into professionally typeset PDF whitepapers using pandoc and typst.

## Assets

The skill includes (located in the plugin's root directory):
- **Typst template**: `templates/whitepaper.typ`
- **Source Sans 3 fonts**: `fonts/` — variable fonts supporting all weights (open source from Google Fonts)
- **Source Code Pro fonts**: `fonts/` (Regular, Bold, Italic, Bold Italic) — used for code blocks and inline code

**Plugin Root:** The plugin root is determined dynamically (see Step 2.5 below)

### Typography Hierarchy

| Element | Weight | Style |
|---------|--------|-------|
| Headlines (H1) | Black (900) | Large, tight tracking |
| Section headlines (H2) | Bold (700) | Blue accent line |
| Subheads (H3, H4) | Bold (700) | Medium size |
| Body copy | Regular (400) | Justified, comfortable leading |
| Code | Source Code Pro | Monospace |

## CRITICAL: FULLY AUTOMATIC EXECUTION

**THIS SKILL RUNS COMPLETELY UNATTENDED. DO NOT:**
- Ask "Should I proceed?" before generating PDF
- Ask "Should I delete these files?" before cleanup
- Ask "Is this okay?" at any step
- Wait for user confirmation between steps
- Pause to show intermediate results
- Request permission for file operations

**REQUIRED BEHAVIOR:**
- Execute all steps sequentially without stopping
- Generate PDF immediately when invoked
- Delete ALL source files immediately after PDF is created
- Only communicate with user AFTER everything is complete
- Report final result: "PDF created: [path]"

**If you find yourself about to ask the user a question during PDF generation or cleanup, STOP and just execute the operation instead.**

## Usage

When the user asks to create a PDF, follow these steps:

### 1. Determine Input and Output

- Parse `$ARGUMENTS` for the input markdown file and optional output PDF path
- If no output path is given, use the same name as the input with a `.pdf` extension
- If no input is given, ask the user which markdown file to convert
- Check the file's YAML frontmatter (see "Frontmatter Reference" below). If `title` is missing, ask the user for a title before proceeding. If `date` is missing, default to today's date.

### 2. Install Dependencies (if missing)

Run for each missing tool — the script auto-detects the platform:

```bash
OS=$(uname -s)
# pandoc
command -v pandoc >/dev/null 2>&1 || {
  [ "$OS" = "Darwin" ] && brew install pandoc || sudo apt-get update && sudo apt-get install -y pandoc
}
# typst
command -v typst >/dev/null 2>&1 || {
  [ "$OS" = "Darwin" ] && brew install typst || {
    curl -fsSL https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz \
      | tar xJ --strip-components=1 -C /usr/local/bin/ typst-x86_64-unknown-linux-musl/typst
    chmod +x /usr/local/bin/typst
  }
}
```

### 2.5 Locate Plugin Root Directory

**CRITICAL: Determine the plugin root before copying assets.**

The plugin root contains `templates/` and `fonts/` directories. Use this single command:

```bash
PLUGIN_ROOT=$([ -d ".claude/plugins/project-management" ] && echo ".claude/plugins/project-management" || echo "$CLAUDE_PLUGIN_ROOT")
echo "Using plugin root: $PLUGIN_ROOT"
ls "$PLUGIN_ROOT/templates/whitepaper.typ" || echo "ERROR: Template not found!"
```

**Expected location:** `.claude/plugins/project-management`

### 3. Copy Template to Output Directory

Copy the typst template to the same directory as the output PDF:

```bash
PLUGIN_ROOT=$([ -d ".claude/plugins/project-management" ] && echo ".claude/plugins/project-management" || echo "$CLAUDE_PLUGIN_ROOT")
cp "$PLUGIN_ROOT/templates/whitepaper.typ" <output-directory>/whitepaper.typ
```

Replace `<output-directory>` with the directory where the PDF will be generated (e.g., `project-guides/`).

### 4. Run Pandoc

Execute the conversion with these exact flags. Run from the output directory so the template is found:

```bash
cd <output-directory> && \
PLUGIN_ROOT=$(if [ -d "../.claude/plugins/project-management" ]; then echo "../.claude/plugins/project-management"; elif [ -d ".claude/plugins/project-management" ]; then echo ".claude/plugins/project-management"; else echo "$CLAUDE_PLUGIN_ROOT"; fi) && \
TYPST_FONT_PATHS="$PLUGIN_ROOT/fonts" pandoc <input.md> \
  -o <output.pdf> \
  --pdf-engine=typst \
  -V template="whitepaper.typ" \
  -V mainfont="Source Sans 3" \
  -V fontsize=10pt \
  -V papersize=a4
```

**Example for `project-guides/ADMIN-GUIDE.md`:**
```bash
cd content && \
PLUGIN_ROOT=$([ -d "../.claude/plugins/project-management" ] && echo "../.claude/plugins/project-management" || echo "$CLAUDE_PLUGIN_ROOT") && \
TYPST_FONT_PATHS="$PLUGIN_ROOT/fonts" pandoc ADMIN-GUIDE.md -o ADMIN-GUIDE.pdf --pdf-engine=typst -V template="whitepaper.typ" -V mainfont="Source Sans 3" -V fontsize=10pt -V papersize=a4
```

Note: Do **not** pass `--toc` — the template generates its own table of contents page with proper styling.

### 5. Clean Up (MANDATORY - DO NOT SKIP)

**CRITICAL: You MUST execute cleanup immediately after PDF generation. Only PDF should remain.**

```bash
# Remove ALL intermediate files in one command
rm -f <output-directory>/whitepaper.typ <input.md> <input-without-extension>.plain.html <input-without-extension>.html
```

**Example cleanup for `project-guides/AUTHOR-GUIDE.md`:**
```bash
rm -f project-guides/whitepaper.typ project-guides/AUTHOR-GUIDE.md project-guides/AUTHOR-GUIDE.plain.html project-guides/AUTHOR-GUIDE.html
```

**After cleanup, only `project-guides/AUTHOR-GUIDE.pdf` should exist. No .md, .html, or .plain.html files.**

### 6. Report Result

```
"PDF created: [output.pdf]"
```

## Frontmatter Reference

The template reads pandoc YAML frontmatter from the markdown file to populate the title page and footer. The frontmatter block must be the very first thing in the file, delimited by `---` lines.

### Required Fields

| Field | Purpose | Example |
|-------|---------|---------|
| `title` | Cover page headline, PDF metadata | `"AEM Code Sync for Edge Delivery Services"` |

### Recommended Fields

| Field | Purpose | Example |
|-------|---------|---------|
| `subtitle` | Second line on cover, below the accent line | `"Technical Architecture and Security Documentation"` |
| `date` | Cover page and page footer | `"January 29, 2026"` |

### Optional Fields

| Field | Purpose | Example |
|-------|---------|---------|
| `author` | Author list on cover page | See structured example below |

### Minimal Example

```yaml
---
title: "AEM Code Sync for Edge Delivery Services"
subtitle: "Technical Architecture and Security Documentation"
date: "January 29, 2026"
---
```

### Full Example with Authors

```yaml
---
title: "AEM Code Sync for Edge Delivery Services"
subtitle: "Technical Architecture and Security Documentation"
date: "January 29, 2026"
author:
  - name: "Jane Smith"
    affiliation: "Edge Delivery Services"
  - name: "John Doe"
    affiliation: "Security Engineering"
---
```

### What the Template Renders

- **Title**: Large black-weight text on the cover
- **Subtitle**: Lighter text below the accent divider line
- **Date**: Shown on the cover and in the page footer
- **Authors**: Listed on the cover with optional affiliation

### Common Mistakes

- Putting the frontmatter after a heading or blank line (it must be the first thing in the file)
- Using unquoted strings that contain colons, e.g. `title: AEM: A Guide` -- wrap in quotes
- Adding pandoc variables like `fontsize` or `papersize` in the frontmatter -- pass those as `-V` flags to pandoc instead (the skill handles this automatically)

## Template Design

The template provides professional document formatting:
- **Professional typography** using Source Sans 3 (open source font from Google Fonts)
- **Blue accent color** (#0066cc) for section dividers and links
- **Clean header** with title/subtitle (no separator line)
- **Footer** with date and page numbering (hidden on title page)
- **Source Code Pro** for code blocks and inline code
- **Automatic table of contents** page
- **Title page** with accent divider line

### Template Features

| Feature | Description |
|---------|-------------|
| Title page | Clean design with title, subtitle, date, authors |
| Table of contents | Auto-generated on page 2 |
| H1 headings | Black weight, page break before |
| H2 headings | Bold with blue accent line |
| Code blocks | Gray background, rounded corners |
| Blockquotes | Blue left border, light blue background |
| Tables | Light borders, bold header row |
| Links | Blue color (#0066cc) |

## Customizing the Document

The user can override pandoc variables with `-V key=value`:

| Variable | Default | Description |
|----------|---------|-------------|
| `papersize` | `a4` | Page size (`a4`, `us-letter`, etc.) |
| `fontsize` | `10pt` | Base font size |
| `template` | `whitepaper.typ` | Typst template file |
| `mainfont` | `Source Sans 3` | Main body font |

## Requirements

- `pandoc` and `typst` must be installed (the skill auto-installs them if missing)
  - **macOS**: via Homebrew (`brew`)
  - **Linux**: `pandoc` via `apt-get`, `typst` via GitHub release binary
- Source Sans 3 fonts are included in the plugin's `fonts/` directory

## Troubleshooting

If fonts are not found by typst, ensure the `TYPST_FONT_PATHS` environment variable is set correctly:

```bash
export TYPST_FONT_PATHS=${CLAUDE_PLUGIN_ROOT}/fonts
```

| Issue | Solution |
|-------|----------|
| Font not found | Check TYPST_FONT_PATHS points to plugin's fonts/ directory |
| Template not found | Ensure whitepaper.typ was copied to output directory |
| Tables not breaking | Template handles this automatically |
| Missing title page | Check frontmatter has `title` field |

© adobe · Apache-2.0 · adobe/skills

Похожие скиллы

Всё по теме «Тексты и документация» →
grill-with-docs Matt Pocock Скилл проводит жёсткое интервью по плану или дизайну и по ходу создаёт ADR и глоссарий. Подойдёт перед началом сложной разработки. 1 219 756установок skill-creator официальный anthropics Помогает создать новый скилл, доработать существующий и проверить результат через тестовые промпты и оценки. 414 180установок setup-matt-pocock-skills Matt Pocock Скилл настраивает репозиторий для инженерных скиллов Matt Pocock: задаёт трекер задач, метки триажа и расположение доменной документации. Запустите его перед первым использованием остальных скиллов. 1 052 851установок handoff Matt Pocock Собирает текущий диалог в документ передачи, чтобы другой агент продолжил работу с нужным контекстом. Нужен при смене сессии или исполнителя. 1 038 491установок triage Matt Pocock Скилл проводит issue и внешние PR через роли триажа, проверку и подготовку брифа для агента. Подойдёт мейнтейнеру, который разбирает очередь задач. 990 453установок domain-modeling Matt Pocock Скилл помогает уточнять термины проекта, вести GLOSSARY.md и фиксировать архитектурные решения в ADR. Нужен, когда модель предметной области меняется. 876 391установок

Из того же набора53

preview-import Запускает локальный сервер AEM CLI для проверки импортированного HTML в Edge Delivery Services. Сверяет вёрстку блоков со скриншотом оригинала и находит ошибки 404. CX Codex +1 1 600установок page-decomposition Вспомогательный скилл для пайплайна импорта страниц: разбирает одну секцию на смысловые последовательности и описывает их нейтрально, без имён блоков. CX Codex +1 1 600установок authoring-analysis Решает, что на странице обычный текст, а что блок, перед сборкой HTML для AEM Edge Delivery Services. Вызывается из пайплайна page-import. CX Codex +1 1 600установок find-test-content Находит страницы с нужным блоком в проектах AEM Edge Delivery Services для проверки вёрстки. Выводит адреса страниц, счётчик вхождений и найденные варианты блока. CX Codex +1 1 600установок identify-page-structure Разбирает скачанную страницу на секции и блоки контента для импорта в AEM Edge Delivery Services. Вызывается из пайплайна, вручную не запускается. CX Codex +1 1 600установок block-collection-and-party Находит готовые блоки, плагины и примеры кода для AEM Edge Delivery Services в репозиториях Block Collection и Block Party. Пригодится при старте разработки компонентов для EDS. CX Codex +1 1 600установок testing-blocks Прогоняет линтинг, браузерную проверку и юнит-тесты для изменений в блоках AEM Edge Delivery Services. Пригодится перед открытием пул-реквеста. CX Codex +1 1 600установок analyze-and-plan Скилл помогает составить требования, сценарии для проверки и Definition of Done перед разработкой блоков в AEM Edge Delivery Services. Пригодится до написания кода. CX Codex +1 1 600установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой