Slidev Retro Deck
Intent
- Goal: A 16:9 Slidev deck with a retro console identity (scanlines, tube glow, terminal type, blinking cursor), every slide visually verified before the deck is declared done.
- Limits:
- Create each deck in its own directory (for example
.ai/slides/<deck-name>/), never inside a managed component tree. setup/mermaid.tsexports a plain function — no@slidev/typesimport.- No color literals in mermaid fences: accent nodes with
class <id> a|b|aux(styled by the setup'sthemeCSS), neverclassDef—var()fails to parse and hexes break the day/night switch. - One accent = one meaning, everywhere (text, borders, chips, stamps, diagram nodes).
- Respect each theme's heading type scale — pixel fonts (Silkscreen, Press Start 2P) are far wider than VT323 and overflow at CRT sizes.
- Presenter notes are a trailing
<!-- ... -->HTML comment inside the slide. Keep theprefers-reduced-motionguard on the blinking cursor.
- Create each deck in its own directory (for example
- Fails if: "done" is claimed without the full PNG inspection of every slide in the scheme(s) the deck will actually use, any mermaid block fails to parse, or any slide clips or overflows.
Context
- Reads: the resources below.
- Never reads: none.
- Persona: deck builder with a visual-QA discipline.
- Scope: requests for a slide deck or presentation, especially with Slidev or a retro/terminal/Matrix look. The workflow applies to any Slidev deck; the packaged identity is the retro console.
Expectations
- Scenarios: WHEN a deck is requested THEN run the workflow; WHEN a diagram overflows THEN apply the sizing playbook in order.
- Done means: the verification loop (workflow step 8) passed on a full export.
- Quality needs: legible slides, consistent accent mapping.
Method
Themes
Three packaged themes live under assets/themes/, each with a day (light console) and night (dark console) scheme selected per deck via headmatter colorSchema:
| Theme | Night | Day | Fonts (headings / body) |
|---|---|---|---|
crt-phosphor |
green/amber phosphor on black | phosphor ink on paper-green | VT323 / JetBrains Mono |
dos-terminal |
yellow/cyan on Borland blue | navy ink on ivory paper | Silkscreen / IBM Plex Mono |
synthwave-arcade |
magenta/cyan neon on deep purple | sunrise pastel arcade | Press Start 2P / Space Mono |
Workflow
- Scaffold — copy
assets/scaffold/package.jsonandassets/scaffold/pnpm-workspace.yamlinto the deck directory, then install with pnpm.playwright-chromium(needed byslidev export) only downloads because the workspace file allows its build script.npmmay be aliased to pnpm in some setups, so use explicit pnpm commands. Runnpx slidev slides.mdfor a hot-reloading dev server. - Headmatter — start from
assets/slides-skeleton.md. Non-obvious facts: the seriph theme maps thefonts: serifslot to headings, so the display font goes there (each theme's font pair is listed in the skeleton comments and the theme CSS header);sans/monocarry the body mono font;colorSchemapicks the scheme —dark= night console,light= day console,auto= system preference plus the UI toggle;background: nonelets the CSS gradient show through. - Design system — pick a theme from the table and copy its
style.cssto the deck root (Slidev auto-loads it). Every theme is token-based: day palette on:root, night overrides onhtml.dark, so both schemes come from the same file. Each defines two semantic accents--accent-a/--accent-b: map them per the Limits (.tx-a/.tx-b,.bd-a/.bd-b). - Stamps — every slide carries an absolutely positioned top-right badge naming its section/topic, placed right after the slide separator:
<div class="stamp stamp-a">topic</div>. Slides spanning both topics use.stamp-bothwith one span per accent. - Author credit — copy
assets/global-bottom.vueto the deck root; Slidev renders it on every slide, and the theme's.creditclass pins the handle small and dimmed at the bottom-left. Default handle is@andresnator; edit the copied file if the deck belongs to someone else. - Mermaid theming — copy the chosen theme's
mermaid-setup.tstosetup/mermaid.ts. No@slidev/typesimport: it is not a direct dependency, strict pnpm cannot resolve it, and the vite error renders on the first slide. Each setup carries a day and a night palette and picks one at diagram render time from Slidev's scheme class; a live scheme toggle does not re-render existing diagrams (reload), and exports are always consistent. Accent nodes per the Limits (class <id> a|b|aux); size diagrams per the playbook below. - Overflow discipline — mono fonts are wider and taller than proportional ones. Dense slides get per-slide frontmatter
class: text-sm; footers gettext-xs; watch the last table row and the final line of any box near the bottom edge. - Verification loop (mandatory):
- Parse every mermaid block with
assets/mermaid-check/check.mjs(install its deps from the siblingpackage.jsonin a scratch dir):node check.mjs <deck>/slides.md. - Export:
npx slidev export slides.md --format png --output slide-export --timeout 90000. - Visually inspect every PNG for clipping, overflow, and legibility; fix and re-export until clean.
--range Niterates faster but wipes the output directory — always finish with a full export.
- Parse every mermaid block with
Diagram sizing playbook
Apply in order; stop when the diagram fits as large as possible:
| Lever | How |
|---|---|
| Orientation | flowchart LR for pipelines; TD overflows 16:9 |
| Scale | fence option {scale: 0.4–0.6} — mono fonts need the lower end |
| Spacing | {scale: X, flowchart: {nodeSpacing: 35, rankSpacing: 36}} — fence options merge into mermaid.initialize |
| Label trim | shorten the widest node label; move the info to a caption under the diagram |
| Width | .mermaid in the theme's style.css reclaims the slide's side padding via negative margins |
| Composition | diagram-only slides get frontmatter class: diagram-center to center vertically |
Resources
assets/themes/<name>/style.css— day/night token-based theme (scanlines, glow, stamps, chips, diagram helpers).assets/themes/<name>/mermaid-setup.ts— matching day/night mermaid palettes forsetup/mermaid.ts.assets/slides-skeleton.md— headmatter plus cover, content, and diagram slide examples.assets/global-bottom.vue— per-slide bottom-left author credit (styled by each theme's.credit).assets/scaffold/—package.jsonandpnpm-workspace.yamltemplates.assets/mermaid-check/— parse validator for mermaid blocks.references/troubleshooting.md— symptom → cause → fix catalog from real failures.