@slidevideo/cli 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -2
  3. package/addons/slidevideo/geometry.ts +63 -30
  4. package/addons/slidevideo/global-top.vue +41 -9
  5. package/addons/slidevideo/playback-entries.ts +16 -5
  6. package/addons/slidevideo/preview.ts +26 -14
  7. package/dist/adapters/powerpoint.d.ts +7 -4
  8. package/dist/adapters/powerpoint.js +146 -40
  9. package/dist/adapters/slidev-inspection.d.ts +5 -2
  10. package/dist/adapters/slidev-inspection.js +3 -2
  11. package/dist/adapters/slidev.d.ts +3 -4
  12. package/dist/adapters/slidev.js +20 -19
  13. package/dist/annotation-paint.d.ts +65 -11
  14. package/dist/annotation-paint.js +290 -10
  15. package/dist/annotations.d.ts +13 -8
  16. package/dist/annotations.js +619 -88
  17. package/dist/assembly.d.ts +4 -2
  18. package/dist/assembly.js +23 -18
  19. package/dist/cli.js +102 -16
  20. package/dist/compositor.d.ts +10 -5
  21. package/dist/compositor.js +215 -128
  22. package/dist/contracts.d.ts +93 -30
  23. package/dist/contracts.js +2 -1
  24. package/dist/media.d.ts +5 -0
  25. package/dist/media.js +30 -0
  26. package/dist/pipeline.d.ts +37 -9
  27. package/dist/pipeline.js +62 -10
  28. package/dist/preview/contracts.d.ts +3 -3
  29. package/dist/preview/player.js +20 -15
  30. package/dist/preview/server.d.ts +2 -1
  31. package/dist/preview/server.js +6 -5
  32. package/dist/setup.d.ts +3 -0
  33. package/dist/setup.js +16 -1
  34. package/dist/skill-install.d.ts +35 -0
  35. package/dist/skill-install.js +132 -0
  36. package/dist/storyboard.js +9 -0
  37. package/package.json +4 -1
  38. package/schemas/annotation-geometry.v1.json +260 -28
  39. package/schemas/run-manifest.v1.json +31 -0
  40. package/schemas/schedule.v1.json +448 -182
  41. package/schemas/storyboard.v1.json +358 -174
  42. package/skills/slidevideo/SKILL.md +11 -9
  43. package/skills/slidevideo/references/decks.md +228 -0
  44. package/skills/slidevideo/references/production.md +14 -10
  45. package/skills/slidevideo/references/storyboard.md +69 -37
  46. package/tools/powerpoint/Native.cs +85 -1
  47. package/tools/powerpoint/powerpoint.ps1 +188 -101
  48. package/tools/powerpoint/preview.ps1 +10 -9
@@ -1,15 +1,17 @@
1
1
  ---
2
2
  name: slidevideo
3
- description: Draft, explain, review and revise slidevideo.yaml storyboards for existing Slidev or PowerPoint presentations, then operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, image overlays, pauses, media, voice settings and production feedback. Creating or redesigning the input deck is outside this skill.
3
+ description: Draft, explain, review, and revise slidevideo.yaml storyboards for Slidev or PowerPoint presentations, create or adapt SlideVideo-compatible slides when requested, and operate the SlideVideo CLI to produce narrated videos. Use for narration, reveals, phrase cues, marker highlights, underlines, image overlays, pauses, media, voice settings, deck compatibility, and production feedback.
4
4
  ---
5
5
 
6
6
  # Author and produce a SlideVideo
7
7
 
8
- Own the storyboard and the workflow from an existing presentation to a narrated MP4. Treat `slidevideo.yaml` as the creator's editable production intent. The CLI generates speech, alignment, schedules, captures and assembly artifacts from that intent.
8
+ Own the storyboard and the workflow from a presentation to a narrated MP4. Treat `slidevideo.yaml` as the creator's editable production intent. The CLI generates speech, alignment, schedules, captures and assembly artifacts from that intent.
9
9
 
10
- Work in the folder containing the creator's presentation. The installed CLI supplies this skill and its references offline. Use `slidevideo skill --json` for the installed Markdown file's path and contents. Resolve relative links from that file.
10
+ Work in the folder containing the creator's presentation. The installed CLI supplies this skill and its references offline. Run `slidevideo skill --install` to link the skill into `~/.agents/skills/slidevideo`, plus `~/.claude/skills/slidevideo` when Claude Code is present, or add `--project` to link it in the current project. Use `slidevideo skill --json` for the installed Markdown file's path and contents, and resolve relative links from that file.
11
11
 
12
- Run `slidevideo skill storyboard` for the [storyboard reference](references/storyboard.md) when drafting or revising YAML. It covers timing, marker highlights, image overlays, voice options and presentation limits. The bundled [storyboard schema](../../schemas/storyboard.v1.json) defines the fields. Use `slidevideo validate` to check the draft against the actual deck.
12
+ Run `slidevideo skill storyboard` for the [storyboard reference](references/storyboard.md) when drafting or revising YAML. It covers timing, marker highlights, underline annotations, image overlays, voice options, and presentation limits. The bundled [storyboard schema](../../schemas/storyboard.v1.json) defines the fields. Use `slidevideo validate` to check the draft against the actual deck.
13
+
14
+ Run `slidevideo skill decks` for the [deck compatibility reference](references/decks.md) when creating, adapting, or troubleshooting `slides.md` or `.pptx` presentations.
13
15
 
14
16
  Run `slidevideo skill production` for the [production workflow](references/production.md) when setting up, recording or diagnosing a video. Start a new storyboard from the [minimal example](references/storyboard.md#minimal-authored-example) and use the actual slide names from the supplied presentation.
15
17
 
@@ -17,9 +19,9 @@ Run `slidevideo skill production` for the [production workflow](references/produ
17
19
 
18
20
  Read the supplied deck, existing storyboard, brief and supporting material. Identify the intended audience, narration language, tone, length and voice from the request. Ask only for missing information that affects a useful draft. Keep reasonable draft assumptions visible for review.
19
21
 
20
- Inspect actual slide targets, reveal steps, effect durations and embedded-media names using the existing adapter inspection or an available presentation reader. For Slidev, account for imports and the effective slide order. For PowerPoint, use native slide names or actual SlideID aliases and video Shape.Name values. Do not invent targets or claim unknown animation bounds are verified.
22
+ Inspect actual slide targets, reveal steps, effect durations, and embedded-media names with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json` when revising one. For Slidev, account for imports and the effective slide order. For PowerPoint, use native slide names or actual SlideID aliases, native click-group durations, and video `Shape.Name` values. Do not invent targets or claim unknown animation bounds are verified.
21
23
 
22
- Creating, redesigning or repairing the input `.md` or `.pptx` presentation is outside this skill. Preserve the supplied deck. If requested narration or actions need a deck change, explain the specific dependency and let the creator supply an updated deck or request separate deck-authoring work. Do not regenerate a supplied deck with an example authoring script.
24
+ Preserve an existing supplied `.md` or `.pptx` deck by default so storyboard work never rewrites the creator's slides unprompted. Create or edit slides when the creator asks to build a deck from notes, screenshots, or clips, requests slide changes, or approves adding stable `name` fields or element `id` attributes needed by requested storyboard actions or `annotations`. Follow the [deck compatibility reference](references/decks.md) when creating or editing slides, and never overwrite a supplied deck with an unrelated example script.
23
25
 
24
26
  ## Draft the storyboard
25
27
 
@@ -29,13 +31,13 @@ Write narration supported by the sources and appropriate for spoken delivery. Na
29
31
 
30
32
  Map the narrative to real slide and reveal targets. Choose sequential actions for ordered speech, holds and media. Choose phrase cues when a visual action should occur during speech. Account for native effect duration and complete media playback. Distinguish an estimated target length from the duration that actual synthesized speech will establish.
31
33
 
32
- Use stable IDs and paths relative to the storyboard. Include all required root fields, even when their lists are empty. Use Edge TTS for new drafts unless the creator chooses another provider. Preserve an existing, explicitly selected voice when revising that production.
34
+ Use stable IDs and paths relative to the storyboard. Include all required root fields, even when their lists are empty. Output dimensions and frame rate belong on the CLI with `--width`, `--height`, and `--fps`, defaulting to `1920` by `1080` at `30 fps`, not in `slidevideo.yaml`. Use Edge TTS for new drafts unless the creator chooses another provider. Preserve an existing, explicitly selected voice when revising that production.
33
35
 
34
36
  ## Review and revise with the creator
35
37
 
36
- For marker highlights, run `slidevideo inspect --storyboard <file> --json` to discover existing audience-slide selectors or native shape IDs. Inspect the deck and returned visibility/click information before choosing a target. Regions need no element metadata. Never invent an element ID, edit the deck to create a target, infer words inside an image or claim whole-shape bounds establish word geometry.
38
+ For marker highlights, run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard <file> --json` to discover existing audience-slide selectors or native shape IDs. Inspect the deck and returned visibility/click information before choosing a target. Regions need no element metadata. Never reference a nonexistent element ID in `slidevideo.yaml`, infer words inside an image, or claim whole-shape bounds establish word geometry. When a Slidev slide lacks a stable selector for a requested highlight and normalized regions are a poor fit, add a targeted `id` attribute only when slide creation or editing is part of the request or approved by the creator.
37
39
 
38
- Use the `annotations` array for highlights. The [marker example and target fields](references/storyboard.md#marker-highlights) cover Slidev and PowerPoint. Bind each highlight to an existing narration phrase and scene, with a positive duration inside one settled slide visit and reveal state. Choose normalized regions, Slidev element selectors or native PowerPoint shape IDs as appropriate. Color, opacity, normalized x/y padding, optional `blend` and optional `bottom_border` belong to `appearance`. Other effects and moving targets are unsupported.
40
+ Use the `annotations` array for `highlight` and `underline` effects. The [marker reference](references/storyboard.md#marker-highlights) and [underline reference](references/storyboard.md#underline-annotations) cover Slidev and PowerPoint. Bind each annotation to an existing narration phrase and scene, with a positive duration inside one settled slide visit and reveal state. Choose normalized regions, Slidev element selectors, or native PowerPoint shape IDs as appropriate. Keep highlight padding and optional `bottom_border` under `highlight`, and use `underline` for standalone solid or dashed strokes with normalized `width`, optional `offset` and `padding_x`, and optional `motion: { type: wipe }`. Moving targets and unimplemented effects are unsupported.
39
41
 
40
42
  Add, change or remove only the requested annotation and preserve unrelated annotations, narration, scene actions, media, IDs and settings. A new video after an annotation-only edit needs a new run and can reuse matching speech. Validate the draft through the real CLI. Required phrase alignment and actual target geometry are checked during resolution and capture. Highlights are composited into the final MP4, so ordinary deck playback and the raw recording remain unannotated.
41
43
 
@@ -0,0 +1,228 @@
1
+ # Deck compatibility and authoring
2
+
3
+ SlideVideo drives Slidev Markdown `.md` decks through Chromium and native `.pptx` decks through desktop PowerPoint on Windows. This reference defines what `slides.md` and `.pptx` files must provide so `slidevideo inspect`, `validate`, `play`, `record`, and `build` resolve targets cleanly and capture frames without clipping or layout drift.
4
+
5
+ Preserve existing supplied decks by default. Create or edit a deck only when the creator asks for slide authoring or edits, or approves adding slide names or element IDs required by requested storyboard actions or `annotations`. Run `slidevideo inspect --deck <file> --json` before writing `slidevideo.yaml` to list actual slide names, click counts, media IDs, highlight targets, and capability diagnostics.
6
+
7
+ ## Slide addressing
8
+
9
+ Every storyboard `scene.slide` and `slide.target` value must match `^[a-zA-Z][a-zA-Z0-9_-]*$`.
10
+
11
+ ### Slidev
12
+
13
+ - Set a unique frontmatter `name` on every slide across the expanded deck.
14
+ - Do not rely on `routeAlias`. SlideVideo ignores `routeAlias` when resolving storyboard targets.
15
+ - Slides without `name` fall back to `slide-<N>` using the one-based expanded slide order after Slidev expands `src` imports, applies range selections, and excludes `hide` or `disabled` slides. Adding, reordering, or importing slides shifts unnamed `slide-N` targets, so author explicit `name` values whenever you create or adapt a Slidev deck.
16
+
17
+ ### PowerPoint
18
+
19
+ - Set a unique native `Slide.Name` matching `^[a-zA-Z][a-zA-Z0-9_-]*$`, or use the unambiguous `slide-<SlideID>` alias returned by `slidevideo inspect --deck <file> --json`. `SlideID` is PowerPoint's internal identifier, not the one-based slide index.
20
+ - Every slide must use manual advancement and visible slides, with either cut transitions or finite native slide transitions. Timed `AdvanceOnTime` settings, hidden slides, and interactive trigger sequences fail `POWERPOINT_CAPABILITY`. Explicit `slide` actions must reserve at least `transition_duration_ms + entry_duration_ms` as reported by `slidevideo inspect --deck <file> --json`.
21
+
22
+ ## Click reveals
23
+
24
+ ### Slidev
25
+
26
+ - Use Slidev click directives such as `v-click`, `v-clicks`, clicked code-block line highlights, or Magic Move steps driven by Slidev's click counter.
27
+ - `reveal.click` sets the target integer click step on the active slide rather than adding a relative delta. Reveals must advance in strictly increasing order until a `slide` action resets clicks to `0`.
28
+ - Set `reveal.duration_ms` to cover the full CSS transition or reveal animation duration. SlideVideo reserves that settling window in the schedule and does not rewrite CSS transition timings.
29
+
30
+ ### PowerPoint
31
+
32
+ - Use finite `MainSequence` animations (automatic pre-click `WithPrevious`/`AfterPrevious` entry effects and sequential click groups across entrance, emphasis, exit, and motion presets).
33
+ - Unbounded repeats (`Until Next Click` / `Until End of Slide`), interactive triggers, speed transforms, and animations on embedded video shapes fail `POWERPOINT_CAPABILITY`.
34
+ - Set `reveal.duration_ms` to at least the native click-group duration reported in `slides[].click_durations_ms` by `slidevideo inspect --deck <file> --json`. Each `reveal` must execute the next consecutive click step `1..N` on the active slide.
35
+
36
+ ## Managed media
37
+
38
+ ### Slidev
39
+
40
+ - Declare controllable media with literal lowercase `<video id="...">` or `<audio id="...">` HTML tags in `slides.md`. Component wrappers such as `<SlidevVideo>` are not discovered as storyboard media targets.
41
+ - Place local clip files in `public/` next to `slides.md`, reference `src="/clip.mp4"` on the `<video>` element with `preload="auto" muted playsinline`, and declare the same file under `media` in `slidevideo.yaml` as `src: ./public/clip.mp4`.
42
+ - During preparation, SlideVideo fetches the browser's resolved media URL and verifies that its SHA-256 digest matches `media[].src`. A re-encoded copy fails with `MEDIA_SOURCE_MISMATCH`.
43
+ - Browser audio, WebAudio, and iframe audio are muted during capture. Exported audio comes only from synthesized narration and scheduled `play` actions with `audio: source`.
44
+
45
+ ### PowerPoint
46
+
47
+ - Embed the local video file directly on the slide as an ungrouped shape and set `Shape.Name` to the storyboard `media[].id`. Linked or online video fails capability validation.
48
+ - Point `media[].src` in `slidevideo.yaml` at the exact file embedded into the `.pptx` package so its SHA-256 digest and duration match.
49
+ - Disable autoplay, loop, rewind, native trims, fullscreen playback, rotation, flipping, 3D transforms, and shape animations on the video shape. Static cropping and borders or shadows are allowed. PowerPoint `play` actions run at `rate: 1` and support optional storyboard `trim_start_ms` and `trim_end_ms`.
50
+
51
+ ## Annotation targets and canvas bounds
52
+
53
+ ### Slidev
54
+
55
+ - Slidev renders `#slide-container > #slide-content` at the deck's configured logical canvas, `980` by `552` at `16:9` by default unless headmatter or a theme overrides `canvasWidth` or `aspectRatio`, and scales that canvas to the output dimensions, defaulting to `1920` by `1080` and letterboxing when `--width` and `--height` use another aspect ratio.
56
+ - Element annotations (`highlight` and `underline`) use `target: { type: element, selector: "#card-id" }` and must match one visible, stationary, axis-aligned element inside the active audience slide.
57
+ - Keep annotated elements, highlight padding, and underline `offset` strokes wholly inside the deck's rendered `#slide-content` rectangle. Elements that overflow `#slide-content`, sit inside an ancestor whose `overflow` clips their bounds, use CSS `clip-path`, `mask-image`, rotation, skew, or negative scale, or sit inside an SVG `<g>` group fail geometry collection during playback.
58
+ - Add stable `id` attributes to cards, callouts, rows, or code containers when authoring or adapting `slides.md` so `annotations` do not depend on fragile tag-order selectors.
59
+
60
+ ### PowerPoint
61
+
62
+ - Shape annotations (`highlight` and `underline`) use `target: { type: shape, id: <number> }` with the integer shape ID reported by `slidevideo inspect --deck <file> --json`. Shape names are descriptive only and are not valid target identifiers.
63
+ - `--width` and `--height` scale the native slide uniformly and letterbox when the output aspect ratio differs from the slide size. The native slideshow window sizes dynamically to the monitor bounds (using borderless capture during recording when windowed chrome would exceed the work area) to preserve full native resolution when the display permits.
64
+ - Static `.svg` media parts, unrotated cropped pictures, and stationary groups or group members are supported. Rotated, flipped, or 3D shapes, paragraph-level text animations, and shapes exited or hidden after animation fail `ANNOTATION_TARGET`. Any animation on the target shape must finish settling before the annotation interval starts.
65
+ - Both Slidev and PowerPoint also accept `target: { type: region, units: normalized, x, y, width, height }` in `[0, 1]` slide coordinates without modifying the deck.
66
+
67
+ ### Contrast presets
68
+
69
+ On light slide backgrounds, use `blend: darken` with a darker `bottom_border` so dark body text stays crisp inside the highlight:
70
+
71
+ ```yaml
72
+ appearance:
73
+ color: "#D8FF69"
74
+ opacity: 0.55
75
+ blend: darken
76
+ bottom_border:
77
+ color: "#6B8B12"
78
+ opacity: 1
79
+ units: normalized
80
+ height: 0.004
81
+ padding:
82
+ units: normalized
83
+ x: 0.008
84
+ y: 0.006
85
+ ```
86
+
87
+ On dark slide backgrounds or dark code frames, keep the default `source-over` blend mode with lower fill opacity:
88
+
89
+ ```yaml
90
+ appearance:
91
+ color: "#D8FF69"
92
+ opacity: 0.22
93
+ bottom_border:
94
+ color: "#D8FF69"
95
+ opacity: 0.85
96
+ units: normalized
97
+ height: 0.004
98
+ padding:
99
+ units: normalized
100
+ x: 0.008
101
+ y: 0.006
102
+ ```
103
+
104
+ ## Watermark safe zone and Vite watch hygiene
105
+
106
+ - Unlicensed exports render a translucent `slidevideo.io` watermark in the lower-right corner of the video frame, sized from output height with font size `round(height * 0.024)`, box width `ceil(size * 8)`, and margin `round(min(width, height) * 0.018)`. On `16:9` widescreen exports, keeping slide footers, page numbers, source citations, and badges out of the lower-right `18%` width by `10%` height region leaves clearance for the mark. On narrower or portrait `--width` and `--height` aspect ratios, the mark spans a wider fraction of the frame width, so check lower-right clearance at the target dimensions.
107
+ - Bundle local `.woff2` fonts or set `fonts.provider: none` in Slidev headmatter when you want offline builds without external font requests. Avoid continuous CSS keyframe motion on annotated elements because target movement above `0.5` output pixels during an annotation interval fails `ANNOTATION_GEOMETRY`.
108
+ - When you store build runs under `runs/` inside a Slidev project that includes `vite.config.ts`, ignore generated directories so Vite does not watch run artifacts:
109
+
110
+ ```ts
111
+ export default {
112
+ server: {
113
+ watch: { ignored: ['**/.agents/**', '**/runs/**', '**/dist/**'] },
114
+ },
115
+ };
116
+ ```
117
+
118
+ ## Multi-feature Slidev and storyboard example
119
+
120
+ Place a silent or audio-bearing MP4 at `public/demo.mp4`, save `slides.md`, and pair it with `slidevideo.yaml`:
121
+
122
+ ```md
123
+ ---
124
+ theme: default
125
+ title: Deployment walkthrough
126
+ name: overview
127
+ fonts:
128
+ provider: none
129
+ transition: none
130
+ ---
131
+
132
+ # Ship deterministic releases
133
+
134
+ <div id="canary-card" style="padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px;">
135
+ Verify canary health before promoting production traffic.
136
+ </div>
137
+
138
+ <div v-click="1" style="margin-top: 16px;">
139
+ Automated rollback stays armed throughout the rollout window.
140
+ </div>
141
+
142
+ ---
143
+ name: rollout-clip
144
+ ---
145
+
146
+ # Live rollout capture
147
+
148
+ <video id="rollout-video" src="/demo.mp4" preload="auto" muted playsinline style="width: 80%;" />
149
+ ```
150
+
151
+ ```yaml
152
+ version: 1
153
+ deck: ./slides.md
154
+ voice:
155
+ provider: edge-tts
156
+ voice: en-US-AriaNeural
157
+ media:
158
+ - id: rollout-video
159
+ src: ./public/demo.mp4
160
+ narration:
161
+ - id: overview-narration
162
+ text: "Check canary health first, then arm automated rollback before shifting traffic."
163
+ - id: clip-narration
164
+ text: "Here is the recorded rollout sequence from staging."
165
+ scenes:
166
+ - id: intro
167
+ slide: overview
168
+ actions:
169
+ - id: speak-overview
170
+ type: speak
171
+ segment: overview-narration
172
+ - id: hold-overview
173
+ type: hold
174
+ duration_ms: 600
175
+ - id: demo
176
+ slide: rollout-clip
177
+ actions:
178
+ - id: speak-clip
179
+ type: speak
180
+ segment: clip-narration
181
+ - id: play-rollout
182
+ type: play
183
+ media: rollout-video
184
+ audio: muted
185
+ volume: 0
186
+ - id: hold-end
187
+ type: hold
188
+ duration_ms: 500
189
+ cues:
190
+ - id: reveal-rollback
191
+ at:
192
+ segment: overview-narration
193
+ phrase: "arm automated rollback"
194
+ boundary: start
195
+ offset_ms: 0
196
+ action:
197
+ type: reveal
198
+ click: 1
199
+ duration_ms: 300
200
+ annotations:
201
+ - id: highlight-canary
202
+ scene: intro
203
+ target:
204
+ type: element
205
+ selector: "#canary-card"
206
+ effect: highlight
207
+ appearance:
208
+ color: "#D8FF69"
209
+ opacity: 0.55
210
+ blend: darken
211
+ bottom_border:
212
+ color: "#6B8B12"
213
+ opacity: 1
214
+ units: normalized
215
+ height: 0.004
216
+ padding:
217
+ units: normalized
218
+ x: 0.008
219
+ y: 0.006
220
+ at:
221
+ segment: overview-narration
222
+ phrase: "canary health"
223
+ boundary: start
224
+ offset_ms: 0
225
+ duration_ms: 1600
226
+ ```
227
+
228
+ In the SlideVideo repository, `examples/slidev-theme-slidevideo/` provides a complete `16:9` Slidev theme with `<MonitorWindow>`, `<SvCard id="...">`, local `.woff2` fonts, and lower-right watermark clearance. Bundling a cleared starter deck and storyboard directly inside the published `@slidevideo/cli` npm package is tracked in https://github.com/bitbeamer/slidevideo/issues/53.
@@ -2,19 +2,23 @@
2
2
 
3
3
  ## Set up the host
4
4
 
5
- Use the installed `slidevideo` executable in the presentation folder. Run `slidevideo setup` to prepare speech providers and detect Slidev and native PowerPoint support, or `slidevideo setup --help` for setup options. The deck extension selects the presentation adapter, and the storyboard selects the speech provider and voice. Windows PowerShell can use `slidevideo.cmd` when execution policy blocks the generated `.ps1` launcher.
5
+ Use the installed `slidevideo` executable in the presentation folder. Check host readiness without prompts or changes by running `slidevideo setup --manual --json`. In non-interactive shells, `slidevideo setup` exits `3` when prerequisites are missing unless you pass `--install`. Run `slidevideo setup --install --json` to install supported missing tools, and pass `--presentation slidev` or `--presentation powerpoint` and `--provider edge-tts` or `--provider elevenlabs` to scope checks and installation. Run `slidevideo skill --install` to link the bundled skill into `~/.agents/skills/slidevideo`, or add `--project` for project-local registration. Windows PowerShell can use `slidevideo.cmd` when execution policy blocks the generated `.ps1` launcher.
6
6
 
7
- Slidev needs its browser runtime. Native PowerPoint needs installed desktop PowerPoint on Windows with an unlocked interactive desktop. Both use FFmpeg and ffprobe. Edge TTS uses the pinned local Python adapter. ElevenLabs setup saves an API key in the per-user config for all projects. Existing environment or local `.env` credentials remain optional overrides. Credentials never belong in storyboards or chat output.
7
+ Slidev needs its browser runtime. Native PowerPoint needs installed desktop PowerPoint on Windows with an unlocked interactive desktop. Both use FFmpeg and ffprobe. Edge TTS uses the pinned local Python adapter. Interactive `slidevideo setup` saves an ElevenLabs API key in the mode-`600` per-user config file reported as `config_file` by `slidevideo setup --manual --json`. In non-interactive environments, set `ELEVENLABS_API_KEY` in the environment or in a mode-`600` `.env` file in the working directory, or write `"elevenlabs_api_key"` in that mode-`600` per-user `config.json`. Never print credentials or `.env` values, and never place credentials in storyboards or chat output.
8
+
9
+ To discover valid Edge TTS voice names, run `<edge-python> -m edge_tts --list-voices` using the `python` path reported in `slidevideo setup --manual --json`. To discover ElevenLabs voice IDs, copy an ID from the ElevenLabs dashboard or query `https://api.elevenlabs.io/v1/voices` with the `xi-api-key` header and read `voices[].voice_id` and `voices[].name`.
8
10
 
9
11
  Keep the existing presentation as input. The production CLI does not require an AI agent to author intermediate files or an authoring script to recreate the deck. Narration text is authored in the storyboard, and the selected TTS service synthesizes its audio.
10
12
 
11
13
  ## Choose the operation
12
14
 
13
- For an authoring or explanation request, return the draft, revision or answer without starting production. When validation is requested, use `validate`; it checks syntax, references and capabilities without requesting speech or recording. Pending phrase alignment is checked later, during resolution.
15
+ Before drafting a storyboard for an existing presentation, run `slidevideo inspect --deck <file> --json` to list slide targets, click counts, media IDs, and highlight targets without generating speech or recording. For an authoring or explanation request, return the draft, revision, or answer without starting production. When validation is requested, use `validate`; it checks syntax, references, and capabilities without requesting speech or recording. Pending phrase alignment is checked later, during resolution.
16
+
17
+ For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Pass `--width` and `--height` together as even integers from `640` to `3840` wide and `360` to `2160` high to test a non-default viewport; the default is `1920` by `1080`. Add `--cache-dir <directory>` to use retained speech timing. The player estimates uncached narration duration and requires matching alignment for phrase cues. All audio stays silent. Keep the CLI running while the creator uses the browser controls. Stop and relaunch it after storyboard edits.
14
18
 
15
- For a visual pacing review, use `play --storyboard <file>` and open the printed URL. Add `--cache-dir <directory>` to use retained speech timing. The player estimates uncached narration duration and requires matching alignment for phrase cues. All audio stays silent. Keep the CLI running while the creator uses the browser controls. Stop and relaunch it after storyboard edits.
19
+ For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation, and assembles the MP4 at `1920` by `1080` and `30 fps` by default. Pass `--width` and `--height` together and optional `--fps` of `15`, `24`, `30`, or `60` to `build` or `record` to select another resolution or frame rate. `record` and `build` bind `width`, `height`, and `fps` in the run manifest. `assemble` and `build --resume` inherit those settings and fail with `RUN_MODE_MISMATCH` when you pass conflicting values.
16
20
 
17
- For a requested finished video, use `build`. It validates inputs, generates or reuses matching speech, resolves timing, captures the presentation and assembles the MP4. Use a new run directory and pass `--cache-dir` when the creator has a speech cache.
21
+ `tts` and `resolve` reject `--width`, `--height`, and `--fps` because speech cache keys and millisecond schedules are independent of pixel dimensions. Changing from `1280` by `720` to `1920` by `1080` requires a new run directory for capture and assembly while reusing cached speech and alignment through `--cache-dir`. Scaling within the same aspect ratio preserves Slidev and PowerPoint layout and frame-fixed `overlays[].box` placement, while changing aspect ratio alters letterboxing for both adapters.
18
22
 
19
23
  Use staged commands when an intermediate result is useful to the creator. `tts` prepares audio and alignment, `resolve` calculates the schedule, `record` captures from resolved inputs, and `assemble` produces the final MP4. Begin with a new or empty run directory. Commands reject a nonempty directory without a run manifest before writing run artifacts. A requested narration review can occur after `tts` and before capture. `record` does not generate speech implicitly.
20
24
 
@@ -26,13 +30,13 @@ slidevideo build --storyboard slidevideo.yaml --run runs/video-001 --json
26
30
 
27
31
  That run directory must be new or empty. A nonzero exit, failed status or missing requested completed stages is failure. A completed normal build reports `status: completed` and `timing_status: not_evaluated`, with a video artifact path.
28
32
 
29
- ## Produce marker highlights
33
+ ## Produce marker highlights and underlines
30
34
 
31
- Follow the [marker field reference](storyboard.md#marker-highlights). Discover actual targets with `slidevideo inspect --storyboard <file> --json`. Existing Slidev selectors and native shape IDs belong to their adapters. Regions use normalized slide coordinates. Do not edit the source deck to introduce targets.
35
+ Follow the [marker reference](storyboard.md#marker-highlights) and [underline reference](storyboard.md#underline-annotations). Discover actual slide names, click counts, media declarations, and annotation targets with `slidevideo inspect --deck <file> --json` before a storyboard exists, or `slidevideo inspect --storyboard <file> --json`. Pass `--width` and `--height` together with `inspect` to check a non-default viewport. Existing Slidev selectors and native shape IDs belong to their adapters. Regions use normalized slide coordinates. Preserve existing decks by default, and follow [deck compatibility](decks.md) when the creator asks to create or edit slides or add target IDs.
32
36
 
33
- Use the same `validate` and `build` commands for a storyboard with markers. The assembler draws highlights on the captured frames. A changed annotation needs a new run and can reuse matching speech.
37
+ Use the same `validate` and `build` commands for a storyboard with annotations. The assembler draws highlights and underlines on the captured frames. A changed annotation needs a new run and can reuse matching speech.
34
38
 
35
- Inspect geometry observations, `assembly/annotations-applied.json` and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks decoded final frames and retains `assembly/annotations-evidence.json`. Unobservable boundaries fail explicitly. [Marker limits and target types](storyboard.md#marker-highlights)
39
+ Inspect geometry observations, `assembly/annotations-applied.json`, and `assembly/report.json` separately from base-capture timing. Normal final-composite evidence remains `not_evaluated`. Requested timing proof checks native-resolution decoded final frames, including interior wipe samples for animated underlines, and retains `assembly/annotations-evidence.json`. Unobservable strokes or boundaries fail explicitly. [Marker limits and target types](storyboard.md#marker-highlights)
36
40
 
37
41
  ## Reuse speech and preserve revisions
38
42
 
@@ -60,7 +64,7 @@ Staged `assemble` and resumed builds inherit the run's timing mode. Changing tha
60
64
  | `SCHEMA`, `DUPLICATE_ID`, reference errors | Correct the authored fields or references against the storyboard reference. |
61
65
  | `CUE_ALIGNMENT_REQUIRED`, `CUE_PHRASE_MISSING`, `CUE_AMBIGUOUS`, `CUE_BOUNDARY` | Inspect the exact paired transcript and alignment. Revise the intended phrase or action with the creator. Do not invent timings. |
62
66
  | `REVEAL_TARGET`, `REVEAL_ORDER`, `ACTION_CONFLICT`, `MEDIA_NAVIGATION`, `SCENE_DURATION` | Check the merged sequence and cues, active slide, click order and reserved durations. |
63
- | `RUN_MISMATCH`, `SCHEDULE_MISMATCH` | Start a new run for the revised inputs. |
67
+ | `RUN_MISMATCH`, `RUN_MODE_MISMATCH`, `SCHEDULE_MISMATCH` | Start a new run for revised inputs, timing-verification mode, or output dimensions and frame rate. |
64
68
  | `RECORD_RETRY_NEW_RUN` | Preserve the failed capture and use a new run for another attempt. |
65
69
  | `MEDIA_SOURCE_MISMATCH` | Confirm the declaration matches the exact media bytes rendered by the deck. |
66
70
  | Browser preparation or capture failure | Read the run's `recording/slidev.log` and check the configured native Chromium executable. |
@@ -17,25 +17,14 @@ IDs and slide targets use `^[a-zA-Z][a-zA-Z0-9_-]*$`. They start with an ASCII l
17
17
  | `version` | Yes | Schema version. Always `1`. |
18
18
  | `deck` | Yes | Nonempty path to an existing Slidev `.md` or native PowerPoint `.pptx` input. |
19
19
  | `voice` | No | Default voice for narration. Every spoken segment needs either this default or its own voice. Silent productions can omit it. |
20
- | `output` | Yes | Requested video dimensions and frame rate. |
21
20
  | `media` | Yes | Array of declared source media. `[]` is valid when none is used. |
22
21
  | `narration` | Yes | Array of text segments. `[]` supports a silent or source-audio-only production. |
23
22
  | `scenes` | Yes | Ordered scenes and their sequential actions. Total resolved production duration must be positive. |
24
23
  | `cues` | Yes | Array of phrase-driven visual actions. `[]` is valid. |
25
- | `annotations` | Yes | Array of phrase-triggered rectangular marker highlights. Use `[]` when none are needed. |
24
+ | `annotations` | Yes | Array of phrase-triggered slide annotations (`highlight` and `underline`). Use `[]` when none are needed. |
26
25
  | `overlays` | No | Frame-fixed image layers for the exported video. |
27
26
 
28
- Required fields have no implicit root defaults. Examples commonly choose 1920 by 1080 at 30 fps, but those values must be authored.
29
-
30
- ## Output fields
31
-
32
- | Field | Required | Accepted values |
33
- | --- | --- | --- |
34
- | `output.width` | Yes | Even integer from 640 to 3840. |
35
- | `output.height` | Yes | Even integer from 360 to 2160. |
36
- | `output.fps` | Yes | `15`, `24`, `30` or `60`. |
37
-
38
- PowerPoint requires the output aspect ratio to match the deck. Its native slideshow window is capped at 1600 physical pixels wide. The recorder scales the captured slide to the requested output dimensions.
27
+ Configure video dimensions and frame rate on the CLI with `--width`, `--height`, and `--fps`, defaulting to `1920` by `1080` at `30 fps`.
39
28
 
40
29
  ## Voice fields and provider options
41
30
 
@@ -57,7 +46,7 @@ ElevenLabs option values are:
57
46
  | `similarity_boost` | Number from 0 to 1. | Provider default. |
58
47
  | `speed` | Number from 0.7 to 1.2. | Provider default. |
59
48
 
60
- Credentials never belong in YAML. Run `slidevideo setup` to prepare both speech providers or leave either for later. It saves one ElevenLabs API key in the per-user config for all projects. Existing `ELEVENLABS_API_KEY` or legacy `ELEVENLABS_KEY` values from the environment or local `.env` override the saved key. Edge uses the pinned local Python adapter. Provider and voice selection remain in the storyboard.
49
+ Credentials never belong in YAML. Run `slidevideo setup` in a terminal or `slidevideo setup --install --json` in a non-interactive shell to prepare speech providers. Interactive setup saves one ElevenLabs API key in the mode-`600` per-user config file reported by `slidevideo setup --manual --json`. In non-interactive shells, set `ELEVENLABS_API_KEY` in the environment or a mode-`600` `.env` file, or save `"elevenlabs_api_key"` in that mode-`600` `config.json`. Edge uses the pinned local Python adapter. List valid Edge voice names with `<edge-python> -m edge_tts --list-voices` using the `python` path from `slidevideo setup --manual --json`. List ElevenLabs voice IDs from the ElevenLabs dashboard or `https://api.elevenlabs.io/v1/voices` using the `xi-api-key` header. Provider and voice selection remain in the storyboard.
61
50
 
62
51
  ## Media declarations
63
52
 
@@ -106,7 +95,7 @@ Every scene action has required `id` and `type`. The other fields depend on the
106
95
  | `trim_end_ms` | Optional nonnegative source position. Default source duration. Must be after the start and no later than source duration. |
107
96
  | `rate` | Optional number from 0.5 to 2. Default `1`. Picture and source audio use the same rate. |
108
97
 
109
- The duration formula is `(trim_end_ms - trim_start_ms) / rate`, with omitted trims replaced by their defaults. Schema acceptance does not imply adapter support. Native PowerPoint currently accepts only start `0`, omitted end and rate `1`.
98
+ The duration formula is `(trim_end_ms - trim_start_ms) / rate`, with omitted trims replaced by their defaults. Schema acceptance does not imply adapter support. Native PowerPoint currently requires rate `1` and supports optional `trim_start_ms` and `trim_end_ms`.
110
99
 
111
100
  Source-audio volume is an explicit fixed gain. The storyboard has no automatic ducking option.
112
101
 
@@ -143,12 +132,13 @@ The storyboard reserves intended durations. The resolved schedule establishes ex
143
132
  | Concern | Slidev `.md` | Native PowerPoint `.pptx` |
144
133
  | --- | --- | --- |
145
134
  | Slide targets | Authored frontmatter `name`, otherwise `slide-<one-based effective index>`. Imports and filtering affect that index. | Unique native `Slide.Name`, or unambiguous `slide-<SlideID>`. SlideID is not the slide position. Names must also fit the YAML target syntax. |
146
- | Reveals | Native click-driven content, such as `v-click`. Steps advance and must fit known or runtime-checked bounds. | Consecutive finite entrance Appear/Fade click groups. The declared duration must cover the complete native group. |
147
- | Slide changes | Authored deck transition, with a matching settling allowance. | Cuts. Native slide transitions, timed advancement, hidden slides and interactive sequences are unsupported. |
148
- | Video | Managed media element with a matching declared source. Trims and rates follow the shared action contract. | Full embedded video at rate 1, with exact source-byte matching. No native trim, autoplay, loop, rewind or fullscreen transform. |
135
+ | Reveals | Native click-driven content, such as `v-click`. Steps advance and must fit known or runtime-checked bounds. | Consecutive finite `MainSequence` click groups (entrance, emphasis, exit, and motion presets). The declared duration must cover the complete native group. |
136
+ | Slide changes | Authored deck transition, with a matching settling allowance. | Cuts or finite native slide transitions, plus optional automatic pre-click entry animations. Timed advancement, hidden slides, and interactive sequences are unsupported. |
137
+ | Video | Managed media element with a matching declared source. Trims and rates follow the shared action contract. | Embedded video at rate `1` with exact source-byte matching and optional storyboard `trim_start_ms` / `trim_end_ms`. No native trim, autoplay, loop, rewind, or fullscreen transform. |
149
138
  | Runtime | Playwright-controlled Chromium and the playback addon. | Windows desktop PowerPoint and FFmpeg native window capture on an unlocked interactive desktop. |
139
+ | Viewport and aspect ratio | Scales the deck to `--width` and `--height`, letterboxing when the aspect ratio differs from the slide canvas. | Scales the deck to `--width` and `--height`, letterboxing when the aspect ratio differs from the slide size and sizing the capture window dynamically to the monitor bounds. |
150
140
 
151
- Linked or online media and unsupported dynamic PowerPoint objects fail capability validation. Inspect the deck's existing animations and media before scheduling them in the storyboard.
141
+ Linked or online media and unsupported dynamic PowerPoint objects fail capability validation. Run `slidevideo inspect --deck <file> --json` to list slide targets, `slide-<SlideID>` aliases, click counts, native click-group durations, media IDs, and unsupported native features before scheduling them in the storyboard.
152
142
 
153
143
  ## Minimal authored example
154
144
 
@@ -160,10 +150,6 @@ deck: ./slides.pptx
160
150
  voice:
161
151
  provider: edge-tts
162
152
  voice: en-US-AriaNeural
163
- output:
164
- width: 1920
165
- height: 1080
166
- fps: 30
167
153
  media: []
168
154
  narration:
169
155
  - id: welcome
@@ -190,11 +176,11 @@ Changing narration text, voice, provider options or adapter version invalidates
190
176
 
191
177
  Changing only a hold can reuse unchanged speech through a matching cache. A changed storyboard or deck requires a new run. Existing completed stages cannot be resumed against edited inputs.
192
178
 
193
- The YAML has no fields for output filenames, run directories, caches, credentials, timeouts or timing-verification mode. Those belong to CLI options or the environment. It also has no arbitrary absolute action timestamp or dedicated settings for captions, background music or automatic ducking. Extra fields are rejected rather than silently interpreted.
179
+ The YAML has no fields for output dimensions, frame rate, output filenames, run directories, caches, credentials, timeouts, or timing-verification mode. Those belong to CLI options or the environment. It also has no arbitrary absolute action timestamp or dedicated settings for captions, background music, or automatic ducking. Extra fields are rejected rather than silently interpreted.
194
180
 
195
181
  ## Marker highlights
196
182
 
197
- The [storyboard schema](../../../schemas/storyboard.v1.json) requires `annotations` and accepts only the implemented `highlight` effect. Each annotation has globally unique `id`, `scene`, `target`, `effect`, `appearance`, `at` and `duration_ms` fields. The `at` object has exactly the phrase-cue semantics above, including occurrence, boundary and offset. The phrase must belong to narration scheduled in that scene.
183
+ The [storyboard schema](../../../schemas/storyboard.v1.json) requires `annotations` and accepts the `highlight` and `underline` effects. Each annotation has globally unique `id`, `scene`, `target`, `effect`, `appearance`, `at`, and `duration_ms` fields, plus optional `motion` where the effect defines it. The `at` object has the same phrase-cue rules described above, including occurrence, boundary, and offset. The phrase must belong to narration scheduled in that scene.
198
184
 
199
185
  ```yaml
200
186
  annotations:
@@ -216,29 +202,75 @@ annotations:
216
202
  duration_ms: 2000
217
203
  ```
218
204
 
219
- Run `slidevideo inspect --storyboard slidevideo.yaml --json` in your presentation folder to find targets in your deck before adapting this example.
205
+ Run `slidevideo inspect --deck <file> --json` or `slidevideo inspect --storyboard slidevideo.yaml --json` in your presentation folder to find targets in your deck before adapting this example.
220
206
 
221
207
  | Target | Fields | Adapter |
222
208
  | --- | --- | --- |
223
- | Region | `type: region`, `units: normalized`, `x`, `y`, `width`, `height` | Both. Coordinates use the top-left slide origin, with x/width relative to slide width and y/height relative to slide height. |
224
- | Element | `type: element`, nonempty CSS `selector` | Slidev. Exactly one existing visible element in the active audience slide. |
225
- | Shape | `type: shape`, positive integer `id` | PowerPoint. Existing native shape ID within the active slide, returned by inspection. Names are descriptions, not identities. |
209
+ | Region | `type: region`, `units: normalized`, `x`, `y`, `width`, `height` | Both. Coordinates use the top-left slide origin, with `x` and `width` relative to slide width and `y` and `height` relative to slide height. |
210
+ | Element | `type: element`, nonempty CSS `selector` | Slidev. Matches one visible element in the active audience slide. |
211
+ | Shape | `type: shape`, positive integer `id` | PowerPoint. Matches one native shape ID on the active slide, returned by inspection. Names are descriptions, not identities. |
212
+
213
+ Regions require `x` and `y` in `[0,1]`, positive `width` and `height` at most one, and `x + width` and `y + height` at most one. Appearance color is `#RRGGBB`, and opacity is greater than zero and at most one. Highlight padding has explicit `units: normalized` and `x` and `y` from zero to one, applied on each side relative to slide width and height. Expanded rectangles clip to slide bounds. Pixel mapping uses the actual captured slide-content rectangle, including letterboxing, rather than assuming the slide fills the output. Edges round outward to captured pixels before clipping.
214
+
215
+ Optional `appearance.blend` accepts `source-over` or `darken`, with `source-over` as the default. `darken` combines each channel using the darker source or captured value before applying opacity, keeping dark lettering legible on light backgrounds.
216
+
217
+ Optional `appearance.bottom_border` has required `color`, `opacity`, `units: normalized`, and `height` fields. Color and opacity use the fill ranges, and `height` is greater than zero and at most one, relative to actual slide-content height. The accent extends below the padded rectangle and clips to slide and viewport bounds. It uses normal alpha compositing and the fill's half-open interval. A height of `1/300` represents a 3-pixel accent in a 900-pixel-high source slide. Authored YAML must use the numeric value, such as `0.0033333333333333335`.
226
218
 
227
- Regions require x/y in `[0,1]`, positive width/height at most one, and x+width/y+height at most one. Appearance color is `#RRGGBB`; opacity is greater than zero and at most one. Padding has explicit `units: normalized` and x/y from zero to one, applied on each side relative to slide width/height. Expanded rectangles clip to slide bounds. Pixel mapping uses the actual captured slide-content rectangle, including letterboxing, rather than assuming the slide fills the output. Edges round outward to captured pixels before clipping.
219
+ Requested final-frame verification reports fill and bottom-border checks separately. Thin accents below two output pixels are unobservable under `yuv420p` chroma subsampling and fail requested proof explicitly. Normal production leaves timing unevaluated.
228
220
 
229
- Optional `appearance.blend` accepts `source-over` or `darken`, with `source-over` as the default. `darken` combines each channel using the darker source or captured value before applying opacity, retaining dark lettering on light backgrounds.
221
+ The duration is positive milliseconds. An interval containing no output frame at the selected frame rate fails with `ANNOTATION_FRAME_RANGE`. Intervals are half-open `[start,end)` and do not extend scenes. They must fit one scene, slide visit, and settled reveal state. An annotation may end at a navigation or reveal boundary, and it cannot cross one or start during settling. Array order sets the drawing order, so later annotations draw above earlier ones. The first active frame is the first output frame at or after the resolved start, and removal begins on the first frame at or after the end.
230
222
 
231
- Optional `appearance.bottom_border` has required `color`, `opacity`, `units: normalized` and `height` fields. Color and opacity use the fill ranges; height is greater than zero and at most one, relative to actual slide-content height. The accent extends below the padded rectangle and clips to slide and viewport bounds. It uses normal alpha compositing and exactly the fill's half-open interval. A height of `1/300` represents a 3-pixel accent in a 900-pixel-high source slide. Authored YAML must use the numeric value, such as `0.0033333333333333335`.
223
+ Targets are stationary, visible, and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, masked, clipped, or moving targets fail with annotation context (including Slidev SVG `<g>` groups). Slidev excludes navigation, notes, and duplicate hidden slide instances and samples geometry each animation frame. Native PowerPoint shape support includes stationary unrotated groups, group members, and cropped pictures, while excluding hidden, rotated, flipped, 3D, paragraph-animated, moving or resized, exited, and hide- or dim-after-animation targets; supported animations must have settled. PowerPoint schedules native geometry samples 50 ms apart. Movement above 0.5 output pixels invalidates the target. Sampling checks the documented stationary subset rather than tracking moving targets or recognizing pixels.
232
224
 
233
- Requested final-frame verification reports fill and bottom-border checks separately. Thin accents may be unobservable at the analysis resolution and fail requested proof explicitly. Normal production still leaves timing unevaluated.
225
+ For a PowerPoint shape, use a target such as `{ type: shape, id: 2 }` when `slidevideo inspect --deck slides.pptx --json` or `slidevideo inspect --storyboard slidevideo.yaml --json` lists that ID on the selected slide without unsupported shape diagnostics.
226
+
227
+ Raw captures contain no annotations. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification decodes final frames at native output resolution and checks the expected visible and clear states near interval boundaries. Tiny, low-contrast, or obscured regions, or an end with no following output frame, fail requested proof explicitly. Text-range discovery and word following are not implemented.
228
+
229
+ ## Underline annotations
230
+
231
+ Use `effect: underline` in `annotations` to draw a standalone horizontal stroke under a stationary `region`, Slidev `element`, or PowerPoint `shape` without drawing a box fill.
232
+
233
+ ```yaml
234
+ annotations:
235
+ - id: title-underline
236
+ scene: opening
237
+ target:
238
+ type: element
239
+ selector: h1
240
+ effect: underline
241
+ appearance:
242
+ color: '#2563eb'
243
+ opacity: 0.95
244
+ style: solid
245
+ units: normalized
246
+ width: 0.006
247
+ offset: 0.004
248
+ padding_x: 0.005
249
+ motion:
250
+ type: wipe
251
+ in_ms: 250
252
+ out_ms: 200
253
+ at:
254
+ segment: introduction
255
+ phrase: A storyboard
256
+ boundary: start
257
+ offset_ms: 0
258
+ duration_ms: 2000
259
+ ```
234
260
 
235
- The duration is positive milliseconds. An interval containing no output frame at the selected frame rate fails with `ANNOTATION_FRAME_RANGE`. Intervals are half-open `[start,end)` and do not extend scenes. They must fit one scene, slide visit and settled reveal state. A highlight may end exactly at a navigation/reveal boundary, but cannot cross it or start during settling. Array order is the drawing order; later annotations cover earlier ones. The first active frame is the first output frame at or after the resolved start, and removal begins on the first frame at or after the end.
261
+ Underline `appearance` accepts these fields:
236
262
 
237
- Targets are stationary, visible and axis-aligned. Missing, ambiguous, hidden, rotated, reflected, grouped, masked, clipped or moving targets fail with annotation context. Slidev excludes navigation, notes and duplicate hidden slide instances and samples geometry each animation frame. Native shape support excludes groups and members, cropped pictures, paragraph animations and hide/dim-after-animation effects; supported entrances must have settled. PowerPoint schedules native geometry samples 50 ms apart. A change exceeding 0.5 output pixels invalidates the target. Sampling establishes the documented subset, not arbitrary moving-target tracking or pixel recognition.
263
+ - `color` is `#RRGGBB`, and `opacity` is greater than zero and at most one.
264
+ - Optional `blend` accepts `source-over` or `darken` and defaults to `source-over`.
265
+ - Optional `style` accepts `solid` or `dashed` and defaults to `solid`. Dashed underlines anchor dash positions to the left edge of each fragment so dashes do not slide during an exit wipe.
266
+ - `units` is `normalized`.
267
+ - `width` is greater than zero and at most one, scaled by the captured slide-content height to determine stroke thickness.
268
+ - Optional `offset` ranges from `-1` to `1` in normalized slide-height units and defaults to `0`, placing the top of the stroke along the target's bottom edge. Positive values move the stroke downward, and negative values pull it upward inside the target box.
269
+ - Optional `padding_x` ranges from `0` to `1` in normalized slide-width units and defaults to `0`, extending the stroke horizontally on both sides before slide-content clipping.
238
270
 
239
- For a PowerPoint shape, use a target such as `{ type: shape, id: 2 }` when inspection lists that ID on the selected slide. Inspect the deck in desktop PowerPoint on Windows to determine native layout and visibility.
271
+ Optional `motion` accepts `{ type: wipe, in_ms, out_ms }`. `in_ms` and `out_ms` are nonnegative durations in milliseconds and default to `0`. `in_ms` sweeps the right edge of the underline from left to right at the start of the interval, and `out_ms` sweeps the left edge from left to right at the end. When `in_ms + out_ms` exceeds `duration_ms`, validation fails with `ANNOTATION_MOTION`.
240
272
 
241
- Raw captures contain no highlights. The shared assembler draws them after capture without stretching narration or freezing slide animation. Normal output retains timing `not_evaluated`. Requested timing verification also decodes final frames and checks the expected visible/clear state near both interval boundaries. Tiny, low-contrast or fully obscured regions, or an end with no following output frame, cannot establish this proof and fail explicitly. No extra effect, entrance/exit animation, text-range discovery or word following is accepted.
273
+ When a static `region` underline places the stroke completely outside `[0, 1]` vertically (`y + height + offset >= 1` or `y + height + offset + width <= 0`), validation fails with `ANNOTATION_BOUNDS`. When runtime slide-content clipping reduces an underline fragment's width or height to zero pixels, assembly fails with `ANNOTATION_GEOMETRY`. With `--verify-timing`, the analyzer checks native-resolution boundary frames and interior `wipe_in` and `wipe_out` progression frames. Strokes thinner than two output pixels or wipe durations with no observable partial frame at the selected frame rate fail requested timing verification explicitly.
242
274
 
243
275
  ## Image overlays
244
276