Slidev presentations

From nicepkg/ai-workflow · View interactive version

Slidev presentations is an AI agent skill from the GitHub repository nicepkg/ai-workflow. Creates Slidev markdown presentations for developers. Activates for: slides with code highlighting, technical talks, conference presentations, workshop materials, live coding decks, or markdown-based slides. Not for PowerPoint/Google Slides or non-presentation documents.

How to use this skill

Skill file

Slidev Presentations Skill

Generate professional, browser-based presentations using Slidev - the presentation framework for developers.

Official LLM Documentation

For complete API reference or advanced features, fetch the official LLM-optimized documentation:

https://sli.dev/llms-full.txt

When to Use This Skill

Activate when the user requests:

Example Trigger Phrases

These prompts should activate this skill:

NOT This Skill

Do NOT activate for:

Recommended Workflow

Follow the plan-first approach for quality presentations:

1. Gather Context  →  2. Create Plan  →  3. Review Plan  →  4. Generate Slides

Why Plan First?

Workflow Options

| Scenario | Command | Output |

| ----------------------------- | ----------------------------------------------- | ------------- |

| New presentation on a topic | /slidev:plan [topic] then /slidev:from-plan | Plan + Slides |

| Presentation about a codebase | /slidev:from-codebase [path] | Plan + Slides |

| Quick slides (skip planning) | /slidev:new [topic] | Slides only |

| Generate from existing plan | /slidev:from-plan [plan-file] | Slides only |

Plan Document Structure

A presentation plan includes:

Questions to Gather

When creating a plan, gather:

  1. Duration: Lightning (5-10 min) to deep dive (45-60 min)
  2. Audience: Peers, leadership, external, onboarding
  3. Format: Lecture, demo-heavy, workshop, Q&A-heavy
  4. Venue: Team meeting, conference, client presentation
  5. Focus Areas: Architecture, features, API, testing, DevOps
  6. Technical Depth: High-level, moderate, deep dive
  7. Core Message: What's the ONE thing to remember?
  8. Call to Action: What should audience DO after?

Example Outputs

See the assets/ directory for complete example presentations:

Reference Documentation

See the references/ directory for detailed documentation:

Quick Setup

If the user doesn't have Slidev installed, provide these commands:

# Create new presentation (recommended)
npm init slidev@latest

# Or with pnpm
pnpm create slidev

# Or add to existing project
npm install @slidev/cli @slidev/theme-default

Linting Configuration (Required)

Slidev's multi-frontmatter syntax conflicts with standard markdown linters. Always ensure a .markdownlint.json exists in the presentation directory before generating slides.

Why This Matters

Slidev uses --- separators with per-slide frontmatter:

---
layout: section
---

Standard markdownlint interprets layout: section + --- as a setext-style heading and "fixes" it to ## layout: section, corrupting the presentation.

Required Configuration

Create .markdownlint.json in the presentation directory:

{
  "MD003": false,
  "MD024": false,
  "MD025": false,
  "MD026": false,
  "MD033": false,
  "MD041": false
}

| Rule | Why Disabled |

| ----- | -------------------------------------------------------- |

| MD003 | Prevents setext→ATX conversion that corrupts frontmatter |

| MD024 | Slides often have repeated headings across slides |

| MD025 | Each slide can have its own H1 |

| MD026 | Slide titles may end with punctuation |

| MD033 | Slidev uses inline HTML for layouts and animations |

| MD041 | First line is YAML frontmatter, not a heading |

Automatic Setup

All /slidev:* commands should check for and create this config file before writing slides.md. If modifying an existing presentation, verify the config exists first.

Run the presentation:

# Development mode with hot reload
npx slidev

# Build for production
npx slidev build

# Export to PDF (requires playwright-chromium)
npx slidev export

# Export to PPTX
npx slidev export --format pptx

Output Format

Generate a complete slides.md file that can be run directly with Slidev.

Core Syntax (Quick Reference)

For full syntax details, see references/slidev-quick-reference.md.

Basic Structure

---
theme: default
title: My Presentation
transition: slide-left
mdc: true
---

# First Slide

Content here

---

# Second Slide

More content

Key Layouts

| Layout | Use Case |

| ----------------- | ------------------------- |

| cover | Title slide |

| center | Centered content |

| section | Section divider |

| two-cols | Side-by-side content |

| two-cols-header | Header + two columns |

| image-right | Image right, content left |

| fact | Highlight a statistic |

Two-Column Layout

---
layout: two-cols-header
---

# Header

::left::

Left content

::right::

Right content

Code with Line Highlighting

function add(a: number, b: number) {

const sum = a + b // highlighted

return sum // highlighted

}

Click-to-Reveal Code

const a = 1 // click 1

const b = 2 // click 2

const c = 3 // click 3

Animations

<!-- Reveal items one-by-one -->
<v-clicks>

- First item (click 1)
- Second item (click 2)

</v-clicks>

<!-- Single element reveal -->
<div v-click>Appears on click</div>

Presenter Notes

# Slide Title

Content

<!--
Speaker notes here (presenter mode only)
-->

Diagrams (Mermaid)

graph TD

A[Start] --> B{Decision}

B -->|Yes| C[Action]

B -->|No| D[End]

Advanced Features

For advanced functionality, see references/advanced-features.md:

Multi-File Organization

For large presentations (30+ slides), split across multiple files. See references/multi-file-organization.md.

Quick example:

---
src: ./slides/01-intro.md
---

---
src: ./slides/02-content.md
---

Benefits: No linting conflicts, easier reorganization, better version control.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.