AgentSkillsCN

slidev

利用 Slidev 制作富有故事性的技术演示文稿。注重叙事流畅、文字精简、逐步揭示。适用于使用 Slidev、sli.dev、slides.md,或创建技术幻灯片时使用。

SKILL.md
--- frontmatter
name: slidev
description: Creates story-driven technical presentations using Slidev. Focuses on narrative flow, minimal text, and progressive disclosure. Use when working with Slidev, sli.dev, slides.md, or creating technical slide decks.
invocation: user
allowed-tools: Bash(slidev:*), Read

Slidev Presentations

Create and edit markdown-based presentations using Slidev syntax.

Before writing slides: Read references/style-and-tone.md for storytelling principles and presentation philosophy.

When to Use

  • Creating new slide decks from topics/outlines
  • Editing existing slides.md files
  • Adding animations, code highlighting, or diagrams to presentations
  • User mentions "slidev", "sli.dev", or "presentation slides"
  • Creating story-driven presentations with clear narrative arcs

Quick Reference

CategoryFeaturesReference
CoreSlide separators, headmatter, frontmatter, notessyntax-basics.md
Layouts19 built-in layouts, two-cols, image layoutslayouts.md, slots.md
Animationsv-click, v-motion, transitions, ghost previewanimations.md
CodeHighlighting, Monaco editor, TwoSlashcode-highlighting.md
Code AdvancedMagic Move, code groups, Monaco diffmagic-move.md, code-groups.md, monaco-diff.md
DiagramsMermaid, PlantUMLmermaid.md, plantuml.md
MathLaTeX equations and notationlatex.md
ComponentsArrow, Link, Toc, Tweet, Youtube, Videocomponents.md
StylingUnoCSS, scoped CSS, themesstyling.md
Layout ToolsTransform, zoom, draggable, global layerstransform.md, zoom.md, draggable.md, global-layers.md
CanvasAspect ratio, dimensionscanvas-size.md
CompositionImporting slides, frontmatter merging, MDCimporting-slides.md, frontmatter-merging.md, mdc.md
ExportPDF, PPTX, PNG, static buildexporting.md
CLICommands, installation, project structurecli.md

Quick Start

New Presentation

  1. Follow references/project-bootstrap.md for project setup
  2. Create slides.md with headmatter (deck-wide config)
  3. Use --- with blank lines to separate slides
  4. Add layouts, animations, and code as needed

Edit Existing

  1. Read the existing slides.md
  2. Preserve headmatter and existing structure
  3. Make targeted edits

Core Syntax

Slide Separators

Use --- with blank lines before and after:

markdown
# Slide 1

Content here

---

# Slide 2

More content

Headmatter (First Block)

Deck-wide configuration at the very top:

yaml
---
theme: seriph
title: My Presentation
author: Your Name
transition: slide-left
fonts:
  sans: "Poppins"
  provider: "google"
---

Fonts Configuration

Configure custom fonts from Google Fonts in headmatter:

yaml
fonts:
  sans: "Poppins" # Body text font
  serif: "Robot Slab" # Serif font (optional)
  mono: "Fira Code" # Code font (optional)
  provider: "google" # Load from Google Fonts

Preferred font: Poppins - Use the Poppins font family as the default sans-serif font for presentations.

Per-Slide Frontmatter

Configure individual slides:

yaml
---
layout: center
background: /image.png
class: text-white
---

Speaker Notes

Add as HTML comments at end of slide:

markdown
# My Slide

Content here

<!--
Speaker notes go here.
Supports **markdown**.
-->

Layouts Quick Reference

LayoutUse ForKey Props
defaultGeneral content-
centerCentered content-
coverTitle/first slide-
endFinal slide-
two-colsSide-by-sideUse ::right::
two-cols-headerHeader + two colsUse ::left:: ::right::
image-rightImage right, text leftimage: /path.png
image-leftImage left, text rightimage: /path.png
sectionSection divider-
quoteQuotations-
factStatistics/key data-
statementBold statements-

See layouts.md for all 19 layouts with examples.

Two-Column Example

markdown
---
layout: two-cols
---

# Left Side

Content on left

::right::

# Right Side

Content on right

Image Layout Example

markdown
---
layout: image-right
image: /diagram.png
---

# Title

Explanation on the left

Animations

v-click (Reveal on Click)

html
<v-click>Appears on click</v-click>

<div v-click>Also works as directive</div>

<div v-click="3">Appears on 3rd click</div>

v-clicks (Animate List Items)

html
<v-clicks>

- Item 1
- Item 2
- Item 3

</v-clicks>

v-after (With Previous)

html
<div v-click>First</div>
<div v-after>Appears with First</div>

Hide on Click

html
<div v-click.hide>Visible initially, hides on click</div>

Click Ranges

html
<div v-click="[2, 4]">Visible from click 2 to 4</div>

Ghost Preview (Show Hidden as Faded)

Override default hiding to show upcoming content as faint preview. See animations.md for CSS.

Code Blocks

Basic Syntax Highlighting

markdown
```ts
const hello = "world";
```

Line Highlighting

markdown
```ts {2,3}
const a = 1;
const b = 2; // highlighted
const c = 3; // highlighted
```

Animated Line Highlighting

Use | to step through highlights on click:

markdown
```ts {2|3|4}
const a = 1;
const b = 2; // click 1
const c = 3; // click 2
const d = 4; // click 3
```

Magic Move (Animated Code Transitions)

Animate between code blocks:

markdown
````md magic-move
```ts
const count = 1
```
```ts
const count = ref(1)
```
````

See magic-move.md for full documentation.

Code Groups (Tabbed)

markdown
```bash [npm]
npm install slidev
```

```bash [yarn]
yarn add slidev
```

See code-groups.md for details.

Mermaid Diagrams

markdown
```mermaid
graph LR
    A[Start] --> B{Decision}
    B -->|Yes| C[Action]
    B -->|No| D[Other]
```

With configuration:

markdown
```mermaid {theme: 'neutral', scale: 0.8}
sequenceDiagram
    Alice->>Bob: Hello
    Bob-->>Alice: Hi
```

Supported types: graph, sequenceDiagram, classDiagram, stateDiagram-v2, erDiagram, gantt, pie, gitGraph

See mermaid.md and plantuml.md for more diagram options.

User Comments

Users may leave inline comments in slides for you to address later. The format is:

markdown
[comment content]::

Examples:

  • [fix this]:: - Generic fix needed
  • [needs screenshot]:: - Add an image here
  • [split into two slides]:: - Restructure this content

Workflow:

  1. When you encounter comments, extract ALL to a list first
  2. Address each comment systematically
  3. Remove the comment marker after addressing

Common Mistakes

MistakeFix
Missing blank lines around ---Add blank line before AND after separator
Using v-if for animationsUse v-click, not Vue's v-if
Wrong slot syntaxUse ::right:: not #right or slot="right"
Frontmatter not at topFirst --- block must be headmatter
Code highlight without bracesUse ```ts {2,3} not ```ts 2,3
Trailing content visible during v-clicksWrap content after <v-clicks> lists in <v-click>

CLI Commands

CommandPurpose
slidevStart dev server
slidev --openStart and open browser
slidev exportExport to PDF
slidev export --with-clicksPDF with click steps as pages
slidev buildBuild static SPA

See cli.md for all commands and exporting.md for export options.

References

Setup & Philosophy

Core Features

Code Features

Diagrams & Math

Layout & Positioning

Advanced Composition

Styling & Export

External