$npx -y skills add PlutoLei/paperbanana-skill --skill paperbanana-slide-deckUse when user wants to create a full slide deck or presentation using PaperBanana image generation, OR modify/regenerate an existing PaperBanana slide deck. Triggers on "make slides", "create presentation", "PPT", "slide deck", "regenerate slides", "update slides", "paperbanana s
| 1 | # PaperBanana Slide Deck |
| 2 | |
| 3 | End-to-end slide deck creation and modification. Supports two modes: creating new decks from scratch, and regenerating existing decks after prompt edits. |
| 4 | |
| 5 | **Pipeline:** Content → Style Selection → Outline → Prompts → Image Generation → PPTX Merge |
| 6 | |
| 7 | ## Mode Detection |
| 8 | |
| 9 | On invocation, determine the mode by checking the target directory: |
| 10 | |
| 11 | | Condition | Mode | Start Phase | |
| 12 | |-----------|------|-------------| |
| 13 | | Target dir missing OR no `outline.md` | **New** | Phase R (full RDIV) | |
| 14 | | Target dir has `outline.md` + `prompts/` | **Modify** | Phase I (generate + merge) | |
| 15 | |
| 16 | In Modify mode, the user has already edited prompts or outline externally. Skip directly to Phase I. |
| 17 | |
| 18 | ## Dependencies |
| 19 | |
| 20 | | Component | Role | Location | |
| 21 | |-----------|------|----------| |
| 22 | | `google-genai` SDK | Path B image generation | `pip install google-genai` | |
| 23 | | PaperBanana CLI | Path A image generation | `python -m paperbanana.cli slide-batch` | |
| 24 | | merge-to-pptx.ts | PPTX merge | `skills/paperbanana-slide-deck/scripts/merge-to-pptx.ts` (local) | |
| 25 | | Style libraries | Style presets (4 sources, 150+) | See R1 for discovery paths | |
| 26 | | Bun | Run merge script | `bun` | |
| 27 | |
| 28 | ## Phase R: Research (New Mode Only) |
| 29 | |
| 30 | Skip this phase entirely in Modify mode. |
| 31 | |
| 32 | **R1: Discover style libraries** — Scan all four sources and merge into a unified list. |
| 33 | |
| 34 | ```bash |
| 35 | # Source 0 (PRIMARY): Local extended library (123 styles from Fooocus/ComfyUI, structured) |
| 36 | LOCAL_STYLES="$(find ~/.claude/skills .claude/skills -maxdepth 1 -name 'paperbanana-slide-deck' -type d 2>/dev/null | head -1)/references/styles" |
| 37 | |
| 38 | # Source 1: baoyu-slide-deck styles (16 slide-optimized) |
| 39 | BAOYU_SLIDE=$(ls -td ~/.claude/plugins/cache/baoyu-skills/content-skills/*/skills/baoyu-slide-deck/references/styles 2>/dev/null | head -1) |
| 40 | |
| 41 | # Source 2: baoyu-infographic styles (20 visual-rich) |
| 42 | BAOYU_INFOG=$(ls -td ~/.claude/plugins/cache/baoyu-skills/content-skills/*/skills/baoyu-infographic/references/styles 2>/dev/null | head -1) |
| 43 | |
| 44 | # Source 3: theme-factory themes (10 color/typography presets) |
| 45 | THEME_FACTORY=$(ls -td ~/.claude/plugins/cache/anthropic-agent-skills/document-skills/*/skills/theme-factory/themes 2>/dev/null | head -1) |
| 46 | ``` |
| 47 | |
| 48 | Merge: Glob all four directories for `*.md`, deduplicate by filename (priority: baoyu-slide-deck > local > baoyu-infographic > theme-factory). Present the full unified list to user during R3. |
| 49 | |
| 50 | If none found: Use PaperBanana's 23 built-in presets. |
| 51 | |
| 52 | **R2: Analyze content** — Topic, audience, tone, recommended slide count. |
| 53 | |
| 54 | **R3: Style recommendation** — Recommend 2-3 styles based on content signals. See `references/style-guide.md` for the full style-to-content mapping table. |
| 55 | |
| 56 | **R4: Interactive selection** — Use AskUserQuestion for style, audience, and slide count. |
| 57 | |
| 58 | **R5: Save analysis** — Create `slide-deck/{topic-slug}/analysis.md`. |
| 59 | |
| 60 | ## Phase D: Design (New Mode Only) |
| 61 | |
| 62 | In Modify mode, the user handles prompt edits directly. |
| 63 | |
| 64 | **D1: Load style spec** — Read from baoyu styles or PaperBanana built-ins. |
| 65 | |
| 66 | **D2: Generate outline** — Create `outline.md` with slide structure. See `references/outline-format.md`. |
| 67 | |
| 68 | **D3: Optional outline review** — Ask user if they want to review before proceeding. |
| 69 | |
| 70 | **D4: Generate prompts** — For each slide, create `prompts/NN-slide-{slug}.md`. Each prompt file has the style instructions block, then `---`, then the slide-specific content and design requirements. |
| 71 | |
| 72 | ## Phase I: Implement (Both Modes) |
| 73 | |
| 74 | ### Step I1: Image Generation (Dual Path) |
| 75 | |
| 76 | **Path A — PaperBanana CLI (preferred, has critic quality review):** |
| 77 | |
| 78 | ```bash |
| 79 | cd <project_root> |
| 80 | python -m paperbanana.cli slide-batch \ |
| 81 | --prompts-dir "slide-deck/{topic-slug}/prompts" \ |
| 82 | --output-dir "slide-deck/{topic-slug}" \ |
| 83 | --resolution 4k \ |
| 84 | --iterations 2 |
| 85 | ``` |
| 86 | |
| 87 | **Auto-degrade trigger:** Switch to Path B if **any** slide (not just the first) hits one of these. Don't keep retrying Path A: |
| 88 | - `RetryError` / `ResourceExhausted` / HTTP 429 (rate-limited) |
| 89 | - `ServerError` (5xx) or non-429 `ClientError` (4xx) |
| 90 | - Critic takes longer than 3 minutes on any single slide |
| 91 | - User reports "一直 429" / persistent rate limits → degrade immediately, skip further Path A retries |
| 92 | |
| 93 | **Distinguish two 429 sources**: |
| 94 | |
| 95 | | Source | Symptom | Response | |
| 96 | |--------|---------|----------| |
| 97 | | Critic 429 (VLM rate limit) | Error inside critic loop, Path A specific | Auto-degrade to Path B (no critic → bypasses the issue) | |
| 98 | | Image-gen 429 (`gemini-3-pro-image-preview`) | Same error in Path B | Exponential backoff: |