decklight 0.8.1 → 0.10.0

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 (138) hide show
  1. package/PLATFORM.md +707 -0
  2. package/README.md +226 -150
  3. package/SPEC.md +803 -888
  4. package/cli/agent-review.mjs +246 -0
  5. package/cli/agents.mjs +35 -9
  6. package/cli/associate.mjs +12 -12
  7. package/cli/audit.mjs +42 -10
  8. package/cli/banner.mjs +41 -17
  9. package/cli/bundle-audio.mjs +190 -0
  10. package/cli/bundle-module.mjs +95 -0
  11. package/cli/bundle.mjs +439 -35
  12. package/cli/cast.mjs +48 -12
  13. package/cli/check-fixes.mjs +186 -0
  14. package/cli/check.mjs +988 -0
  15. package/cli/clone-deck.mjs +179 -0
  16. package/cli/commands.mjs +345 -0
  17. package/cli/comments.mjs +64 -18
  18. package/cli/commit-flow.mjs +51 -22
  19. package/cli/commit-message.mjs +51 -74
  20. package/cli/commit-split.mjs +601 -0
  21. package/cli/deck-refs.mjs +64 -0
  22. package/cli/deck-routes.mjs +67 -0
  23. package/cli/deckfile.mjs +3 -5
  24. package/cli/decklight.mjs +68 -289
  25. package/cli/design-system-deps.mjs +209 -0
  26. package/cli/design-system-edit.mjs +194 -0
  27. package/cli/design-system-refs.mjs +666 -0
  28. package/cli/design-system.mjs +497 -0
  29. package/cli/doctor.mjs +115 -0
  30. package/cli/edit-git.mjs +353 -0
  31. package/cli/edit-handover.mjs +551 -0
  32. package/cli/edit-look.mjs +631 -0
  33. package/cli/edit-slides.mjs +683 -0
  34. package/cli/edit.mjs +2585 -855
  35. package/cli/enhance.mjs +485 -0
  36. package/cli/extension.mjs +10 -10
  37. package/cli/font-refs.mjs +273 -0
  38. package/cli/font.mjs +246 -0
  39. package/cli/git-tree.mjs +1 -1
  40. package/cli/git.mjs +78 -11
  41. package/cli/import.mjs +56 -10
  42. package/cli/init.mjs +407 -236
  43. package/cli/library.mjs +127 -0
  44. package/cli/loader.mjs +3 -1
  45. package/cli/marketplace-autocheck.mjs +200 -0
  46. package/cli/marketplace.mjs +460 -29
  47. package/cli/narrate.mjs +251 -0
  48. package/cli/open-browser.mjs +63 -0
  49. package/cli/open.mjs +961 -0
  50. package/cli/pdf.mjs +64 -17
  51. package/cli/pkg.mjs +44 -2
  52. package/cli/plugin.mjs +43 -41
  53. package/cli/port-conflict.mjs +53 -23
  54. package/cli/pptx-export.mjs +63 -27
  55. package/cli/publish.mjs +8 -4
  56. package/cli/qr.mjs +1 -1
  57. package/cli/record.mjs +85 -23
  58. package/cli/remote.mjs +43 -17
  59. package/cli/restore.mjs +11 -4
  60. package/cli/review-ref.mjs +125 -0
  61. package/cli/review-remote.mjs +92 -48
  62. package/cli/review-routes.mjs +254 -0
  63. package/cli/review-store.mjs +47 -7
  64. package/cli/review-submit.mjs +47 -57
  65. package/cli/runtime-link.mjs +560 -0
  66. package/cli/serve.mjs +236 -45
  67. package/cli/setup.mjs +112 -0
  68. package/cli/sign.mjs +1 -1
  69. package/cli/skill-content.mjs +229 -35
  70. package/cli/skills.mjs +353 -26
  71. package/cli/start.mjs +110 -0
  72. package/cli/supervise.mjs +6 -6
  73. package/cli/theme-refs.mjs +527 -0
  74. package/cli/theme.mjs +181 -137
  75. package/cli/trust.mjs +83 -0
  76. package/cli/units.mjs +112 -47
  77. package/cli/update-check.mjs +1 -5
  78. package/cli/upgrade.mjs +194 -28
  79. package/cli/upstream.mjs +4 -3
  80. package/cli/util.mjs +4 -4
  81. package/cli/wizard.mjs +6 -6
  82. package/dist/build-info.json +1 -1
  83. package/dist/decklight.css +1533 -59
  84. package/dist/decklight.js +258 -115
  85. package/dist/decklight.js.map +4 -4
  86. package/docs/GLOSSARY.md +141 -0
  87. package/docs/architecture.svg +17 -17
  88. package/package.json +4 -2
  89. package/themes/README.md +9 -8
  90. package/themes/reveal-solarized.css +10 -0
  91. package/tools/args.mjs +20 -0
  92. package/tools/atomic-write.mjs +48 -0
  93. package/tools/brand-palette.mjs +717 -0
  94. package/tools/bridge.mjs +1 -1
  95. package/tools/build-groups.mjs +42 -0
  96. package/tools/color.mjs +48 -0
  97. package/tools/deck-html.mjs +396 -11
  98. package/tools/design-system-format.mjs +778 -0
  99. package/tools/design-system-migrations.mjs +207 -0
  100. package/tools/elevenlabs-tts.mjs +110 -17
  101. package/tools/exec.mjs +11 -3
  102. package/tools/extension-check.mjs +31 -7
  103. package/tools/font-format.mjs +190 -0
  104. package/tools/font-stacks.mjs +24 -0
  105. package/tools/gemini-tts.mjs +3 -0
  106. package/tools/lipsync-config.mjs +103 -0
  107. package/tools/lipsync-engines.mjs +205 -2
  108. package/tools/lipsync-server.mjs +264 -41
  109. package/tools/lipsync.mjs +37 -18
  110. package/tools/local-voice.mjs +32 -42
  111. package/tools/narration-manifest.mjs +270 -0
  112. package/tools/narration-synth.mjs +416 -0
  113. package/tools/pptx.mjs +776 -19
  114. package/tools/publish-targets.mjs +1 -1
  115. package/tools/publish-voices.mjs +3 -3
  116. package/tools/recording-impact.mjs +7 -3
  117. package/tools/render-theme.mjs +33 -0
  118. package/tools/review-anchor.mjs +28 -12
  119. package/tools/semver.mjs +40 -0
  120. package/tools/sentences.mjs +180 -0
  121. package/tools/shot.mjs +14 -7
  122. package/tools/site-clip.mjs +114 -0
  123. package/tools/site-voices.mjs +232 -0
  124. package/tools/template-theme.mjs +1 -1
  125. package/tools/test-impact.mjs +17 -10
  126. package/tools/theme-check.mjs +30 -3
  127. package/tools/tts-cache.mjs +4 -3
  128. package/tools/tts-engines.mjs +38 -20
  129. package/tools/tts-setup.mjs +7 -7
  130. package/tools/video-options.mjs +34 -0
  131. package/tools/video.mjs +530 -54
  132. package/tools/voiceover-server.mjs +185 -104
  133. package/tools/voiceover.mjs +119 -261
  134. package/tools/zip.mjs +1 -1
  135. package/cli/dev.mjs +0 -623
  136. package/cli/present.mjs +0 -853
  137. package/cli/review.mjs +0 -361
  138. package/tools/publish-site-voices.mjs +0 -75
@@ -14,6 +14,7 @@
14
14
  */
15
15
 
16
16
  import fs from 'node:fs';
17
+ import os from 'node:os';
17
18
  import path from 'node:path';
18
19
 
19
20
  // Imported and re-exported, not redefined: the package root has one
@@ -25,9 +26,11 @@ import { PKG_ROOT, PKG } from './pkg.mjs';
25
26
  export { PKG_ROOT, PKG };
26
27
 
27
28
  /**
28
- * The authoring contract, sliced from SPEC.md through JS_API (everything an
29
- * agent needs to write slides), dropping the repo-layout/tooling section
30
- * that only matters to Decklight's own contributors.
29
+ * The authoring contract: SPEC.md up to REPO_LAYOUT, which only matters to
30
+ * Decklight's own contributors. The platform contract (the marketplace and
31
+ * the library's units) lives in PLATFORM.md, which SPEC.md points at and the
32
+ * skill does not install: an agent writing slides rarely needs it, and it
33
+ * was a third of every project's reference.md.
31
34
  */
32
35
  export function referenceDoc() {
33
36
  const spec = fs.readFileSync(path.join(PKG_ROOT, 'SPEC.md'), 'utf8');
@@ -40,20 +43,38 @@ export function referenceDoc() {
40
43
  * progressive-disclosure body that points at `referenceHref` (a path
41
44
  * relative to the SKILL.md) for the full contract.
42
45
  */
46
+ /**
47
+ * The version a skill was written by, as a comment the file carries — read
48
+ * back by `decklight skills` (a skill older than this build is refreshed
49
+ * without --force) and by write mode's startup (which names one that is
50
+ * older than the install, since an agent reading it reads an old contract).
51
+ */
52
+ export const SKILL_STAMP = (version = PKG.version) => `<!-- decklight skill ${version} -->`;
53
+ export function skillVersionOf(text) {
54
+ const m = /<!-- decklight skill (\d+\.\d+\.\d+[^\s]*) -->/.exec(String(text ?? ''));
55
+ return m ? m[1] : null;
56
+ }
57
+
43
58
  export function claudeSkillMd(referenceHref = 'reference.md') {
44
59
  return `---
45
60
  name: decklight
46
- description: Author and edit Decklight presentations — single-file HTML decks with Keynote-style builds, theme-aware SVG diagrams, 46 built-in themes, truthful terminal recordings, and live TTS narration. Use whenever creating or editing a Decklight deck (a .html file with a <div class="decklight"> of <section> slides) in this project.
61
+ description: Author and edit Decklight presentations — single-file HTML decks with Keynote-style builds, theme-aware SVG diagrams, 46 built-in themes, a company's design system (its templates, brand themes and roles), truthful terminal recordings, and live TTS narration. Use whenever creating or editing a Decklight deck (a .html file with a <div class="decklight"> of <section> slides) in this project.
47
62
  ---
63
+ ${SKILL_STAMP()}
48
64
 
49
- Decklight decks are one HTML file: no build step, no bundler, no server to
50
- author. A deck is \`<div class="decklight">\` containing \`<section>\` slides;
51
- the runtime is one JS file + one CSS file + one theme CSS file.
65
+ Decklight decks are one HTML file of slides: no build step, no bundler. A deck
66
+ is \`<div class="decklight">\` containing \`<section>\` slides, plus one JSON
67
+ configuration block (\`<script type="application/json" data-decklight-config>\`)
68
+ — and nothing that executes: no runtime in the file, no \`Decklight.init\` call.
69
+ \`decklight <deck>\` (write mode or \`--no-trust\`) adds the installed runtime as it
70
+ serve it, and \`decklight bundle\` embeds it into one self-contained file to hand
71
+ over. Write slides and configuration; never write boilerplate.
52
72
 
53
73
  **Full authoring contract**: read [${referenceHref}](${referenceHref}) in this same
54
74
  skill directory before authoring or editing a slide — SLIDE_DENSITY is how much goes on
55
75
  one, COMPARISON_SLIDES is the worked comparison (pros/cons) slide, and past those it covers builds,
56
- speaker notes segmentation (⟨CLICK⟩), SVG diagrams, theming, motion, code
76
+ speaker notes segmentation ([click]), SLIDE_SOURCES (where a slide got what it says),
77
+ SVG diagrams, theming, motion, code
57
78
  blocks, LaTeX math, terminal recordings, narration, and the public JS API. It's sliced
58
79
  straight from Decklight's SPEC.md (v${PKG.version}), so it won't drift from
59
80
  the installed runtime's actual behavior — trust it over prior training.
@@ -70,15 +91,79 @@ with a build and notes already wired):
70
91
  </div>
71
92
  \`\`\`
72
93
 
94
+ A long deck can be split into chapters with \`data-module\` on the section that
95
+ starts one — every slide after it belongs to that chapter until the next marker.
96
+ The deck shows the current chapter in its chrome and shows them as a foldable
97
+ outline in the slide finder (**G**). Use it for a course or a multi-module deck; a
98
+ fifteen-slide talk does not need chapters:
99
+
100
+ \`\`\`html
101
+ <section data-module="Foundations"><h2>Foundations</h2></section>
102
+ \`\`\`
103
+
104
+ Two asides, and they are not the same thing. \`notes\` is what the speaker SAYS.
105
+ \`sources\` is where the slide got what it says — named facts and links a reader
106
+ can follow, hidden on the slide and opened with **I**. Add it when a slide makes
107
+ a claim worth attributing; leave it off when it does not:
108
+
109
+ \`\`\`html
110
+ <aside class="sources">
111
+ <dl><dt>owner</dt><dd>platform-team</dd><dt>reviewed</dt><dd>2026-08-14</dd></dl>
112
+ <ul><li><a href="https://…/KIP-98">KIP-98</a> — the original proposal</li></ul>
113
+ </aside>
114
+ \`\`\`
115
+
116
+ **Cite as you build.** When a deck is made from material (a PDF, a web page, a
117
+ document, a transcript, files in a repository) the user gave you or you looked
118
+ up, every slide that states something taken from it gets its \`sources\` aside
119
+ **while you write the slide**, not in a pass at the end, when you no longer
120
+ know which page a number came from. One link per source the slide stands on:
121
+
122
+ - **Name the part, not just the source**, whenever the source is bigger than
123
+ what you used: the pages of a PDF (\`report.pdf#page=12\`, note \`pp. 12–14\`),
124
+ the section of a web page (its \`#anchor\`, or a text fragment
125
+ \`#:~:text=first%20words\`), the heading of a document, the lines of a file
126
+ (\`src/server.ts\`, note \`lines 40–88\`), the minutes of a recording. The link
127
+ opens where you read; the note says how much.
128
+ - **A local file is linked by its path relative to the deck**, so the link
129
+ still opens after the deck moves with it.
130
+ - **Cite only what you actually opened and read.** Never a source you did not
131
+ read, never a page you did not read, and never a link you reconstructed from
132
+ memory. A slide built from your own general knowledge carries no link that
133
+ pretends otherwise: leave it unsourced and say so in the report below.
134
+
135
+ \`\`\`html
136
+ <aside class="sources">
137
+ <ul>
138
+ <li><a href="docs/annual-report-2025.pdf#page=12">Annual report 2025</a> — pp. 12–14, revenue by region</li>
139
+ <li><a href="https://example.com/pricing#enterprise">Pricing page</a> — Enterprise tier only</li>
140
+ </ul>
141
+ </aside>
142
+ \`\`\`
143
+
144
+ **Then tell the user what the deck stands on.** When you finish a deck (or a
145
+ batch of slides), end your reply with a sources report, so they can check the
146
+ deck against its material without opening every slide:
147
+
148
+ - each source you used, with the parts of it you used (pages, sections,
149
+ headings, lines) and the slides that cite it;
150
+ - each source you were given but did not use, and why (off topic, unreadable,
151
+ a scanned PDF with no text layer);
152
+ - each slide that makes claims with no source behind it, so the user knows
153
+ which ones rest on your general knowledge.
154
+
155
+ Keep the report in your reply, not on a slide: the deck already carries the same
156
+ facts, per slide, in its \`sources\` asides.
157
+
73
158
  **CLI** (\`npx decklight@latest <command>\`, no install needed):
74
- - \`decklight author deck.html\` — the whole authoring loop: serve with live reload; **E** in the browser edits speaker notes back into the file
75
- - \`decklight cast script.term.yaml\` — record a truthful terminal cast in a real PTY, for \`<div class="terminal">\` (this records a TERMINAL; \`decklight record\` records the author's voice)
159
+ - \`decklight deck.html\` — the whole authoring loop: serve with live reload; editing is on in the browser — text, pictures, layouts and speaker notes are written back into the file
160
+ - \`decklight cast script.term.yaml\` — record a truthful terminal cast in a real PTY, for \`<div class="terminal">\` (this records a TERMINAL; \`decklight narrate --mic\` records the author's voice)
76
161
  - \`decklight bundle deck.html --themes all\` — flatten into one self-contained file to hand off or publish
77
162
  - \`decklight pdf deck.html\` — render every slide to a PDF, and report the ones that overflow
78
163
  - \`decklight pptx deck.html\` — a PowerPoint file for whoever asks for one: every slide a picture, the notes real notes (lossy on purpose)
79
- - \`decklight tts\` — live voice bridge so the deck can narrate itself on the fly
80
- - \`decklight record deck.html\` — record the narration in the author's OWN voice: the deck shows one \`⟨CLICK⟩\` beat at a time and \`→\` ends it, writing \`slide-NN-KK.wav\` per beat so the recording paces the builds (play it back with \`narration: { files: 'voiceover', ext: 'wav', segments: true }\`)
81
- - \`decklight review deck.html\` / \`decklight comments deck.html\` — reviewer comments on slides, stored append-only in \`<deck>.review.jsonl\` and carried by git; a comment records the slide's title and a fingerprint of its text, so it finds its slide again after the deck moves and says so when the slide changed or is gone; \`decklight review submit deck.html\` pushes the review to a \`review/<you>-<date>\` branch (one file, never the reviewer's own commits; \`--pr\` opens the pull request), and the author hears about waiting reviews at \`decklight author\` startup, in the M overlay, and via \`decklight comments deck.html --incoming\`
164
+ - \`decklight setup voice\` — set up live narration once (which engine, what it needs); every deck opened after uses it
165
+ - \`decklight narrate --mic deck.html\` — record the narration in the author's OWN voice: the deck shows one \`[click]\` beat at a time and \`→\` ends it, writing \`slide-NN-KK.wav\` per beat so the recording paces the builds (play it back with \`narration: { files: 'voiceover', ext: 'wav', segments: true }\`)
166
+ - \`decklight deck.html --no-trust\` (M to comment) / \`decklight comments deck.html\` — reviewer comments on slides, stored append-only in \`<deck>.review.jsonl\` and carried by git; a comment records the slide's title and a fingerprint of its text, so it finds its slide again after the deck moves and says so when the slide changed or is gone; \`decklight comments submit deck.html\` pushes the review to a \`review/<you>-<date>\` branch (one file, never the reviewer's own commits; \`--pr\` opens the pull request), and the author hears about waiting reviews at startup in write mode, in the M overlay, and via \`decklight comments deck.html --incoming\`
82
167
  - \`decklight skills\` — regenerate this skill after upgrading Decklight
83
168
 
84
169
  **Render the deck before you call a slide done.** Content that exceeds a slide
@@ -95,7 +180,9 @@ or move the detail into the notes. Run it after each batch of slides rather
95
180
  than once at the end — and note that overflow is the *late* failure. A slide
96
181
  that fits can still be too crowded to present from; prefer ~3–4 bullets or ~2
97
182
  short paragraphs per column, and one idea per slide, over anything that merely
98
- fits (SLIDE_DENSITY).
183
+ fits (SLIDE_DENSITY). \`npx decklight@latest check deck.html\` names those
184
+ too: a slide past that budget is reported \`crowded\` with the count that
185
+ tipped it (a warning, never a failed run); split it rather than shrink it.
99
186
 
100
187
  **For a comparison slide, use \`data-layout="split"\` — and do not also write
101
188
  your own column flexbox.** Two sibling blocks become the columns, a third
@@ -107,28 +194,95 @@ COMPARISON_SLIDES has the markup. The engine marks the mixed state
107
194
  same \`decklight pdf\` run above names such slides — one render check catches
108
195
  both.
109
196
 
197
+ **A diagram line that draws is one stroke, with everything on it.** A
198
+ \`data-build="draw"\` container draws its strokes in; an arrowhead is a
199
+ \`<marker>\` on the stroke's \`marker-end\` (it rides the tip), a dashed line is
200
+ \`stroke-dasharray\` on the stroke (it draws dashed, start to finish), and a
201
+ line in stages is \`data-draw-stops\`. A separate arrowhead shape, or dashes set
202
+ from a stylesheet class, do not draw as one: the head stands at the end before
203
+ the line arrives, the dashes snap in when it ends. Group a line with the box it
204
+ points at when they should arrive together; keep it a direct child when the
205
+ line is its own beat. The engine adds \`.draw-head\` and \`.draw-mask\` nodes
206
+ beside a drawing stroke in the browser: they are not in the file, so never
207
+ copy them from the rendered DOM into the deck. SVG_DIAGRAMS has the rules.
208
+
209
+ **On a deck that uses a design system, fill its templates' slots — never
210
+ recreate a template's structure by hand.** A slide names a template and
211
+ supplies one element per slot (\`<section data-template="acme/section-divider">\`
212
+ with \`<h2 data-slot="title">\`); the structure comes from the design system
213
+ when the deck renders, so copied markup never updates with it.
214
+ \`decklight design-system templates acme@<marketplace>\` lists the templates and
215
+ their slots (\`*\` required); \`decklight check\` names a missing template or slot,
216
+ a slot filled twice and a required one left empty (DESIGN_SYSTEMS in the reference).
217
+
218
+ **On a deck held to a design system's brand, colour through its roles.** A
219
+ design system that ships a palette and its own themes holds the deck to them
220
+ (\`"brandThemesOnly"\` unset): the deck opens only on the brand's themes, and
221
+ every colour a slide names is the brand's. When it declares roles, write
222
+ \`var(--acme-color-text-accent)\` (\`--<prefix>color-<role>\`, the roles are in
223
+ \`design-system.json\`), never a swatch (\`var(--acme-blue-600)\`), the theme
224
+ contract (\`var(--accent)\`, \`var(--d-fill-2)\`), one of its other tokens, or a
225
+ literal: each theme sets every role, so \`T\` recolours the deck and nothing
226
+ drifts off-brand. A diagram fill the contract maps to a role is written as that
227
+ role and still nests like its slot. \`decklight check\` says \`off-role\` (a
228
+ colour that is not a role, with the nearest one), \`off-palette-literal\` (on a
229
+ brand without roles) and \`theme-off-brand\` (a configured theme outside the
230
+ brand); \`"brandThemesOnly": false\` is the author's way out, never yours to
231
+ add (BRAND_PALETTE and DESIGN_SYSTEM_ROLES in the reference). \`check\` says
232
+ \`ds-behind\` when the deck was written for an older major of its design
233
+ system: migrate it (\`decklight design-system migrate <ref> <deck>\`, or the
234
+ skill the warning names) rather than fixing each renamed name by hand
235
+ (DESIGN_SYSTEM_MIGRATIONS).
236
+
110
237
  Speaker notes drive both live narration and the transcript/caption
111
238
  features, so write them even for decks that will only ever be read: split
112
- multi-beat notes with a bare \`⟨CLICK⟩\` line so narration and build steps
113
- stay in sync (PRESENTING in the reference).
114
-
115
- **Commit your own changes when an authoring server is running.** \`decklight
116
- author\` auto-commits the deck, but on a timer and under a generic \`autosave\`
117
- message — it cannot tell your edits from anyone else's, because it did not
118
- start you. When you finish one logical change, say so:
239
+ multi-beat notes with a bare \`[click]\` line so narration and build steps
240
+ stay in sync (PRESENTING in the reference). Where an idea needs a moment to
241
+ land, put \`[pause]\` there (\`[long pause]\` for twice that) and it is never
242
+ said: ElevenLabs v4/v3 holds it itself, in its own breath; for every other
243
+ voice decklight holds it (two beat pauses, 1s by default). Use it sparingly —
244
+ at the few moments that earn it. Write the markers in square brackets; the
245
+ older \`<pause>\` and \`⟨PAUSE⟩\` spellings still read the same.
246
+ Any other bracketed words — \`[whispers]\`, \`[laughs]\` — are audio tags for
247
+ ElevenLabs v4 (the default ElevenLabs model) and v3; every other voice leaves
248
+ them out, and captions never show them, so the notes read the same anywhere.
249
+
250
+ **Prompting ElevenLabs v4 in the notes.** When ElevenLabs narrates, the notes
251
+ ARE the prompt ([its best practices](https://elevenlabs.io/docs/overview/capabilities/text-to-speech/best-practices#prompting-eleven-v4)):
252
+ natural sentences and punctuation do most of the work; a tag goes right before
253
+ what it directs (\`[whispers]\`, \`[curious]\`, \`[laughs]\`), suits the voice, and
254
+ earns its place, one or two a slide; pauses are \`[pause]\`, never \`<break>\`.
255
+ \`decklight enhance deck.html --slides 3\` adds tags with ElevenLabs' own prompt
256
+ and writes only answers that kept every word, \`[click]\` and \`[pause]\`. Editing
257
+ by hand, follow the same rules: add tags, never reword the author's script.
258
+
259
+ **Notes are said, not read.** Write them as sentences a person would say out
260
+ loud — "And if you fluff a line, just press Backspace to take it again", not
261
+ "Fluffed a line? Backspace retakes it." — and say symbols as words ("Command",
262
+ not "⌘"). To rewrite terse notes that way when asked, \`decklight enhance
263
+ deck.html --spoken --slides 3\` does it with the same checks on the beats and
264
+ the pauses.
265
+
266
+ **Installed marketplace skills sit beside this one.** \`decklight library add
267
+ skill <name>\` installs a skill from a marketplace into
268
+ \`~/.decklight/skills/<name>/SKILL.md\` (\`$DECKLIGHT_HOME/skills/\` when that is
269
+ set) and copies it next to this skill. When a task is one a skill there
270
+ describes — migrating a deck to a new major version of its design system, say —
271
+ list that directory, read the SKILL.md whose \`description\` fits, and follow
272
+ it together with this contract.
273
+
274
+ **Commit your own changes when an edit server is running.** It snapshots
275
+ silently and commits only when told; you are not an agent it started, so
276
+ after each logical change:
119
277
 
120
278
  \`\`\`sh
121
- curl -sf -X POST localhost:8788/edit/commit \\
122
- -H 'content-type: application/json' \\
123
- -d '{"message":"split the crowded video slides"}'
279
+ curl -sf -X POST localhost:8788/deck/edit/commit \\
280
+ -H 'content-type: application/json' -d '{"message":"split the crowded video slides"}'
124
281
  \`\`\`
125
282
 
126
- One call per logical change, with a subject describing THAT change — not
127
- \"updated the deck\". It commits only the deck file, and does nothing when
128
- nothing changed, so an extra call is harmless. If the port is not listening
129
- there is no authoring server: skip it silently and carry on, never start one
130
- yourself. This is what makes a history someone can read afterwards, instead
131
- of a wall of identical timer commits.
283
+ A subject for THAT change, never "updated the deck". It commits only the deck
284
+ and is a no-op when nothing changed. Nothing listening on the port: skip it
285
+ silently, and never start a server yourself.
132
286
 
133
287
  **That history is readable, and it is how a bad edit is undone.** \`decklight
134
288
  history deck.html\` lists every commit that touched the deck and marks the ones
@@ -150,34 +304,73 @@ export const AGENTS_MARKER = '<!-- decklight:skill -->';
150
304
  * marker pair lets `init`/`skills` refresh the block in place instead of
151
305
  * appending a duplicate.
152
306
  */
153
- export function agentsSection(referenceHref = '.claude/skills/decklight/reference.md') {
307
+ export function agentsSection(referenceHref = '.claude/skills/decklight/reference.md', { librarySkills = [] } = {}) {
154
308
  return `${AGENTS_MARKER}
309
+ ${SKILL_STAMP()}
155
310
  ## Decklight decks
156
311
 
157
312
  This project contains a Decklight presentation (a single-file HTML deck —
158
313
  see \`${referenceHref}\` for the full authoring
159
- contract: builds, notes, SVG diagrams, themes, terminals, narration).
314
+ contract: builds, notes, sources, SVG diagrams, themes, terminals, narration).
160
315
  Read that file before adding or editing slides.
161
316
 
317
+ When slides come from material (PDFs, web pages, documents, files), give each
318
+ slide a \`<aside class="sources">\` as you write it, linking the part it uses
319
+ (PDF pages via \`#page=N\`, a page section via its anchor, file lines in the
320
+ note), cite only what you actually read, and end with a report to the user of
321
+ each source, the parts used, the slides citing it, and the slides with none.
322
+
162
323
  After editing slides, render the deck and check nothing is clipped:
163
324
  \`npx decklight@latest pdf deck.html -o /tmp/check.pdf\` — every \`⚠ slide N overflows\`
164
325
  line is a slide losing content. Overflow is the late failure, though: a slide
165
326
  that fits can still be too crowded, so keep to one idea and ~3–4 bullets per
166
327
  column rather than to whatever renders.
167
328
 
168
- When an authoring server is running (\`decklight author\`), commit each logical
329
+ On a deck with a design system, a slide fills a template's slots
330
+ (\`<section data-template="acme/section-divider">\` and children carrying
331
+ \`data-slot\`, listed by \`decklight design-system templates <ref>\`) and never
332
+ recreates its structure by hand; \`decklight check deck.html\` names any slot
333
+ or template the design system does not have. On a design system with roles,
334
+ every colour is a role (\`var(--acme-color-<role>)\`), never a swatch, a theme
335
+ token or a literal; \`check\` names each one that is not (\`off-role\`).
336
+
337
+ When the deck is open in write mode (\`decklight deck.html\`), commit each logical
169
338
  change you finish rather than leaving it to the timer's generic \`autosave\`:
170
- \`curl -sf -X POST localhost:8788/edit/commit -H 'content-type: application/json'
339
+ \`curl -sf -X POST localhost:8788/deck/edit/commit -H 'content-type: application/json'
171
340
  -d '{"message":"what this change did"}'\`. No server listening means no
172
341
  authoring session — skip it and carry on.
173
342
 
174
- Hit a Decklight bug? Run \`npx decklight@latest report-bug\` for the environment
343
+ ${librarySkillLines(librarySkills)}Hit a Decklight bug? Run \`npx decklight@latest report-bug\` for the environment
175
344
  facts, then ask the user what happened, what they expected, and the smallest
176
345
  repro — and show them the whole issue before filing anything.
177
346
  ${AGENTS_MARKER}
178
347
  `;
179
348
  }
180
349
 
350
+ /** A path as an agent should read it on this machine: `~/…` under $HOME. */
351
+ export function homePath(file) {
352
+ const home = os.homedir();
353
+ return home && file.startsWith(home + path.sep) ? `~${file.slice(home.length)}` : file;
354
+ }
355
+
356
+ /**
357
+ * The installed marketplace skills (`librarySkills` in units.mjs), one line
358
+ * each, for an agent that reads AGENTS.md and nothing else (#880): no
359
+ * directory of skills is indexed for it, so the line is the only way it
360
+ * learns one exists. Nothing installed, no paragraph.
361
+ */
362
+ function librarySkillLines(skills) {
363
+ if (!skills.length) return '';
364
+ // `- <name>: <description> Read <path>.` — a description is a sentence of its own
365
+ const sentence = (d) => (d ? `${d.replace(/\s+/g, ' ').trim()}${/[.!?]$/.test(d.trim()) ? '' : '.'} ` : '');
366
+ const lines = skills.map((s) => `- ${s.name}: ${sentence(s.description)}Read \`${homePath(path.join(s.path, 'SKILL.md'))}\`.`);
367
+ return `Installed marketplace skills (\`decklight library add skill\`). Before a task
368
+ one of them describes, read its SKILL.md and follow it:
369
+ ${lines.join('\n')}
370
+
371
+ `;
372
+ }
373
+
181
374
  /**
182
375
  * The `decklight-report-bug` skill (#73): the conversational half of filing a
183
376
  * bug, which the print-and-exit CLI deliberately does not do.
@@ -194,6 +387,7 @@ export function reportBugSkillMd() {
194
387
  name: decklight-report-bug
195
388
  description: File a Decklight bug report — gather version and environment facts, ask what broke and how to reproduce it, optionally attach a headless screenshot, and open the issue only after the user approves the full text. Use when the user hits a Decklight bug or asks to report one.
196
389
  ---
390
+ ${SKILL_STAMP()}
197
391
 
198
392
  Help the user file a bug report against Decklight that a triager can act on
199
393
  without a round trip. Work in this order.