--- name: html-slides metadata: version: "0.9.4" author: danzhu description: Generate polished single-file HTML slide presentations with interactive components (flip cards, charts, tables, code blocks, architecture flows, stats, timelines, and more) or creative visual themes. Use this skill whenever the user wants to create slides, presentations, decks, or any visual slide-based content as HTML. Also trigger when the user invokes /html-slides or mentions creating an HTML presentation, pitch deck, or slide deck. --- # Frontend Slides Create zero-dependency, animation-rich HTML presentations that run entirely in the browser. ## Agent Compatibility This skill is optimized for **Claude Code** and uses `AskUserQuestion` for interactive prompts. If `AskUserQuestion` is not available (Gemini CLI, GitHub Copilot, OpenAI Codex, or other agents), ask the same questions as plain text in the conversation and wait for the user to respond before proceeding. ## Core Principles 1. **Zero Dependencies** — Single HTML files with inline CSS/JS. No npm, no build tools. 2. **Show, Don't Tell** — Generate visual previews, not abstract choices. People discover what they want by seeing it. 3. **Distinctive Design** — No generic "AI slop." Every presentation must feel custom-crafted. 4. **Content-Driven Design** — The content decides the visual treatment. Design each slide based on what it's communicating, not by cycling through a component catalog. 5. **Viewport Fitting (NON-NEGOTIABLE)** — Every slide MUST fit exactly within 100vh. No scrolling within slides, ever. Content overflows? Split into multiple slides. ## Design Aesthetics You tend to converge toward generic, "on distribution" outputs. In frontend design, this creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive frontends that surprise and delight. Focus on: - Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics. - Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw from IDE themes and cultural aesthetics for inspiration. - Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. - Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer CSS gradients, use geometric patterns, or add contextual effects that match the overall aesthetic. Avoid generic AI-generated aesthetics: - Overused font families (Inter, Roboto, Arial, system fonts) - Cliched color schemes (particularly purple gradients on white backgrounds) - Predictable layouts and component patterns - Cookie-cutter design that lacks context-specific character Interpret creatively and make unexpected choices that feel genuinely designed for the context. Vary between light and dark themes, different fonts, different aesthetics. You still tend to converge on common choices (Space Grotesk, for example) across generations. Avoid this: it is critical that you think outside the box! ## Viewport Fitting Rules These invariants apply to EVERY slide in EVERY presentation: - Every `.slide` must have `height: 100vh; height: 100dvh; overflow: hidden;` - ALL font sizes and spacing must use `clamp(min, preferred, max)` — never fixed px/rem - Content containers need `max-height` constraints - Images: `max-height: min(50vh, 400px)` - Breakpoints required for heights: 700px, 600px, 500px - Include `prefers-reduced-motion` support - Never negate CSS functions directly (`-clamp()`, `-min()`, `-max()` are silently ignored) — use `calc(-1 * clamp(...))` instead **When generating, read `viewport-base.css` and include its full contents in every presentation.** ### Content Density Limits Per Slide | Slide Type | Maximum Content | |------------|-----------------| | Title slide | 1 heading + 1 subtitle + optional tagline | | Content slide | 1 heading + 4-6 bullet points OR 1 heading + 2 paragraphs | | Feature grid | 1 heading + 6 cards maximum (2x3 or 3x2) | | Code slide | 1 heading + 8-10 lines of code | | Quote slide | 1 quote (max 3 lines) + attribution | | Image slide | 1 heading + 1 image (max 60vh height) | | Chart slide | 1 heading + 1 chart (max 50vh height) + optional subtitle | **Content exceeds limits? Split into multiple slides. Never cram, never scroll.** --- ## Phase 0: Detect Mode Determine what the user wants: - **Mode A: New Presentation** — Create from scratch. Go to Phase 1. - **Mode B: PPT Conversion** — Convert a .pptx file. Go to Phase 4. - **Mode C: Enhancement** — Improve an existing HTML presentation. Read it, understand it, enhance. **Follow Mode C modification rules below.** - **Mode D: HTML Conversion** — Convert any HTML file (reveal.js, Marp, Google Slides export, article, generic page) into HTMLSlides format. Go to Phase 5. ### Mode C: Modification Rules When modifying existing presentations, make **minimal changes** — only touch what the user asked about. **Editing slides:** - Read the existing HTML file first - Modify only the requested slide(s), keep everything else intact - If adding/removing slides, renumber all `data-slide` attributes sequentially from 0 - If changing a component type (e.g., code block → table), use the template from component-templates.md - Update the inline `` **Available Pro themes** (user specifies in prompt, default: Obsidian): | Theme | File | Vibe | |-------|------|------| | Obsidian (default) | `assets/themes/dark-interactive.css` | Dark background, blue/green/orange accents | | Excalidraw Light | `assets/themes/excalidraw.css` | Hand-drawn, white background, sketch borders | | Excalidraw Dark | `assets/themes/excalidraw-dark.css` | Hand-drawn, dark background, sketch borders | | Editorial Light | `assets/themes/editorial-light.css` | Luminous, editorial, tech-forward minimalism | | Binary Architect | `assets/themes/binary-architect.css` | Hacker-elite, sharp corners, neon on void-black | **Key requirements:** - Single self-contained HTML file, all CSS/JS inline - For Vibe mode: include the FULL contents of viewport-base.css in the `