name: paper-slide-deck
description: Generate professional slide deck images from academic papers and content. Creates comprehensive outlines with style instructions, auto-detects figures from PDFs, then generates individual slide images. Use when user asks to "create slides", "make a presentation", "generate deck", or "slide deck" for papers.
Paper Slide Deck Generator
Transform academic papers and content into professional slide deck images with automatic figure extraction.
Usage
/paper-slide-deck path/to/paper.pdf
/paper-slide-deck path/to/paper.pdf --style academic-paper
/paper-slide-deck path/to/content.md --style sketch-notes
/paper-slide-deck path/to/content.md --audience executives
/paper-slide-deck path/to/content.md --lang zh
/paper-slide-deck path/to/content.md --slides 10
/paper-slide-deck path/to/content.md --outline-only
/paper-slide-deck # Then paste content
Script Directory
Important: All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
SKILL_DIR
- Script path =
${SKILL_DIR}/scripts/<script-name>.ts
- Replace all
${SKILL_DIR} in this document with the actual path
Script Reference:
| Script |
Purpose |
scripts/generate-slides.py |
Generate AI slides via Gemini API (Python) |
scripts/merge-to-pptx.ts |
Merge slides into PowerPoint |
scripts/merge-to-pdf.ts |
Merge slides into PDF |
scripts/detect-figures.ts |
Auto-detect figures/tables in PDF |
scripts/extract-figure.ts |
Extract figure from PDF page (uses PyMuPDF fallback) |
scripts/apply-template.ts |
Apply figure container template |
Options
| Option |
Description |
--style <name> |
Visual style (see Style Gallery) |
--audience <type> |
Target audience: beginners, intermediate, experts, executives, general |
--lang <code> |
Output language (en, zh, ja, etc.) |
--slides <number> |
Target slide count |
--outline-only |
Generate outline only, skip image generation |
Style Gallery
| Style |
Description |
Best For |
academic-paper |
Clean professional, precise charts |
Conference talks, thesis defense |
blueprint (Default) |
Technical schematics, grid texture |
Architecture, system design |
chalkboard |
Black chalkboard, colorful chalk |
Education, tutorials, classroom |
notion |
SaaS dashboard, card-based layouts |
Product demos, SaaS, B2B |
bold-editorial |
Magazine cover, bold typography, dark |
Product launches, keynotes |
corporate |
Navy/gold, structured layouts |
Investor decks, proposals |
dark-atmospheric |
Cinematic dark mode, glowing accents |
Entertainment, gaming |
editorial-infographic |
Magazine explainers, flat illustrations |
Tech explainers, research |
fantasy-animation |
Ghibli/Disney style, hand-drawn |
Educational, storytelling |
intuition-machine |
Technical briefing, bilingual labels |
Technical docs, academic |
minimal |
Ultra-clean, maximum whitespace |
Executive briefings, premium |
pixel-art |
Retro 8-bit, chunky pixels |
Gaming, developer talks |
scientific |
Academic diagrams, precise labeling |
Biology, chemistry, medical |
sketch-notes |
Hand-drawn, warm & friendly |
Educational, tutorials |
vector-illustration |
Flat vector, retro & cute |
Creative, children's content |
vintage |
Aged-paper, historical styling |
Historical, heritage, biography |
watercolor |
Hand-painted textures, natural warmth |
Lifestyle, wellness, travel |
Auto Style Selection
| Content Signals |
Selected Style |
| paper, thesis, defense, conference, ieee, acm, icml, neurips, cvpr, acl, aaai, iclr |
academic-paper |
| tutorial, learn, education, guide, intro, beginner |
sketch-notes |
| classroom, teaching, school, chalkboard, blackboard |
chalkboard |
| architecture, system, data, analysis, technical |
blueprint |
| creative, children, kids, cute, illustration |
vector-illustration |
| briefing, bilingual, infographic, concept |
intuition-machine |
| executive, minimal, clean, simple, elegant |
minimal |
| saas, product, dashboard, metrics, productivity |
notion |
| investor, quarterly, business, corporate, proposal |
corporate |
| launch, marketing, keynote, bold, impact, magazine |
bold-editorial |
| entertainment, music, gaming, creative, atmospheric |
dark-atmospheric |
| explainer, journalism, science communication |
editorial-infographic |
| story, fantasy, animation, magical, whimsical |
fantasy-animation |
| gaming, retro, pixel, developer, nostalgia |
pixel-art |
| biology, chemistry, medical, pathway, scientific |
scientific |
| history, heritage, vintage, expedition, historical |
vintage |
| lifestyle, wellness, travel, artistic, natural |
watercolor |
| Default |
blueprint |
Layout Gallery
Optional layout hints for individual slides. Specify in outline's // LAYOUT section.
Slide-Specific Layouts
| Layout |
Description |
Best For |
title-hero |
Large centered title + subtitle |
Cover slides, section breaks |
quote-callout |
Featured quote with attribution |
Testimonials, key insights |
key-stat |
Single large number as focal point |
Impact statistics, metrics |
split-screen |
Half image, half text |
Feature highlights, comparisons |
icon-grid |
Grid of icons with labels |
Features, capabilities, benefits |
two-columns |
Content in balanced columns |
Paired information, dual points |
three-columns |
Content in three columns |
Triple comparisons, categories |
image-caption |
Full-bleed image + text overlay |
Visual storytelling, emotional |
agenda |
Numbered list with highlights |
Session overview, roadmap |
bullet-list |
Structured bullet points |
Simple content, lists |
Infographic-Derived Layouts
| Layout |
Description |
Best For |
linear-progression |
Sequential flow left-to-right |
Timelines, step-by-step |
binary-comparison |
Side-by-side A vs B |
Before/after, pros-cons |
comparison-matrix |
Multi-factor grid |
Feature comparisons |
hierarchical-layers |
Pyramid or stacked levels |
Priority, importance |
hub-spoke |
Central node with radiating items |
Concept maps, ecosystems |
bento-grid |
Varied-size tiles |
Overview, summary |
funnel |
Narrowing stages |
Conversion, filtering |
dashboard |
Metrics with charts/numbers |
KPIs, data display |
venn-diagram |
Overlapping circles |
Relationships, intersections |
circular-flow |
Continuous cycle |
Recurring processes |
winding-roadmap |
Curved path with milestones |
Journey, timeline |
tree-branching |
Parent-child hierarchy |
Org charts, taxonomies |
iceberg |
Visible vs hidden layers |
Surface vs depth |
bridge |
Gap with connection |
Problem-solution |
Academic-Specific Layouts
| Layout |
Description |
Best For |
paper-title |
Title, authors, affiliations, venue |
Conference paper cover |
outline-agenda |
Numbered section list with highlights |
Talk structure overview |
methods-diagram |
Central architecture/pipeline diagram |
Methods, system design |
results-chart |
Chart area + data annotations |
Quantitative results |
equation-focus |
Centered equation + variable definitions |
Mathematical derivations |
qualitative-grid |
2x2 or 3x2 image comparison grid |
Visual results, ablations |
references-list |
Numbered citation list |
Key references slide |
contributions |
Numbered contribution points |
Contributions summary |
Usage: Add Layout: <name> in slide's // LAYOUT section to guide visual composition.
Design Philosophy
This deck is designed for reading and sharing, not live presentation:
- Each slide must be self-explanatory without verbal commentary
- Structure content for logical flow when scrolling
- Include all necessary context within each slide
- Optimize for social media sharing and offline reading
File Management
Output Directory
Each session creates an independent directory named by content slug:
slide-deck/{topic-slug}/
├── source-{slug}.{ext} # Source files (text, images, etc.)
├── outline.md
├── outline-{style}.md # Style variant outlines
├── prompts/
│ └── 01-slide-cover.md, 02-slide-{slug}.md, ...
├── 01-slide-cover.png, 02-slide-{slug}.png, ...
├── {topic-slug}.pptx
└── {topic-slug}.pdf
Slug Generation:
- Extract main topic from content (2-4 words, kebab-case)
- Example: "Introduction to Machine Learning" →
intro-machine-learning
Conflict Resolution
If slide-deck/{topic-slug}/ already exists:
- Append timestamp:
{topic-slug}-YYYYMMDD-HHMMSS
- Example:
intro-ml exists → intro-ml-20260118-143052
Source Files
Copy all sources with naming source-{slug}.{ext}:
source-article.md (main text content)
source-diagram.png (image from conversation)
source-data.xlsx (additional file)
Multiple sources supported: text, images, files from conversation.
Workflow
Step 1: Analyze Content
- Save source content (if pasted, save as
source.md)
- Follow
references/analysis-framework.md for deep content analysis
- Determine style (use
--style or auto-select from signals)
- Detect languages (source vs. user preference)
- Plan slide count (
--slides or dynamic)
- For academic papers (PDF with figures): Run automatic figure detection:
npx -y bun ${SKILL_DIR}/scripts/detect-figures.ts --pdf source-paper.pdf --output figures.json
This outputs a JSON file with all detected figures/tables, their page numbers, and captions.
Step 2: Generate Outline Variants
- Generate 3 style variant outlines based on content analysis
- Follow
references/outline-template.md for structure
- Auto-populate IMAGE_SOURCE for academic papers:
- Read
figures.json from Step 1
- Map figures to slides using rules in
references/analysis-framework.md Section 8
- Automatically add
// IMAGE_SOURCE blocks to appropriate slides:
- Architecture/pipeline figures → Methods slides (
Source: extract)
- Results tables → Quantitative results slides (
Source: extract)
- Comparison images → Qualitative results slides (
Source: extract)
- Conceptual/simple diagrams → Leave for AI generation (
Source: generate or omit)
- Save as
outline-{style}.md for each variant
Step 3: User Confirmation
Single AskUserQuestion with all applicable options:
| Question |
When to Ask |
| Style variant |
Always (3 options + custom) |
| Language |
Only if source ≠ user language |
After selection:
- Copy selected
outline-{style}.md to outline.md
- Regenerate in different language if requested
- User may edit
outline.md for fine-tuning
If --outline-only, stop here.
Step 4: Generate Prompts
- Read
references/base-prompt.md
- Combine with style instructions from outline
- Add slide-specific content
- If
Layout: specified in outline, include layout guidance in prompt:
- Reference layout characteristics for image composition
- Example:
Layout: hub-spoke → "Central concept in middle with related items radiating outward"
- Save to
prompts/ directory
Step 5: Image Generation Method Selection
Before generating images, ask user to choose generation method:
Use AskUserQuestion with options:
| Option |
Label |
Description |
| 1 |
Gemini API (Recommended) |
Official Google API via Python. Requires GOOGLE_API_KEY env var. |
| 2 |
Gemini Web (Browser-based) |
⚠️ Uses reverse-engineered web API. No API key needed but may break. |
Based on selection:
Option 1: Gemini API (Python)
- Verify API key: Check
GOOGLE_API_KEY or GEMINI_API_KEY environment variable
- Run generation script:
python ${SKILL_DIR}/scripts/generate-slides.py <slide-deck-dir> --model gemini-3-pro-image-preview
Script Features:
- Auto-installs
google-genai package if missing
- Retry logic with exponential backoff (3 retries)
- Skips already-generated slides (> 10KB)
- Supports custom model via
--model flag
- Outputs to
slides/ subdirectory
Troubleshooting:
- If server disconnection errors occur, script auto-retries
- For persistent failures, re-run the script (it skips completed slides)
- Check API quota if many failures occur
Option 2: Gemini Web Skill
Consent Check: Read consent file at:
- Windows:
$APPDATA/baoyu-skills/gemini-web/consent.json
- macOS:
~/Library/Application Support/baoyu-skills/gemini-web/consent.json
- Linux:
~/.local/share/baoyu-skills/gemini-web/consent.json
If no consent or version mismatch, display disclaimer and ask:
⚠️ DISCLAIMER: This uses a reverse-engineered Gemini Web API (NOT official).
Risks: May break anytime, no support, possible account risk.
For each slide, run:
npx -y bun ${GEMINI_WEB_SKILL_DIR}/scripts/main.ts \
--promptfiles prompts/01-slide-cover.md \
--image 01-slide-cover.png \
--sessionId slides-{topic-slug}-{timestamp}
Where GEMINI_WEB_SKILL_DIR = path to baoyu-danger-gemini-web skill directory.
Proxy support: If user is in restricted network, prepend:
HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890
Step 5.5: Process IMAGE_SOURCE (Automatic Figure Extraction)
For academic presentations, IMAGE_SOURCE metadata was auto-populated in Step 2 based on figure detection from Step 1.
Automatic Execution:
Parse outline to identify slides with Source: extract
Create figures directory: mkdir -p figures
For each extract slide, automatically:
- Read the Figure number, Page, and Caption from metadata
- Run figure extraction script:
npx -y bun ${SKILL_DIR}/scripts/extract-figure.ts \
--pdf source-paper.pdf \
--page <page-number> \
--output figures/figure-<N>.png
- Run template application script:
npx -y bun ${SKILL_DIR}/scripts/apply-template.ts \
--figure figures/figure-<N>.png \
--title "<slide-headline>" \
--caption "Figure <N>: <caption-text>" \
--output <NN>-slide-<slug>.png
- Report: "Extracted: Figure N → slide NN"
For slides with Source: generate (or no IMAGE_SOURCE):
- Proceed to Step 6 for AI generation
Note: Source PDF must be saved as source-paper.pdf in output directory.
Troubleshooting:
- If figure detection missed a figure: manually add
// IMAGE_SOURCE block to outline
- If wrong figure mapped: edit the
Figure: and Page: values in outline
- If extraction fails: check PDF page number (1-indexed)
PyMuPDF Fallback for Page Extraction:
If extract-figure.ts fails with "Image or Canvas expected" error (common with complex PDFs), use PyMuPDF:
import fitz
doc = fitz.open("source-paper.pdf")
page = doc[page_num - 1] # 0-indexed
mat = fitz.Matrix(3, 3) # 3x scale for high resolution
pix = page.get_pixmap(matrix=mat)
pix.save(f"extracted/page-{page_num}.png")
Then apply template using apply-template.ts.
Step 6: Generate Images
- Use selected method from Step 5
- Skip slides already processed in Step 5.5 (those with
Source: extract)
- Generate session ID:
slides-{topic-slug}-{timestamp}
- Generate each remaining slide with same session ID
- Report progress: "Generated X/N"
- Auto-retry once on generation failure
Step 7: Merge to PPTX and PDF
npx -y bun ${SKILL_DIR}/scripts/merge-to-pptx.ts <slide-deck-dir>
npx -y bun ${SKILL_DIR}/scripts/merge-to-pdf.ts <slide-deck-dir>
Step 8: Output Summary
Slide Deck Complete!
Topic: [topic]
Style: [style name]
Location: [directory path]
Slides: N total
- 01-slide-cover.png ✓ Cover
- 02-slide-intro.png ✓ Content
- ...
- {NN}-slide-back-cover.png ✓ Back Cover
Outline: outline.md
PPTX: {topic-slug}.pptx
PDF: {topic-slug}.pdf
Slide Modification
See references/modification-guide.md for:
- Edit single slide workflow
- Add new slide (with renumbering)
- Delete slide (with renumbering)
- File naming conventions
Image Generation Dependencies
Gemini API (Option 1 - Recommended)
Requires:
GOOGLE_API_KEY or GEMINI_API_KEY environment variable
- Python 3.8+ with pip
google-genai package (auto-installed by script)
Model: gemini-3-pro-image-preview (default)
Gemini Web Skill (Option 2)
Requires:
baoyu-danger-gemini-web skill installed at .claude/skills/baoyu-danger-gemini-web
- Google Chrome browser with logged-in Google account
- User consent for reverse-engineered API disclaimer
PDF Figure Extraction
Requires:
- Primary:
pdfjs-dist npm package (use legacy build for Node.js)
- Fallback:
pymupdf Python package (more reliable for complex PDFs)
canvas npm package for apply-template.ts
References
| File |
Content |
references/analysis-framework.md |
Deep content analysis for presentations |
references/outline-template.md |
Outline structure and STYLE_INSTRUCTIONS format |
references/modification-guide.md |
Edit, add, delete slide workflows |
references/content-rules.md |
Content and style guidelines |
references/base-prompt.md |
Base prompt for image generation |
references/figure-container-template.md |
Visual specs for extracted figure containers |
references/styles/<style>.md |
Full style specifications |
Notes
Image Generation
- Nano Banana Pro API: Recommended. Stable, reliable, requires API key
- Gemini Web: No API key needed, but uses reverse-engineered API with account risk
- Generation time: 10-30 seconds per slide
- Auto-retry once on generation failure
- Maintain style consistency via session ID
Content Guidelines
- Use stylized alternatives for sensitive public figures
- Both methods use the same underlying Gemini model for image generation
Extension Support
Custom styles and configurations via EXTEND.md.
Check paths (priority order):
.paper-skills/paper-slide-deck/EXTEND.md (project)
~/.paper-skills/paper-slide-deck/EXTEND.md (user)
If found, load before Step 1. Extension content overrides defaults.
1---2name: paper-slide-deck3description: <!--4---5<!--6 ╔══════════════════════════════════════════════════════════════╗7 ║ 本文件为开源 Skill 原始文档,收录仅供学习与研究参考 ║8 ║ CoPaper.AI 收集整理 | https://copaper.ai ║9 ╚══════════════════════════════════════════════════════════════╝1011 来源仓库: https://github.com/luwill/research-skills12 项目名称: research-skills13 开源协议: MIT License14 收录日期: 2026-04-021516 声明: 本文件版权归原作者所有。此处收录旨在为社会科学实证研究者17 提供 AI Agent Skills 的集中参考。如有侵权,请联系删除。18-->1920---21name: paper-slide-deck22description: Generate professional slide deck images from academic papers and content. Creates comprehensive outlines with style instructions, auto-detects figures from PDFs, then generates individual slide images. Use when user asks to "create slides", "make a presentation", "generate deck", or "slide deck" for papers.23---2425# Paper Slide Deck Generator2627Transform academic papers and content into professional slide deck images with automatic figure extraction.2829## Usage3031```bash32/paper-slide-deck path/to/paper.pdf33/paper-slide-deck path/to/paper.pdf --style academic-paper34/paper-slide-deck path/to/content.md --style sketch-notes35/paper-slide-deck path/to/content.md --audience executives36/paper-slide-deck path/to/content.md --lang zh37/paper-slide-deck path/to/content.md --slides 1038/paper-slide-deck path/to/content.md --outline-only39/paper-slide-deck # Then paste content40```4142## Script Directory4344**Important**: All scripts are located in the `scripts/` subdirectory of this skill.4546**Agent Execution Instructions**:471. Determine this SKILL.md file's directory path as `SKILL_DIR`482. Script path = `${SKILL_DIR}/scripts/<script-name>.ts`493. Replace all `${SKILL_DIR}` in this document with the actual path5051**Script Reference**:52| Script | Purpose |53|--------|---------|54| `scripts/generate-slides.py` | Generate AI slides via Gemini API (Python) |55| `scripts/merge-to-pptx.ts` | Merge slides into PowerPoint |56| `scripts/merge-to-pdf.ts` | Merge slides into PDF |57| `scripts/detect-figures.ts` | Auto-detect figures/tables in PDF |58| `scripts/extract-figure.ts` | Extract figure from PDF page (uses PyMuPDF fallback) |59| `scripts/apply-template.ts` | Apply figure container template |6061## Options6263| Option | Description |64|--------|-------------|65| `--style <name>` | Visual style (see Style Gallery) |66| `--audience <type>` | Target audience: beginners, intermediate, experts, executives, general |67| `--lang <code>` | Output language (en, zh, ja, etc.) |68| `--slides <number>` | Target slide count |69| `--outline-only` | Generate outline only, skip image generation |7071## Style Gallery7273| Style | Description | Best For |74|-------|-------------|----------|75| `academic-paper` | Clean professional, precise charts | Conference talks, thesis defense |76| `blueprint` (Default) | Technical schematics, grid texture | Architecture, system design |77| `chalkboard` | Black chalkboard, colorful chalk | Education, tutorials, classroom |78| `notion` | SaaS dashboard, card-based layouts | Product demos, SaaS, B2B |79| `bold-editorial` | Magazine cover, bold typography, dark | Product launches, keynotes |80| `corporate` | Navy/gold, structured layouts | Investor decks, proposals |81| `dark-atmospheric` | Cinematic dark mode, glowing accents | Entertainment, gaming |82| `editorial-infographic` | Magazine explainers, flat illustrations | Tech explainers, research |83| `fantasy-animation` | Ghibli/Disney style, hand-drawn | Educational, storytelling |84| `intuition-machine` | Technical briefing, bilingual labels | Technical docs, academic |85| `minimal` | Ultra-clean, maximum whitespace | Executive briefings, premium |86| `pixel-art` | Retro 8-bit, chunky pixels | Gaming, developer talks |87| `scientific` | Academic diagrams, precise labeling | Biology, chemistry, medical |88| `sketch-notes` | Hand-drawn, warm & friendly | Educational, tutorials |89| `vector-illustration` | Flat vector, retro & cute | Creative, children's content |90| `vintage` | Aged-paper, historical styling | Historical, heritage, biography |91| `watercolor` | Hand-painted textures, natural warmth | Lifestyle, wellness, travel |9293## Auto Style Selection9495| Content Signals | Selected Style |96|-----------------|----------------|97| paper, thesis, defense, conference, ieee, acm, icml, neurips, cvpr, acl, aaai, iclr | `academic-paper` |98| tutorial, learn, education, guide, intro, beginner | `sketch-notes` |99| classroom, teaching, school, chalkboard, blackboard | `chalkboard` |100| architecture, system, data, analysis, technical | `blueprint` |101| creative, children, kids, cute, illustration | `vector-illustration` |102| briefing, bilingual, infographic, concept | `intuition-machine` |103| executive, minimal, clean, simple, elegant | `minimal` |104| saas, product, dashboard, metrics, productivity | `notion` |105| investor, quarterly, business, corporate, proposal | `corporate` |106| launch, marketing, keynote, bold, impact, magazine | `bold-editorial` |107| entertainment, music, gaming, creative, atmospheric | `dark-atmospheric` |108| explainer, journalism, science communication | `editorial-infographic` |109| story, fantasy, animation, magical, whimsical | `fantasy-animation` |110| gaming, retro, pixel, developer, nostalgia | `pixel-art` |111| biology, chemistry, medical, pathway, scientific | `scientific` |112| history, heritage, vintage, expedition, historical | `vintage` |113| lifestyle, wellness, travel, artistic, natural | `watercolor` |114| Default | `blueprint` |115116## Layout Gallery117118Optional layout hints for individual slides. Specify in outline's `// LAYOUT` section.119120### Slide-Specific Layouts121122| Layout | Description | Best For |123|--------|-------------|----------|124| `title-hero` | Large centered title + subtitle | Cover slides, section breaks |125| `quote-callout` | Featured quote with attribution | Testimonials, key insights |126| `key-stat` | Single large number as focal point | Impact statistics, metrics |127| `split-screen` | Half image, half text | Feature highlights, comparisons |128| `icon-grid` | Grid of icons with labels | Features, capabilities, benefits |129| `two-columns` | Content in balanced columns | Paired information, dual points |130| `three-columns` | Content in three columns | Triple comparisons, categories |131| `image-caption` | Full-bleed image + text overlay | Visual storytelling, emotional |132| `agenda` | Numbered list with highlights | Session overview, roadmap |133| `bullet-list` | Structured bullet points | Simple content, lists |134135### Infographic-Derived Layouts136137| Layout | Description | Best For |138|--------|-------------|----------|139| `linear-progression` | Sequential flow left-to-right | Timelines, step-by-step |140| `binary-comparison` | Side-by-side A vs B | Before/after, pros-cons |141| `comparison-matrix` | Multi-factor grid | Feature comparisons |142| `hierarchical-layers` | Pyramid or stacked levels | Priority, importance |143| `hub-spoke` | Central node with radiating items | Concept maps, ecosystems |144| `bento-grid` | Varied-size tiles | Overview, summary |145| `funnel` | Narrowing stages | Conversion, filtering |146| `dashboard` | Metrics with charts/numbers | KPIs, data display |147| `venn-diagram` | Overlapping circles | Relationships, intersections |148| `circular-flow` | Continuous cycle | Recurring processes |149| `winding-roadmap` | Curved path with milestones | Journey, timeline |150| `tree-branching` | Parent-child hierarchy | Org charts, taxonomies |151| `iceberg` | Visible vs hidden layers | Surface vs depth |152| `bridge` | Gap with connection | Problem-solution |153154### Academic-Specific Layouts155156| Layout | Description | Best For |157|--------|-------------|----------|158| `paper-title` | Title, authors, affiliations, venue | Conference paper cover |159| `outline-agenda` | Numbered section list with highlights | Talk structure overview |160| `methods-diagram` | Central architecture/pipeline diagram | Methods, system design |161| `results-chart` | Chart area + data annotations | Quantitative results |162| `equation-focus` | Centered equation + variable definitions | Mathematical derivations |163| `qualitative-grid` | 2x2 or 3x2 image comparison grid | Visual results, ablations |164| `references-list` | Numbered citation list | Key references slide |165| `contributions` | Numbered contribution points | Contributions summary |166167**Usage**: Add `Layout: <name>` in slide's `// LAYOUT` section to guide visual composition.168169## Design Philosophy170171This deck is designed for **reading and sharing**, not live presentation:172- Each slide must be **self-explanatory** without verbal commentary173- Structure content for **logical flow** when scrolling174- Include **all necessary context** within each slide175- Optimize for **social media sharing** and offline reading176177## File Management178179### Output Directory180181Each session creates an independent directory named by content slug:182183```184slide-deck/{topic-slug}/185├── source-{slug}.{ext} # Source files (text, images, etc.)186├── outline.md187├── outline-{style}.md # Style variant outlines188├── prompts/189│ └── 01-slide-cover.md, 02-slide-{slug}.md, ...190├── 01-slide-cover.png, 02-slide-{slug}.png, ...191├── {topic-slug}.pptx192└── {topic-slug}.pdf193```194195**Slug Generation**:1961. Extract main topic from content (2-4 words, kebab-case)1972. Example: "Introduction to Machine Learning" → `intro-machine-learning`198199### Conflict Resolution200201If `slide-deck/{topic-slug}/` already exists:202- Append timestamp: `{topic-slug}-YYYYMMDD-HHMMSS`203- Example: `intro-ml` exists → `intro-ml-20260118-143052`204205### Source Files206207Copy all sources with naming `source-{slug}.{ext}`:208- `source-article.md` (main text content)209- `source-diagram.png` (image from conversation)210- `source-data.xlsx` (additional file)211212Multiple sources supported: text, images, files from conversation.213214## Workflow215216### Step 1: Analyze Content2172181. Save source content (if pasted, save as `source.md`)2192. Follow `references/analysis-framework.md` for deep content analysis2203. Determine style (use `--style` or auto-select from signals)2214. Detect languages (source vs. user preference)2225. Plan slide count (`--slides` or dynamic)2236. **For academic papers (PDF with figures)**: Run automatic figure detection:224 ```bash225 npx -y bun ${SKILL_DIR}/scripts/detect-figures.ts --pdf source-paper.pdf --output figures.json226 ```227 This outputs a JSON file with all detected figures/tables, their page numbers, and captions.228229### Step 2: Generate Outline Variants2302311. Generate 3 style variant outlines based on content analysis2322. Follow `references/outline-template.md` for structure2333. **Auto-populate IMAGE_SOURCE** for academic papers:234 - Read `figures.json` from Step 1235 - Map figures to slides using rules in `references/analysis-framework.md` Section 8236 - Automatically add `// IMAGE_SOURCE` blocks to appropriate slides:237 - Architecture/pipeline figures → Methods slides (`Source: extract`)238 - Results tables → Quantitative results slides (`Source: extract`)239 - Comparison images → Qualitative results slides (`Source: extract`)240 - Conceptual/simple diagrams → Leave for AI generation (`Source: generate` or omit)2414. Save as `outline-{style}.md` for each variant242243### Step 3: User Confirmation244245**Single AskUserQuestion with all applicable options:**246247| Question | When to Ask |248|----------|-------------|249| Style variant | Always (3 options + custom) |250| Language | Only if source ≠ user language |251252After selection:253- Copy selected `outline-{style}.md` to `outline.md`254- Regenerate in different language if requested255- User may edit `outline.md` for fine-tuning256257If `--outline-only`, stop here.258259### Step 4: Generate Prompts2602611. Read `references/base-prompt.md`2622. Combine with style instructions from outline2633. Add slide-specific content2644. If `Layout:` specified in outline, include layout guidance in prompt:265 - Reference layout characteristics for image composition266 - Example: `Layout: hub-spoke` → "Central concept in middle with related items radiating outward"2675. Save to `prompts/` directory268269### Step 5: Image Generation Method Selection270271**Before generating images**, ask user to choose generation method:272273**Use AskUserQuestion** with options:274275| Option | Label | Description |276|--------|-------|-------------|277| 1 | **Gemini API (Recommended)** | Official Google API via Python. Requires GOOGLE_API_KEY env var. |278| 2 | **Gemini Web (Browser-based)** | ⚠️ Uses reverse-engineered web API. No API key needed but may break. |279280**Based on selection:**281282#### Option 1: Gemini API (Python)2832841. **Verify API key**: Check `GOOGLE_API_KEY` or `GEMINI_API_KEY` environment variable2852. **Run generation script**:286 ```bash287 python ${SKILL_DIR}/scripts/generate-slides.py <slide-deck-dir> --model gemini-3-pro-image-preview288 ```289290**Script Features**:291- Auto-installs `google-genai` package if missing292- Retry logic with exponential backoff (3 retries)293- Skips already-generated slides (> 10KB)294- Supports custom model via `--model` flag295- Outputs to `slides/` subdirectory296297**Troubleshooting**:298- If server disconnection errors occur, script auto-retries299- For persistent failures, re-run the script (it skips completed slides)300- Check API quota if many failures occur301302#### Option 2: Gemini Web Skill3033041. **Consent Check**: Read consent file at:305 - Windows: `$APPDATA/baoyu-skills/gemini-web/consent.json`306 - macOS: `~/Library/Application Support/baoyu-skills/gemini-web/consent.json`307 - Linux: `~/.local/share/baoyu-skills/gemini-web/consent.json`3083092. **If no consent or version mismatch**, display disclaimer and ask:310 ```311 ⚠️ DISCLAIMER: This uses a reverse-engineered Gemini Web API (NOT official).312 Risks: May break anytime, no support, possible account risk.313 ```3143153. **For each slide**, run:316 ```bash317 npx -y bun ${GEMINI_WEB_SKILL_DIR}/scripts/main.ts \318 --promptfiles prompts/01-slide-cover.md \319 --image 01-slide-cover.png \320 --sessionId slides-{topic-slug}-{timestamp}321 ```322323 Where `GEMINI_WEB_SKILL_DIR` = path to `baoyu-danger-gemini-web` skill directory.3243254. **Proxy support**: If user is in restricted network, prepend:326 ```bash327 HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890328 ```329330### Step 5.5: Process IMAGE_SOURCE (Automatic Figure Extraction)331332For academic presentations, IMAGE_SOURCE metadata was auto-populated in Step 2 based on figure detection from Step 1.333334**Automatic Execution**:3353361. **Parse outline** to identify slides with `Source: extract`3372. **Create figures directory**: `mkdir -p figures`3383. **For each extract slide**, automatically:339 - Read the Figure number, Page, and Caption from metadata340 - Run figure extraction script:341 ```bash342 npx -y bun ${SKILL_DIR}/scripts/extract-figure.ts \343 --pdf source-paper.pdf \344 --page <page-number> \345 --output figures/figure-<N>.png346 ```347 - Run template application script:348 ```bash349 npx -y bun ${SKILL_DIR}/scripts/apply-template.ts \350 --figure figures/figure-<N>.png \351 --title "<slide-headline>" \352 --caption "Figure <N>: <caption-text>" \353 --output <NN>-slide-<slug>.png354 ```355 - Report: "Extracted: Figure N → slide NN"3563574. **For slides with `Source: generate`** (or no IMAGE_SOURCE):358 - Proceed to Step 6 for AI generation359360**Note**: Source PDF must be saved as `source-paper.pdf` in output directory.361362**Troubleshooting**:363- If figure detection missed a figure: manually add `// IMAGE_SOURCE` block to outline364- If wrong figure mapped: edit the `Figure:` and `Page:` values in outline365- If extraction fails: check PDF page number (1-indexed)366367**PyMuPDF Fallback for Page Extraction**:368If `extract-figure.ts` fails with "Image or Canvas expected" error (common with complex PDFs), use PyMuPDF:369```python370import fitz371doc = fitz.open("source-paper.pdf")372page = doc[page_num - 1] # 0-indexed373mat = fitz.Matrix(3, 3) # 3x scale for high resolution374pix = page.get_pixmap(matrix=mat)375pix.save(f"extracted/page-{page_num}.png")376```377Then apply template using `apply-template.ts`.378379### Step 6: Generate Images3803811. Use selected method from Step 53822. **Skip slides already processed in Step 5.5** (those with `Source: extract`)3833. Generate session ID: `slides-{topic-slug}-{timestamp}`3844. Generate each remaining slide with same session ID3855. Report progress: "Generated X/N"3866. Auto-retry once on generation failure387388### Step 7: Merge to PPTX and PDF389390```bash391npx -y bun ${SKILL_DIR}/scripts/merge-to-pptx.ts <slide-deck-dir>392npx -y bun ${SKILL_DIR}/scripts/merge-to-pdf.ts <slide-deck-dir>393```394395### Step 8: Output Summary396397```398Slide Deck Complete!399400Topic: [topic]401Style: [style name]402Location: [directory path]403Slides: N total404405- 01-slide-cover.png ✓ Cover406- 02-slide-intro.png ✓ Content407- ...408- {NN}-slide-back-cover.png ✓ Back Cover409410Outline: outline.md411PPTX: {topic-slug}.pptx412PDF: {topic-slug}.pdf413```414415## Slide Modification416417See `references/modification-guide.md` for:418- Edit single slide workflow419- Add new slide (with renumbering)420- Delete slide (with renumbering)421- File naming conventions422423## Image Generation Dependencies424425### Gemini API (Option 1 - Recommended)426427Requires:428- `GOOGLE_API_KEY` or `GEMINI_API_KEY` environment variable429- Python 3.8+ with pip430- `google-genai` package (auto-installed by script)431432Model: `gemini-3-pro-image-preview` (default)433434### Gemini Web Skill (Option 2)435436Requires:437- `baoyu-danger-gemini-web` skill installed at `.claude/skills/baoyu-danger-gemini-web`438- Google Chrome browser with logged-in Google account439- User consent for reverse-engineered API disclaimer440441### PDF Figure Extraction442443Requires:444- **Primary**: `pdfjs-dist` npm package (use legacy build for Node.js)445- **Fallback**: `pymupdf` Python package (more reliable for complex PDFs)446- `canvas` npm package for apply-template.ts447448## References449450| File | Content |451|------|---------|452| `references/analysis-framework.md` | Deep content analysis for presentations |453| `references/outline-template.md` | Outline structure and STYLE_INSTRUCTIONS format |454| `references/modification-guide.md` | Edit, add, delete slide workflows |455| `references/content-rules.md` | Content and style guidelines |456| `references/base-prompt.md` | Base prompt for image generation |457| `references/figure-container-template.md` | Visual specs for extracted figure containers |458| `references/styles/<style>.md` | Full style specifications |459460## Notes461462### Image Generation463464- **Nano Banana Pro API**: Recommended. Stable, reliable, requires API key465- **Gemini Web**: No API key needed, but uses reverse-engineered API with account risk466- Generation time: 10-30 seconds per slide467- Auto-retry once on generation failure468- Maintain style consistency via session ID469470### Content Guidelines471472- Use stylized alternatives for sensitive public figures473- Both methods use the same underlying Gemini model for image generation474475## Extension Support476477Custom styles and configurations via EXTEND.md.478479**Check paths** (priority order):4801. `.paper-skills/paper-slide-deck/EXTEND.md` (project)4812. `~/.paper-skills/paper-slide-deck/EXTEND.md` (user)482483If found, load before Step 1. Extension content overrides defaults.