deck-runtime
Skill0 starsChanged 5 days agoMITView on GitHub
The shared HTML deck shell for deck-svg and deck-image: the deck-stage element (slide navigation, P-key presenter console, print-to-PDF at one 1920×1080 slide per page). A ship-as-is runtime that the deck engines copy in when scaffolding; not authored against directly. Consult when a deck's navigation, presenter window, or print layout misbehaves or needs changing.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cite-checkSkill
- count-zhSkill
- deck-imageSkill
- deck-planSkill
- deck-svgSkill
- diagramSkill
- fix-termsSkill
- flow-checkSkill
- gpt-reviewSkill
- house-styleSkill
- safe-editSkill
- source-kitSkill
- topic-scoutSkill
- yt2subSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Keep deck-stage:not(:defined){visibility:hidden} in the CSS, so the first slide does not flash unstyled before the element upgrades.
- Very specific: line 63
Before next()/prev() (keyboard, click, tap, console) change the slide, the runtime dispatches a cancelable deckstep event (detail.direction …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
deck-runtime — the shared deck shell (runtime layer)
The middle layer of the deck model: the runtime that turns a page of
<section class="slide"> elements into a navigable, presentable, printable deck.
It is look-agnostic — it styles nothing of its own, driving everything off
CSS variables — so the theme (house-style) and the slide vocabulary (the engine)
layer on top without touching it.
look house-style font · tokens · content rules
runtime deck-runtime ← THIS — <deck-stage> nav · presenter · print
engine deck-svg, deck-image author slides onto the shellWhat's in the box (template/asset/)
| File | Role | Edit it? |
deck-stage.js | The <deck-stage> custom element: slide flight/nav, keyboard (→/Esc/digits/F), cancelable deckstep before a step, slidechange event, print CSS (@page 1920×1080, one slide per page), #debug self-check. | No — frozen. Treat as a dependency. |
presenter-stage.js | Dual-screen presenter console (P key): current/next preview and speaker notes in a popup that drives the deck window over postMessage; O (or the 全部投影片 button) opens a grid of every slide, so a far slide is one click away (arrows + Enter also pick one, Esc returns to the notes). With an extended desktop it puts the deck fullscreen on the external screen and the console on the built-in one (see below). Forwards +/=/- as {deckFontDirection: ±1} so the presenter can resize the deck's text, and c/g (Shift = reverse) as {deckThemeKey} so the theme can change from the console; an engine without a handler ignores the message. | No. |
This is the only home for these two files. deck-svg and deck-image copy them in; they are not duplicated per engine.
The contract an engine must honor
A deck the engines produce must satisfy what deck-stage.js expects:
- A single
<deck-stage width="1920" height="1080">wrapping the slides. Each direct child is one slide (<section>);<script>,<style>and<template>children are ignored. - Slides are hidden, not unmounted: inactive ones stay in the DOM with
visibility:hidden; opacity:0, and every slide is forced toposition:absolute; inset:0; overflow:hidden. Author each as a full-bleed 1920×1080 frame, because content past the edge is clipped without a scrollbar. data-label="…"on each slide names it in the presenter console and thumbnails (falling back to its firsth1–h3).- The active slide gets
data-deck-activeset by the runtime — entrance animations key off.slide[data-deck-active] .rise. - Speaker notes: a
<script type="application/json" id="speaker-notes">array, one string per slide, in slide order. The presenter console reads it;\ninside a string is a line break there. The engines generate it with./fw deck-notesfromspeaker-notes.mdrather than typing it, because typed notes pass no gate (deck-svg § Speaker notes). - Load order at end of
<body>:asset/deck-stage.jsthenasset/presenter-stage.js; an engine's own scripts go around them as its skill specifies. - Keep
deck-stage:not(:defined){visibility:hidden}in the CSS, so the first slide does not flash unstyled before the element upgrades. - The runtime emits
slidechangewithe.detail.index/previousIndex/total/slide/reason(used e.g. by the number-counter helper). - Before
next()/prev()(keyboard, click, tap, console) change the slide, the runtime dispatches a cancelabledeckstepevent (detail.direction±1,reason); an engine that callspreventDefault()keeps the slide, which is how deck-svg's optionaldeck-motion.jsplays one reveal step per press without the runtime knowing what a beat is. Jumps (goTo, digits, Home/End, R) do not ask. The console relays an engine'sdeckbeatevent (detail.beat,beats) as 第 n/m 拍 beside the page number and forwardsMas{deckMotionKey: true}; a deck without the engine ignores both. The engine also takesShift+←/Shift+→(play a beat backwards / replay it),[/](speed) andD(its scrubber) in the capture phase, so the runtime must not bind those keys.
What the runtime gives for free, so an engine writes none of it: ←/→,
PgUp/PgDn, Space, Home/End, R (reset), number keys, the hover overlay,
mobile tap zones, @media print at one 1920×1080 slide per page, and the
P presenter window. When the desktop spans two screens and the browser
is Chromium-based, P tries to place the windows, one per press: the first P
opens the console filling the built-in screen (an ordinary window, not
fullscreen, so the presenter can still switch apps there), the second P,
pressed on the deck, asks for fullscreen on the external screen (the
projector). If the console took focus, its P brings the deck forward and the
deck asks for P once more. The window-management permission is asked once per
page load. This placement does not reach the projector in Brave from
file:// (live test 2026-10-08): the browser keeps both windows on the
laptop, so the presenter drags the deck window to the projector and presses
F there; docs/DESIGN.md records the findings and the planned extension.
On macOS, "Displays have separate Spaces" (System Settings → Desktop & Dock)
must be on, or a fullscreen deck's Space blanks the laptop screen too. With one screen, mirroring, Safari or Firefox, or a refused permission, P opens the
plain popup as before; a desktop without a built-in screen keeps the console
on the screen the deck was on. Thumbnails and the slide grid render over
file:// too: each is a copy of the deck loaded at its slide. Chrome only
blocks the console from scripting those copies there, so a thumbnail that
changes slide reloads instead of switching in place. Decks are presented
from file://, so runtime features must work there (see docs/DESIGN.md).
Minimal skeleton (an engine's starter adds its look and checks):
<!DOCTYPE html><html lang="zh-Hant"><head><meta charset="UTF-8">
<style>deck-stage:not(:defined){visibility:hidden}</style></head><body>
<deck-stage width="1920" height="1080">
<section class="slide" data-label="標題">…</section>
</deck-stage>
<script type="application/json" id="speaker-notes">["第一張的備註…"]</script>
<script src="asset/deck-stage.js"></script>
<script src="asset/presenter-stage.js"></script>
</body></html>CSS variables the runtime/components rely on (defined by house-style tokens):
--font, --ink*, --text/--body/--muted, --accent, --chapter, --ease.
How an engine mounts the runtime (the convention)
Skills have no native import; the engine's scaffold step copies the shell in.
Sibling skills resolve as $SKILL_DIR/../deck-runtime/…:
RT="$SKILL_DIR/../deck-runtime/template/asset"
cp "$RT/deck-stage.js" "$RT/presenter-stage.js" <deck>/asset/Verify
node --check template/asset/deck-stage.jsand… presenter-stage.jspass.- A scaffolded deck opens from
file://and advances on click; the runtime's own check isdeck.html#debug(see deck-svg § Run & verify).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

