playwright-director 0.6.2 → 0.6.4

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 (56) hide show
  1. package/README.md +89 -0
  2. package/dist/Tutorial.d.ts +5 -1
  3. package/dist/Tutorial.d.ts.map +1 -1
  4. package/dist/Tutorial.js +56 -20
  5. package/dist/Tutorial.js.map +1 -1
  6. package/dist/index.d.ts +3 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/init.js +19 -3
  11. package/dist/init.js.map +1 -1
  12. package/dist/overlay-html.d.ts +3 -0
  13. package/dist/overlay-html.d.ts.map +1 -1
  14. package/dist/overlay-html.js +3 -2
  15. package/dist/overlay-html.js.map +1 -1
  16. package/dist/overlay.d.ts +1 -1
  17. package/dist/overlay.d.ts.map +1 -1
  18. package/dist/overlay.js +4 -2
  19. package/dist/overlay.js.map +1 -1
  20. package/dist/pace.d.ts +44 -0
  21. package/dist/pace.d.ts.map +1 -0
  22. package/dist/pace.js +61 -0
  23. package/dist/pace.js.map +1 -0
  24. package/dist/reporter.d.ts.map +1 -1
  25. package/dist/reporter.js +4 -0
  26. package/dist/reporter.js.map +1 -1
  27. package/dist/site/build-site.d.ts +2 -0
  28. package/dist/site/build-site.d.ts.map +1 -1
  29. package/dist/site/build-site.js +3 -0
  30. package/dist/site/build-site.js.map +1 -1
  31. package/dist/site/generate-manifest.d.ts +7 -1
  32. package/dist/site/generate-manifest.d.ts.map +1 -1
  33. package/dist/site/generate-manifest.js +83 -13
  34. package/dist/site/generate-manifest.js.map +1 -1
  35. package/dist/site/scaffold.d.ts +2 -0
  36. package/dist/site/scaffold.d.ts.map +1 -1
  37. package/dist/site/scaffold.js +12 -2
  38. package/dist/site/scaffold.js.map +1 -1
  39. package/dist/site/targets.d.ts +12 -0
  40. package/dist/site/targets.d.ts.map +1 -0
  41. package/dist/site/targets.js +44 -0
  42. package/dist/site/targets.js.map +1 -0
  43. package/dist/site/types.d.ts +26 -1
  44. package/dist/site/types.d.ts.map +1 -1
  45. package/dist/timeline.d.ts +9 -3
  46. package/dist/timeline.d.ts.map +1 -1
  47. package/dist/timeline.js +6 -2
  48. package/dist/timeline.js.map +1 -1
  49. package/dist/types.d.ts +7 -0
  50. package/dist/types.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/skills/tutorialize/SKILL.md +12 -2
  53. package/skills/tutorialize/agent.md +25 -6
  54. package/skills/tutorialize/references/api.md +52 -1
  55. package/skills/tutorialize/references/site.md +39 -0
  56. package/skills/tutorialize/references/storytelling.md +46 -0
package/dist/types.d.ts CHANGED
@@ -61,6 +61,11 @@ export interface TutorialOptions {
61
61
  * The variant `'mobile'` also switches to a compact overlay and, with 2+
62
62
  * scenes, a permanent split stage (all scenes visible, ratios ignored). */
63
63
  variant?: string;
64
+ /** Rendering pace — `walkthrough` (default, everything narrated), `snippet`
65
+ * (doc clip: "do" halves and context titles only) or `demo` (showcase cut).
66
+ * Defaults to process.env.TUTORIAL_PACE. A non-walkthrough pace suffixes
67
+ * testName `-<pace>` (after the variant). */
68
+ pace?: Pace;
64
69
  /** Where the gallery sends a viewer next: `app` = the screen this tutorial shows
65
70
  * (path on the site config `appUrl`), `docs` = its documentation page (path on `docsUrl`).
66
71
  * Full URLs are kept as is. Stored in the timeline; no effect on the recording. */
@@ -104,6 +109,8 @@ export interface StepOptions {
104
109
  /** Override overlay position for this step */
105
110
  overlayPosition?: OverlayPosition;
106
111
  }
112
+ /** See `src/pace.ts` */
113
+ export type Pace = 'walkthrough' | 'snippet' | 'demo';
107
114
  export type OverlayPosition = 'TL' | 'TR' | 'BL' | 'BR';
108
115
  export type ContextStyle = 'goal' | 'clarification' | 'attention';
109
116
  export interface ContextOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC/B,sCAAsC;IACtC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mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;4DACwD;IACxD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,wBAAwB;AACxB,MAAM,MAAM,IAAI,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,eAAe,GAAG,WAAW,CAAC;AAElE,MAAM,WAAW,cAAc;IAC9B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-director",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "AI-assisted Playwright tool that turns executable tests into directed video guides — demos, tutorials, and documentation that never lag behind the product.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,7 +10,7 @@ Turn a Playwright test into a tutorial that **teaches**, not just demonstrates.
10
10
  Three reference files support this skill:
11
11
  - [`references/storytelling.md`](references/storytelling.md) — Persona analysis, emotional arc, narration voice, pacing decisions
12
12
  - [`references/api.md`](references/api.md) — `playwright-director` API, timing model, technical rules, checklist
13
- - [`references/site.md`](references/site.md) — Gallery site (`build-site`): config, themes, sections, role chips, tokens/css/overrides, app + docs links, languages, SEO
13
+ - [`references/site.md`](references/site.md) — Gallery site (`build-site`): config, themes, sections, role chips, build targets + include/exclude, tokens/css/overrides, app + docs links, languages, SEO
14
14
 
15
15
  **Read the first two before tutorializing.** Storytelling comes first — it drives every API decision.
16
16
  Read `site.md` when you touch `tutorial-site.config.js`, a site override, or the test's `links`.
@@ -50,12 +50,18 @@ COMPLETE: Celebrate the outcome, suggest what's next
50
50
  through `typeBlurred()`
51
51
  - Fast-forward the dead time: wrap slow generations or repetitive chores in
52
52
  `fastForward(speed, …)` inside their step (`storytelling.md` §10, `api.md` §14)
53
+ - Write once, in full, for every pace: `walkthrough` narrates everything,
54
+ `snippet` (docs) and `demo` (LinkedIn) speak only each step's first sentence
55
+ and the goal title — so those must stand alone (`storytelling.md` §11,
56
+ `api.md` §15). Ask which cut the video is for when the request doesn't say
53
57
  - Apply the polish checklist before submitting
54
58
 
55
59
  ### 4. Verify
56
60
  - Test passes without `TUTORIAL_MODE` (plain E2E)
57
61
  - Test passes with `TUTORIAL_MODE=true` (video generation)
58
- - Watch the generated video — does it feel human?
62
+ - Watch the generated video — does it feel human? Does something move on
63
+ screen within two seconds? Record the short cut too
64
+ (`TUTORIAL_PACE=snippet` or `demo`) and check it still tells the story.
59
65
  - Narration texts also become the gallery site's step-by-step guide
60
66
  (`npx playwright-director build-site`) — even `skipVoice` steps show their
61
67
  text there, so write every step text to read well on the page too.
@@ -65,3 +71,7 @@ COMPLETE: Celebrate the outcome, suggest what's next
65
71
  - Set `links: { app, docs }` when the tutorial shows an app screen or has a
66
72
  docs page, and add the slug to a section's `items` in the site config
67
73
  (`site.md` §3, §5).
74
+ - A tutorial meant for internal readers only goes in a section that the public
75
+ target excludes (`targets.public.tutorials.exclude.categories`,
76
+ `build-site --target public`) — removing a section from `categories` does not
77
+ unpublish it (`site.md` §7b).
@@ -11,9 +11,9 @@ You are an expert Tutorial Designer who transforms Playwright E2E tests into pro
11
11
  ## Before you start
12
12
 
13
13
  Load the `/tutorialize` skill and read both reference files:
14
- - `references/storytelling.md` — persona, emotional arc, narration voice
14
+ - `references/storytelling.md` — persona, emotional arc, narration voice, picking the cut (§11 paces)
15
15
  - `references/api.md` — API, timing model, technical rules, checklist
16
- - `references/site.md` — gallery site config (only when the site config or `links` are involved)
16
+ - `references/site.md` — gallery site config: sections, roles, build targets + `include`/`exclude` (only when the site config or `links` are involved)
17
17
 
18
18
  ## Your process
19
19
 
@@ -22,6 +22,10 @@ Read the original test file. Identify:
22
22
  - **Persona**: who is this tutorial for? (role, expertise, emotional state)
23
23
  - **Goal**: what will the viewer accomplish?
24
24
  - **Key actions**: what needs explanation vs what is obvious?
25
+ - **Cut**: where will the video live? Docs page / widget → `snippet`; onboarding
26
+ or a full course → `walkthrough`; LinkedIn, landing page → `demo`
27
+ (`storytelling.md` §11). Ask when the request doesn't say. You still write
28
+ one script — the pace is chosen at recording time (`TUTORIAL_PACE`).
25
29
  - **Profiles**: does the lesson depend on a handoff between two people? If so,
26
30
  the test becomes multi-scene (`storytelling.md` §8, `api.md` §10). Default to
27
31
  a single profile — a second scene doubles the length and must earn it.
@@ -33,8 +37,13 @@ Navigate → Goal context → Steps (grouped) → Clarifications (if needed) →
33
37
  ```
34
38
 
35
39
  ### 3. Write natural narration
36
- - "Do" ≤ 8 words, action-oriented
37
- - "Explain" gives the WHY
40
+ - "Do" ≤ 8 words, action-oriented — and complete on its own: the short cuts
41
+ speak only the "do"
42
+ - "Explain" gives the WHY (kept on the gallery page and in its SEO even when a
43
+ short cut doesn't say it)
44
+ - Goal context title = the hook, ≤ 12 words, an outcome — it is the whole
45
+ opening of `snippet` / `demo`
46
+ - Check the word budget of the target cut (~2.5 spoken words/s)
38
47
  - Second person, conversational tone
39
48
  - Persona-appropriate vocabulary
40
49
 
@@ -43,6 +52,9 @@ Follow all rules from `api.md`:
43
52
  - No blank-screen opening
44
53
  - Navigation transitions properly awaited
45
54
  - Dual-mode (test works with and without TUTORIAL_MODE)
55
+ - Pace-proof: the story holds without clarification contexts (dropped by
56
+ `snippet` and `demo`) and with only each step's first sentence
57
+ (`api.md` §15); record the target cut with `TUTORIAL_PACE=snippet|demo`
46
58
  - `@tutorial` tag on the test
47
59
  - Acronyms have `voiceText` where TTS mispronounces
48
60
  - Camera zooms (`tutorial.zoom()`, `zoomIn()`/`zoomOut()`, optional `blur`) on
@@ -63,11 +75,18 @@ Follow all rules from `api.md`:
63
75
  - Gallery: `links: { app, docs }` on the Tutorial when the test shows an app
64
76
  screen or has a docs page; new slugs go in a section's `items` of
65
77
  `tutorial-site.config.js` (`site.md` §3, §5)
78
+ - Internal-only tutorials (admin, staff tools): give them their own section and
79
+ leave it out of the public build with `tutorials.exclude: { categories: [...] }`
80
+ in a `targets.public` entry (`build-site --target public`) — never by deleting
81
+ the section from `categories`, which still publishes them (`site.md` §7b)
66
82
 
67
83
  ### 5. Show and explain
68
84
  - Present the diff or full transformed code
69
85
  - Explain why certain groupings were chosen
70
- - Describe what the pacing will feel like when the video plays
86
+ - Describe what the pacing will feel like when the video plays, in the target
87
+ cut, and give the command that records it (`TUTORIAL_PACE=…`)
71
88
 
72
89
  ## Remember
73
- A great tutorial makes the viewer feel capable, not confused. When in doubt, slow down and explain.
90
+ A great tutorial makes the viewer feel capable, not confused — and never makes
91
+ them wait. Write the why in full; let the pace decide how much of it is spoken.
92
+ Something should move on screen within two seconds.
@@ -42,6 +42,7 @@ Or use a fixture that wraps this (the consuming project typically provides a `tu
42
42
  | `customStyles` | `string` | built-in | CSS for overlay |
43
43
  | `overlayPosition` | `'TL' \| 'TR' \| 'BL' \| 'BR'` | `'TR'` | Overlay corner position |
44
44
  | `links` | `{ app?, docs? }` | — | Gallery buttons + docs cross-links: paths on the site's `appUrl` / `docsUrl`, or full URLs. No effect on the recording (`site.md` §5) |
45
+ | `pace` | `'walkthrough' \| 'snippet' \| 'demo'` | `env TUTORIAL_PACE`, else `'walkthrough'` | Rendering cut of the same written tutorial (§15). Non-walkthrough paces suffix `testName` `-<pace>` (after the variant). Read `tutorial.pace` in the spec if needed |
45
46
  | `variant` | `string` | `env TUTORIAL_VARIANT` | Suffixes `testName` (`<testName>-<variant>`) so a second recording never overwrites the first. `'mobile'` also compacts the overlay and pins the multi-scene split (see below) |
46
47
 
47
48
  ## 2. Core Methods
@@ -330,6 +331,11 @@ equivalent. Apps with their own player use the headless API:
330
331
  URLs and chapter times (`steps[].at`, seconds). Schema:
331
332
  `schemas/embed-v1.schema.json`.
332
333
 
334
+ One config can build several sites: `build-site --target public` merges
335
+ `targets.public` over the config, and `tutorials.exclude` / `include`
336
+ (`{ categories, slugs }`, slug globs like `admin-*`) leave whole tutorials out —
337
+ no page, embed, video or sitemap entry (`site.md` §7b).
338
+
333
339
  Widget: a native modal `<dialog>` (focus trap, Esc, focus returned), chapters
334
340
  that seek (arrows/Home/End), fr/en/ar strings picked from `data-tutorial-lang`
335
341
  or `<html lang>`. Theme it from the app with `--pd-accent`, `--pd-surface`,
@@ -564,7 +570,50 @@ tutorial.step('Fill the twelve rows', async () => {
564
570
  - Fast-forward the wait, not the payoff: end the span before the result the viewer must see.
565
571
  - No-op without `TUTORIAL_MODE` — `fastForward()` just runs the action; a speed `≤ 1` throws in both modes.
566
572
 
567
- ## 15. Checklist
573
+ ## 15. Paces — one script, three cuts
574
+
575
+ Write the tutorial **once**, in full (goal context with text, `do` + `explain`
576
+ on every step that needs a why). The pace decides how much of it is narrated:
577
+
578
+ ```bash
579
+ npx playwright test e2e/invoice # walkthrough (default)
580
+ TUTORIAL_PACE=snippet TUTORIAL_MODE=true npx playwright test e2e/invoice # doc clip
581
+ TUTORIAL_PACE=demo TUTORIAL_MODE=true npx playwright test e2e/invoice # LinkedIn / showcase
582
+ ```
583
+
584
+ | | `walkthrough` | `snippet` | `demo` |
585
+ |---|---|---|---|
586
+ | Step narration | `do` + `explain` | `do` only | `do` only |
587
+ | Overlay description | shown | shown | hidden |
588
+ | `goal` context | centered card, title + text | corner banner, title only | corner banner, title only |
589
+ | `clarification` context | shown | dropped | dropped |
590
+ | `attention` context | shown | corner banner, title only | dropped |
591
+ | Pause after context / unvoiced step (`stepDelay`) | 500 ms | 200 ms | 150 ms |
592
+ | Pause after each step (unless `delay`) | 300 ms | 150 ms | 100 ms |
593
+ | Hold on the completion screen | 2 s | 1 s | 1.5 s |
594
+ | Cursor (`mouseSteps` / `pauseBeforeClick`) | 25 / 300 ms | 25 / 150 ms | 15 / 100 ms |
595
+ | `typeSlowly` / `typeBlurred` delay | ×1 | ×0.6 | ×0.4 |
596
+
597
+ - **Nothing is lost for the gallery.** What a short pace doesn't say stays in
598
+ the timeline: steps get `fullText` (the whole `do. explain`), dropped contexts
599
+ are recorded unvoiced with their text. The site's step guide, description and
600
+ SEO read the full text; transcripts and `tutorial-transcript apply` work on
601
+ what was actually said.
602
+ - **Splitting rule:** the narrated part is the first sentence — `do` with
603
+ `do`/`explain`, the title with `description`, a context's title, or the text
604
+ before the first `'. '` of a custom `voiceText`. So the first sentence must
605
+ stand on its own.
606
+ - **Explicit options win:** `stepDelay`, `mouseSteps`, `pauseBeforeClick` passed
607
+ to the constructor override the pace defaults; a step's `delay` overrides
608
+ the after-step pause.
609
+ - Outputs coexist: `invoice`, `invoice-snippet`, `invoice-demo` (and
610
+ `invoice-mobile-demo` with `TUTORIAL_VARIANT=mobile`). The reporter matches
611
+ `TUTORIAL_PACE` when it is set. The gallery publishes one cut per tutorial
612
+ (`tutorials.pace`, `site.md` §2); slugs, config entries and embeds never carry
613
+ the pace suffix.
614
+ - An unknown pace throws, in both modes.
615
+
616
+ ## 16. Checklist
568
617
 
569
618
  Before submitting a tutorialized test:
570
619
 
@@ -583,6 +632,8 @@ Before submitting a tutorialized test:
583
632
  - [ ] Zooms (if any) land on what the narration names, ≤ 3 per tutorial, each `zoomIn` paired with a `zoomOut` in the same step
584
633
  - [ ] Secrets (passwords, API keys) typed with `typeBlurred`, never `fill`/`typeSlowly`
585
634
  - [ ] Long waits / repetitive chores wrapped in `fastForward(speed, …)` inside their step, and the narration announces the skip
635
+ - [ ] Every step's and context's first sentence works alone — it is all `snippet` / `demo` narrate (§15)
636
+ - [ ] The goal context's title is a one-liner (≤ 12 words): it is the whole opening of the short cuts
586
637
 
587
638
  Multi-scene tutorials, additionally:
588
639
 
@@ -48,6 +48,8 @@ export default {
48
48
  | `primaryColor` / `font` | — | Pre-0.6 spellings of `tokens.primary` / `tokens.fontBody` |
49
49
  | `tutorials.categories` | from `@feature:` tags | Sections in display order (§3) |
50
50
  | `tutorials.roles` | — | Académie hero chips, one per reader profile: a click shows only its sections (§3) |
51
+ | `tutorials.exclude` / `include` | — | `{ categories, slugs }` — leave tutorials out of the build entirely (§7b) |
52
+ | `targets` | — | Named config overrides picked with `--target <name>` (§7b) |
51
53
  | `tutorials.featured` | first video | Slug of the Académie "start here" video |
52
54
  | `tutorials.premium` | `[]` | Slugs with a PRO badge |
53
55
  | `tutorials.links` | test `links` | Per-slug `{ app, docs }`, over the test's |
@@ -55,6 +57,7 @@ export default {
55
57
  | `tutorials.ui.heroSubtitle` | "Video tutorials" | String or per language |
56
58
  | `tutorials.stepsLayout` | `'text'` | Video page step guide: `'text'` \| `'cards'` \| `'full'` \| `'none'` |
57
59
  | `tutorials.showStrip` | `true` | Thumbnail strip above the step guide |
60
+ | `tutorials.pace` | `['walkthrough', 'snippet', 'demo']` | Which cut to publish when a tutorial was recorded at several paces (`TUTORIAL_PACE`, `api.md` §15): one pace or a preference order; a tutorial missing the preferred one falls back to what was recorded. The step guide always shows the full written text |
58
61
 
59
62
  ## 3. Sections and order
60
63
 
@@ -143,6 +146,7 @@ npx playwright-director build-site --theme=classic # override config.theme
143
146
  npx playwright-director build-site --base=/help/ # override baseUrl's path
144
147
  npx playwright-director build-site --output=dist/help/ # override output
145
148
  npx playwright-director build-site --only=onboarding # only these slugs (all languages/variants)
149
+ npx playwright-director build-site --target public # merge targets.public over the config (§7b)
146
150
  npx playwright-director build-site -y # never prompt (CI; automatic without a TTY)
147
151
  npx playwright-director build-site --dev # astro dev with live reload, no build
148
152
  ```
@@ -150,6 +154,40 @@ npx playwright-director build-site --dev # astro dev with live rel
150
154
  Two themes from one config: build twice with `--theme` + `--base` + `--output`, and set
151
155
  `themeSwitcher` so each build links to the other.
152
156
 
157
+ ## 7b. Targets, include / exclude — a public and an internal site from one config
158
+
159
+ ```js
160
+ export default {
161
+ title: 'Académie', input: 'tutorials/', output: 'tutorials/site/dist/', baseUrl: '/', lang: 'fr',
162
+ tutorials: { categories: { general: { label: 'Général' }, admin: { label: 'Administration' } } },
163
+ targets: {
164
+ public: { output: 'tutorials/site/public/', tutorials: { exclude: { categories: ['admin'] } } }
165
+ }
166
+ };
167
+ ```
168
+
169
+ ```bash
170
+ npx playwright-director build-site # everything → tutorials/site/dist/
171
+ npx playwright-director build-site --target public # no admin tutorials → tutorials/site/public/
172
+ ```
173
+
174
+ - **`targets.<name>`** is deep-merged over the config: objects merge, arrays and plain values replace,
175
+ `null` deletes a key. No `--target` = the main config. An unknown name fails and lists the targets.
176
+ CLI flags (`--output`, `--base`, `--theme`) still win over the target.
177
+ - **`tutorials.exclude` / `include`**: `{ categories?: string[], slugs?: string[] }`. `categories` are
178
+ section ids (`tutorials.categories` keys — the section a tutorial is shown in: `items`, else its
179
+ `@feature:` tag); `slugs` are globs on the slug (`*` any, `?` one character), e.g. `['admin-*']`.
180
+ Published = matches `include` (or no `include`) and does not match `exclude`; matching = its
181
+ category is listed or its slug matches. `.<lang>` and `-<variant>` recordings follow their slug.
182
+ - An excluded tutorial leaves **no trace**: no page, no `embed/<slug>*.json`, no `embed/index.json`
183
+ entry, no `videos/<slug>*` file, nothing in search, sitemap, `links.json`, counts or durations.
184
+ Sections left empty are hidden; a role whose sections are all hidden is hidden.
185
+ - **Removing a section from `categories` (or setting it to `null` in a target) does not unpublish
186
+ it** — its tutorials ship under a detected section, with a warning. Use `exclude.categories`.
187
+ - Warnings, not failures: an excluded `featured` (falls back to the first published tutorial), an
188
+ excluded slug in `items` or `premium`. Nothing left to publish fails.
189
+ - Build into a fresh `output` folder: files from an earlier, larger build are not deleted.
190
+
153
191
  ## 8. Output
154
192
 
155
193
  | Path | Content |
@@ -170,3 +208,4 @@ Two themes from one config: build twice with `--theme` + `--base` + `--output`,
170
208
  - [ ] Tests that show an app screen set `links.app`; tests with a docs page set `links.docs`
171
209
  - [ ] Customization uses tokens first, `css` second, `overrides` last
172
210
  - [ ] `--only` builds are for checking a page — deploy a full build
211
+ - [ ] Internal tutorials stay out of a public build with `exclude` in a target, never by deleting their section
@@ -245,3 +245,49 @@ A real app makes the viewer wait: a report generates for 30 seconds, an import c
245
245
  ### Say it
246
246
 
247
247
  Announce the skip in the step's narration — "this takes a minute — let's skip ahead" — so the speed-up reads as a directing choice, not a glitch.
248
+
249
+ ## 11. Pick the Cut — Pace
250
+
251
+ Most videos are short clips inside documentation; some are a whole journey
252
+ shared on LinkedIn. You write the tutorial **once, in full**, and the pace
253
+ (`TUTORIAL_PACE`, `api.md` §15) chooses how much of it is spoken:
254
+
255
+ | Pace | Where it lives | Feels like | Typical length |
256
+ |---|---|---|---|
257
+ | `walkthrough` (default) | Onboarding, first-time setup, a full course | Someone sitting next to you, explaining every why | 1–3 min |
258
+ | `snippet` | A docs page, the in-app widget, "how do I…?" | A colleague showing you, fast | 20–45 s |
259
+ | `demo` | LinkedIn, a landing page, a sales email | A product trailer: it moves, it lands, it ends | 45–90 s |
260
+
261
+ The "why" is never wasted: a short cut doesn't speak it, but the gallery's step
262
+ guide still shows it — it is the page's text, and its SEO.
263
+
264
+ ### Write so every cut works
265
+
266
+ - **The first sentence carries the step.** `snippet` and `demo` say only the
267
+ `do` half (or the title, or the text before the first `'. '`). If the `do`
268
+ needs the `explain` to make sense, rewrite the `do`.
269
+ - **The goal title is the hook.** In the short cuts it is the whole opening —
270
+ one line over the live screen, no card in the middle. ≤ 12 words, an outcome:
271
+ "Send your first invoice in a minute", not "Invoicing module overview".
272
+ - **Clarifications are bonus material.** They are dropped by both short cuts,
273
+ so the story must hold without them. An `attention` survives in `snippet` —
274
+ keep it for what really can't be skipped.
275
+ - **Never two seconds of stillness.** The viewer should see the app from the
276
+ first frame and something moving within two seconds — a still screen under a
277
+ long sentence is where people leave. This is why the short cuts shrink the
278
+ opening to its title.
279
+
280
+ ### The demo cut is a trailer
281
+
282
+ - End on the payoff with a zoom (`§9`): the generated document, the "Paid"
283
+ status, the dashboard filling up. That's the frame people remember.
284
+ - Fast-forward generously (`§10`) — dead time is fatal on a feed.
285
+ - The completion message is the call to action: what the viewer gets, not "done".
286
+ - On a feed most people watch muted: the overlay title must tell the story on its own.
287
+
288
+ ### Word budget
289
+
290
+ TTS speaks about 2.5 words per second. Before writing, check what each cut will
291
+ say: a 40 s `snippet` holds ~100 spoken words in all (goal title + every `do` +
292
+ completion). If the `do` halves alone overflow, the tutorial has too many steps
293
+ — group them (§6) or split the tutorial.