@ohos-ports/slides-grab 1.5.0-beta.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README-ko.md +292 -0
  3. package/README.md +301 -0
  4. package/bin/ohos-postinstall.cjs +118 -0
  5. package/bin/ppt-agent.js +620 -0
  6. package/convert.cjs +20 -0
  7. package/native/@img/sharp-libvips-openharmony-arm64/lib/glib-2.0/include/glibconfig.h +220 -0
  8. package/native/@img/sharp-libvips-openharmony-arm64/lib/index.js +1 -0
  9. package/native/@img/sharp-libvips-openharmony-arm64/lib/libexpat.so +0 -0
  10. package/native/@img/sharp-libvips-openharmony-arm64/lib/libffi.so +0 -0
  11. package/native/@img/sharp-libvips-openharmony-arm64/lib/libjpeg.so +0 -0
  12. package/native/@img/sharp-libvips-openharmony-arm64/lib/libpcre2-8.so.0 +0 -0
  13. package/native/@img/sharp-libvips-openharmony-arm64/lib/libvips-cpp.so.42.20.3 +0 -0
  14. package/native/@img/sharp-libvips-openharmony-arm64/lib/libvips.so.42.20.3 +0 -0
  15. package/native/@img/sharp-libvips-openharmony-arm64/package.json +13 -0
  16. package/native/@img/sharp-openharmony-arm64/lib/sharp-openharmony-arm64.node +0 -0
  17. package/native/@img/sharp-openharmony-arm64/package.json +16 -0
  18. package/package.json +95 -0
  19. package/runtimes/claude-code/agents/design-critic-agent.md +23 -0
  20. package/runtimes/codex/agents/slides-grab-design-critic.md +22 -0
  21. package/scripts/build-viewer.js +444 -0
  22. package/scripts/design-gate.js +258 -0
  23. package/scripts/download-video.js +213 -0
  24. package/scripts/editor-server.js +1167 -0
  25. package/scripts/figma-export.js +169 -0
  26. package/scripts/generate-image.js +116 -0
  27. package/scripts/generate-images.js +164 -0
  28. package/scripts/html2pdf.js +822 -0
  29. package/scripts/html2png.js +246 -0
  30. package/scripts/html2pptx.js +162 -0
  31. package/scripts/import-template.js +86 -0
  32. package/scripts/install-runtime.js +216 -0
  33. package/scripts/render-tldraw.js +44 -0
  34. package/scripts/validate-slides.js +221 -0
  35. package/skills/slides-grab/SKILL.md +65 -0
  36. package/skills/slides-grab/references/presentation-workflow-reference.md +61 -0
  37. package/skills/slides-grab-card-news/SKILL.md +35 -0
  38. package/skills/slides-grab-design/SKILL.md +88 -0
  39. package/skills/slides-grab-design/references/beautiful-slide-defaults.md +88 -0
  40. package/skills/slides-grab-design/references/design-gate.md +349 -0
  41. package/skills/slides-grab-design/references/design-rules.md +76 -0
  42. package/skills/slides-grab-design/references/design-system-full.md +568 -0
  43. package/skills/slides-grab-design/references/detailed-design-rules.md +70 -0
  44. package/skills/slides-grab-export/SKILL.md +55 -0
  45. package/skills/slides-grab-export/references/export-rules.md +27 -0
  46. package/skills/slides-grab-export/references/html2pptx.md +627 -0
  47. package/skills/slides-grab-export/references/ooxml.md +427 -0
  48. package/skills/slides-grab-export/references/pptx-skill-reference.md +189 -0
  49. package/skills/slides-grab-html/SKILL.md +67 -0
  50. package/skills/slides-grab-image/SKILL.md +82 -0
  51. package/skills/slides-grab-plan/SKILL.md +68 -0
  52. package/skills/slides-grab-plan/references/design-md-to-slides-conversion.md +135 -0
  53. package/skills/slides-grab-plan/references/outline-format.md +47 -0
  54. package/skills/slides-grab-plan/references/plan-workflow-reference.md +140 -0
  55. package/src/codex-imagen.js +182 -0
  56. package/src/design-diversity-data.js +6932 -0
  57. package/src/design-gate-report.js +244 -0
  58. package/src/design-gate-state.js +329 -0
  59. package/src/design-import.js +164 -0
  60. package/src/design-md-parser.js +415 -0
  61. package/src/design-styles-data.js +1928 -0
  62. package/src/design-styles.js +209 -0
  63. package/src/editor/codex-edit.js +584 -0
  64. package/src/editor/edit-subprocess.js +170 -0
  65. package/src/editor/editor-codex-prompt.md +50 -0
  66. package/src/editor/editor.html +1785 -0
  67. package/src/editor/js/editor-bbox.js +332 -0
  68. package/src/editor/js/editor-chat.js +56 -0
  69. package/src/editor/js/editor-direct-edit.js +238 -0
  70. package/src/editor/js/editor-dom.js +59 -0
  71. package/src/editor/js/editor-init.js +405 -0
  72. package/src/editor/js/editor-navigation.js +54 -0
  73. package/src/editor/js/editor-select.js +558 -0
  74. package/src/editor/js/editor-send.js +175 -0
  75. package/src/editor/js/editor-sse.js +163 -0
  76. package/src/editor/js/editor-state.js +41 -0
  77. package/src/editor/js/editor-type.js +71 -0
  78. package/src/editor/js/editor-utils.js +167 -0
  79. package/src/editor/js/model-registry.js +37 -0
  80. package/src/editor/screenshot.js +82 -0
  81. package/src/export-resolution.cjs +68 -0
  82. package/src/figma.js +71 -0
  83. package/src/html2pptx-scale.cjs +120 -0
  84. package/src/html2pptx.cjs +1262 -0
  85. package/src/image-contract.js +329 -0
  86. package/src/image-native.js +468 -0
  87. package/src/nano-banana.js +841 -0
  88. package/src/ohos-browser-bridge.cjs +272 -0
  89. package/src/pptx-raster-export.cjs +299 -0
  90. package/src/resolve.js +110 -0
  91. package/src/slide-mode.cjs +72 -0
  92. package/src/template-fidelity.js +267 -0
  93. package/src/template-import.js +505 -0
  94. package/src/template-layout.js +261 -0
  95. package/src/template-pack.js +255 -0
  96. package/src/tldraw/render.js +473 -0
  97. package/src/validation/cli.js +120 -0
  98. package/src/validation/core.js +1023 -0
  99. package/templates/chart.html +121 -0
  100. package/templates/closing.html +54 -0
  101. package/templates/content.html +50 -0
  102. package/templates/contents.html +60 -0
  103. package/templates/cover.html +64 -0
  104. package/templates/custom/.gitkeep +0 -0
  105. package/templates/custom/README.md +7 -0
  106. package/templates/design-styles/README.md +20 -0
  107. package/templates/design-styles/preview.html +4438 -0
  108. package/templates/diagram-tldraw.html +56 -0
  109. package/templates/diagram.html +98 -0
  110. package/templates/quote.html +31 -0
  111. package/templates/section-divider.html +43 -0
  112. package/templates/split-layout.html +43 -0
  113. package/templates/statistics.html +55 -0
  114. package/templates/team.html +49 -0
  115. package/templates/timeline.html +59 -0
@@ -0,0 +1,568 @@
1
+ # Design Skill - Professional Presentation Design System
2
+
3
+ A skill for designing HTML slides for top-tier business presentations.
4
+ Delivers minimal, refined design with professional typography and precise layouts.
5
+
6
+ ---
7
+
8
+ ## Core Design Philosophy
9
+
10
+ ### 1. Less is More
11
+ - Remove unnecessary decorative elements
12
+ - Content takes center stage
13
+ - Leverage whitespace aggressively
14
+ - Clear visual hierarchy
15
+
16
+ ### 2. Typography-Driven Design
17
+ - Pretendard as the default font
18
+ - Font size contrast creates visual impact
19
+ - Fine-tuned letter-spacing and line-height
20
+ - Weight variations for emphasis
21
+
22
+ ### 3. Strategic Color Usage
23
+ - Limited color palette (2-3 colors)
24
+ - Monotone base + accent color
25
+ - Background color sets the mood
26
+ - High contrast for readability
27
+
28
+ ---
29
+
30
+ ## Base Settings
31
+
32
+ ### Slide Size (16:9 default)
33
+ ```html
34
+ <body style="width: 720pt; height: 405pt;">
35
+ ```
36
+
37
+ ### Supported Aspect Ratios
38
+ | Ratio | Size | Use Case |
39
+ |-------|------|----------|
40
+ | 16:9 | 720pt x 405pt | Default, monitors/screens |
41
+ | 4:3 | 720pt x 540pt | Legacy projectors |
42
+ | 16:10 | 720pt x 450pt | MacBook |
43
+
44
+ ### Default Font Stack
45
+ ```css
46
+ font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
47
+ ```
48
+
49
+ ### Pretendard Webfont CDN
50
+ ```html
51
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css">
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Typography System
57
+
58
+ ### Font Size Scale
59
+ | Purpose | Size | Weight | Example |
60
+ |---------|------|--------|---------|
61
+ | Hero Title | 72-96pt | 700-800 | Cover main title |
62
+ | Section Title | 48-60pt | 700 | Section divider heading |
63
+ | Slide Title | 32-40pt | 600-700 | Slide heading |
64
+ | Subtitle | 20-24pt | 500 | Subtitle, description |
65
+ | Body | 16-20pt | 400 | Body text |
66
+ | Caption | 12-14pt | 400 | Caption, source |
67
+ | Label | 10-12pt | 500-600 | Badge, tag |
68
+
69
+ ### Letter Spacing
70
+ ```css
71
+ /* Large titles: tight */
72
+ letter-spacing: -0.02em;
73
+
74
+ /* Medium titles */
75
+ letter-spacing: -0.01em;
76
+
77
+ /* Body: default */
78
+ letter-spacing: 0;
79
+
80
+ /* Captions, labels: slightly wider */
81
+ letter-spacing: 0.02em;
82
+ ```
83
+
84
+ ### Line Height
85
+ ```css
86
+ /* Titles */
87
+ line-height: 1.2;
88
+
89
+ /* Body text */
90
+ line-height: 1.6 - 1.8;
91
+
92
+ /* Single-line text */
93
+ line-height: 1;
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Color Palette System
99
+
100
+ All color palettes are now bundled as design styles accessible via `slides-grab list-styles`. The five original palettes are styles 31–35:
101
+
102
+ - **executive-minimal** — Refined business (warm white + black accent)
103
+ - **sage-professional** — Calm and trustworthy (sage green tones)
104
+ - **modern-dark** — High-impact dark (pure dark + white text)
105
+ - **corporate-blue** — Traditional business (white + blue accent)
106
+ - **warm-neutral** — Warm and approachable (cream + terracotta)
107
+
108
+ Run `slides-grab list-styles` to browse all 95 bundled styles, or design a fully custom palette when none fit.
109
+
110
+ ---
111
+
112
+ ## Layout System
113
+
114
+ ### Spacing Standards (padding/margin)
115
+ ```css
116
+ /* Full slide padding */
117
+ padding: 48pt;
118
+
119
+ /* Section spacing */
120
+ gap: 32pt;
121
+
122
+ /* Element spacing */
123
+ gap: 16pt;
124
+
125
+ /* Text block internal spacing */
126
+ gap: 8pt;
127
+ ```
128
+
129
+ ### Grid System
130
+ ```css
131
+ /* 2-column layout */
132
+ display: grid;
133
+ grid-template-columns: 1fr 1fr;
134
+ gap: 32pt;
135
+
136
+ /* 3-column layout */
137
+ grid-template-columns: repeat(3, 1fr);
138
+
139
+ /* Asymmetric layout (40:60) */
140
+ grid-template-columns: 2fr 3fr;
141
+
142
+ /* Asymmetric layout (30:70) */
143
+ grid-template-columns: 1fr 2.3fr;
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Design Components
149
+
150
+ ### 1. Badge/Tag
151
+ ```html
152
+ <p style="
153
+ display: inline-block;
154
+ padding: 6pt 14pt;
155
+ border: 1px solid #1a1a1a;
156
+ border-radius: 20pt;
157
+ font-size: 10pt;
158
+ font-weight: 500;
159
+ letter-spacing: 0.02em;
160
+ text-transform: uppercase;
161
+ ">PRESENTATION</p>
162
+ ```
163
+
164
+ ### 2. Section Number
165
+ ```html
166
+ <p style="
167
+ display: inline-block;
168
+ padding: 4pt 12pt;
169
+ background: #1a1a1a;
170
+ color: #ffffff;
171
+ border-radius: 4pt;
172
+ font-size: 10pt;
173
+ font-weight: 600;
174
+ ">SECTION 1</p>
175
+ ```
176
+
177
+ ### 3. Logo Area
178
+ ```html
179
+ <div style="display: flex; align-items: center; gap: 8pt;">
180
+ <div style="
181
+ width: 20pt;
182
+ height: 20pt;
183
+ background: #1a1a1a;
184
+ border-radius: 4pt;
185
+ display: flex;
186
+ align-items: center;
187
+ justify-content: center;
188
+ ">
189
+ <p style="color: #fff; font-size: 12pt;">*</p>
190
+ </div>
191
+ <p style="font-size: 12pt; font-weight: 600;">LogoName</p>
192
+ </div>
193
+ ```
194
+
195
+ ### 4. Icon Button
196
+ ```html
197
+ <div style="
198
+ width: 32pt;
199
+ height: 32pt;
200
+ border: 1px solid #1a1a1a;
201
+ border-radius: 50%;
202
+ display: flex;
203
+ align-items: center;
204
+ justify-content: center;
205
+ ">
206
+ <p style="font-size: 14pt;">&#x2197;</p>
207
+ </div>
208
+ ```
209
+
210
+ ### 5. Divider Line
211
+ ```html
212
+ <div style="
213
+ width: 100%;
214
+ height: 1pt;
215
+ background: #d4d4d0;
216
+ "></div>
217
+ ```
218
+
219
+ ### 6. Info Grid
220
+ ```html
221
+ <div style="display: flex; gap: 48pt;">
222
+ <div>
223
+ <p style="font-size: 10pt; color: #999; margin-bottom: 4pt;">Contact</p>
224
+ <p style="font-size: 12pt; font-weight: 500;">334556774</p>
225
+ </div>
226
+ <div>
227
+ <p style="font-size: 10pt; color: #999; margin-bottom: 4pt;">Date</p>
228
+ <p style="font-size: 12pt; font-weight: 500;">March 2025</p>
229
+ </div>
230
+ </div>
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Slide Templates
236
+
237
+ ### 1. Cover Slide
238
+ - Template file: `templates/cover.html`
239
+
240
+ ### 2. Table of Contents (Contents)
241
+ - Template file: `templates/contents.html`
242
+
243
+ ### 3. Section Divider
244
+ - Template file: `templates/section-divider.html`
245
+
246
+ ### 4. Content Slide
247
+ - Template file: `templates/content.html`
248
+
249
+ ### 5. Statistics/Data Slide
250
+ - Template file: `templates/statistics.html`
251
+
252
+ ### 6. Image + Text (Split Layout)
253
+ - Template file: `templates/split-layout.html`
254
+
255
+ ### 7. Team Introduction
256
+ - Template file: `templates/team.html`
257
+
258
+ ### 8. Quote Slide
259
+ - Template file: `templates/quote.html`
260
+
261
+ ### 9. Timeline Slide
262
+ - Template file: `templates/timeline.html`
263
+
264
+ ### 10. Closing Slide
265
+ - Template file: `templates/closing.html`
266
+
267
+ ### 11. Chart Slide
268
+ - Template file: `templates/chart.html`
269
+
270
+ ### 12. Diagram Slide
271
+ - Template file: `templates/diagram.html`
272
+
273
+ ### 13. Tldraw Diagram Slide
274
+ - Template file: `templates/diagram-tldraw.html`
275
+ - Use this when the slide needs a complex diagram that will be easier to author in `tldraw` and safer to export as a local image asset.
276
+
277
+ ### Custom Templates
278
+ - Custom template directory: `templates/custom/`
279
+ - Users can add template files as drop-in for reuse.
280
+
281
+ ---
282
+
283
+ ## Advanced Design Patterns
284
+
285
+ ### Asymmetric Layout
286
+ Eye-catching compositions
287
+ ```css
288
+ /* Golden ratio */
289
+ grid-template-columns: 1fr 1.618fr;
290
+
291
+ /* Extreme asymmetry */
292
+ grid-template-columns: 1fr 3fr;
293
+ ```
294
+
295
+ ### Overlay Text
296
+ Text placed over images
297
+ ```html
298
+ <div style="position: relative;">
299
+ <div style="position: absolute; inset: 0; background: rgba(0,0,0,0.5);"></div>
300
+ <div style="position: relative; z-index: 1;">
301
+ <h2 style="color: #fff;">Overlay Text</h2>
302
+ </div>
303
+ </div>
304
+ ```
305
+
306
+ ### Gradient Overlay
307
+ ```html
308
+ <div style="
309
+ background: linear-gradient(to right, #1a1a1a 0%, transparent 60%);
310
+ position: absolute;
311
+ inset: 0;
312
+ "></div>
313
+ ```
314
+
315
+ ### Card Style
316
+ ```html
317
+ <div style="
318
+ background: #ffffff;
319
+ border-radius: 12pt;
320
+ padding: 24pt;
321
+ box-shadow: 0 2pt 8pt rgba(0,0,0,0.08);
322
+ "></div>
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Chart / Diagram / Image Library Guide
328
+
329
+ ### 1. Chart.js (Bar / Line / Pie)
330
+
331
+ #### CDN Link
332
+ ```html
333
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
334
+ ```
335
+
336
+ #### Usage Example
337
+ ```html
338
+ <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16pt;">
339
+ <div style="border: 1px solid #e5e5e0; border-radius: 10pt; padding: 10pt;">
340
+ <p style="font-size: 10pt; margin-bottom: 6pt;">Bar Chart</p>
341
+ <canvas id="barChart" style="width: 100%; height: 120pt;"></canvas>
342
+ </div>
343
+ <div style="border: 1px solid #e5e5e0; border-radius: 10pt; padding: 10pt;">
344
+ <p style="font-size: 10pt; margin-bottom: 6pt;">Line Chart</p>
345
+ <canvas id="lineChart" style="width: 100%; height: 120pt;"></canvas>
346
+ </div>
347
+ <div style="border: 1px solid #e5e5e0; border-radius: 10pt; padding: 10pt;">
348
+ <p style="font-size: 10pt; margin-bottom: 6pt;">Pie Chart</p>
349
+ <canvas id="pieChart" style="width: 100%; height: 120pt;"></canvas>
350
+ </div>
351
+ </div>
352
+
353
+ <script>
354
+ const labels = ['Q1', 'Q2', 'Q3', 'Q4'];
355
+ const values = [12, 19, 15, 23];
356
+
357
+ new Chart(document.getElementById('barChart'), {
358
+ type: 'bar',
359
+ data: { labels, datasets: [{ data: values, backgroundColor: ['#1f2937', '#2563eb', '#10b981', '#f59e0b'] }] },
360
+ options: { animation: false, responsive: true, maintainAspectRatio: false }
361
+ });
362
+
363
+ new Chart(document.getElementById('lineChart'), {
364
+ type: 'line',
365
+ data: { labels, datasets: [{ data: values, borderColor: '#2563eb', backgroundColor: '#93c5fd', fill: true }] },
366
+ options: { animation: false, responsive: true, maintainAspectRatio: false }
367
+ });
368
+
369
+ new Chart(document.getElementById('pieChart'), {
370
+ type: 'pie',
371
+ data: { labels, datasets: [{ data: [35, 28, 22, 15], backgroundColor: ['#2563eb', '#10b981', '#f59e0b', '#ef4444'] }] },
372
+ options: { animation: false, responsive: true, maintainAspectRatio: false }
373
+ });
374
+ </script>
375
+ ```
376
+
377
+ Recommendations:
378
+ - Use `options.animation: false` for stable PPTX conversion.
379
+ - Set explicit width/height on `canvas` elements.
380
+
381
+ ### 2. Mermaid (Flowchart / Sequence Diagram)
382
+
383
+ #### CDN Link
384
+ ```html
385
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
386
+ ```
387
+
388
+ #### Usage Example
389
+ ```html
390
+ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20pt;">
391
+ <div style="border: 1px solid #e5e5e0; border-radius: 10pt; padding: 10pt;">
392
+ <p style="font-size: 10pt; margin-bottom: 6pt;">Flowchart</p>
393
+ <pre class="mermaid">
394
+ flowchart LR
395
+ A[Plan] --> B[Design]
396
+ B --> C[Review]
397
+ C --> D[Convert]
398
+ </pre>
399
+ </div>
400
+ <div style="border: 1px solid #e5e5e0; border-radius: 10pt; padding: 10pt;">
401
+ <p style="font-size: 10pt; margin-bottom: 6pt;">Sequence Diagram</p>
402
+ <pre class="mermaid">
403
+ sequenceDiagram
404
+ participant U as User
405
+ participant A as Agent
406
+ U->>A: Request slide
407
+ A->>U: Return HTML
408
+ </pre>
409
+ </div>
410
+ </div>
411
+
412
+ <script>
413
+ mermaid.initialize({ startOnLoad: true, securityLevel: 'loose' });
414
+ </script>
415
+ ```
416
+
417
+ Recommendations:
418
+ - Write Mermaid DSL inside `<pre class="mermaid">`.
419
+ - Fix the diagram container size for stable layout.
420
+
421
+ ### 3. Inline SVG Icon Guide
422
+
423
+ ```html
424
+ <div style="display: flex; align-items: center; gap: 8pt;">
425
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" aria-hidden="true">
426
+ <path d="M5 12h14M12 5l7 7-7 7" stroke="#1f2937" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path>
427
+ </svg>
428
+ <p style="font-size: 12pt; color: #1f2937;">Next step</p>
429
+ </div>
430
+ ```
431
+
432
+ Rules:
433
+ - Always specify `viewBox`.
434
+ - Set explicit size via `width`/`height`.
435
+ - Use HEX values with `#` prefix for `stroke`/`fill` colors.
436
+ - Place text outside SVG using `<p>`, `<h1>`-`<h6>` tags.
437
+
438
+ ### 4. Image Usage Rules (Local Asset / Data URL / Remote URL / Placeholder)
439
+
440
+ #### Canonical Local Asset Image
441
+ ```html
442
+ <img src="./assets/team-photo.png" alt="Team photo" style="width: 220pt; height: 140pt; object-fit: cover;">
443
+ ```
444
+
445
+ Store the image at `<slides-dir>/assets/team-photo.png`.
446
+
447
+ #### Self-Contained Fallback (`data:` URL)
448
+ ```html
449
+ <img src="data:image/svg+xml;base64,..." alt="Illustration" style="width: 220pt; height: 140pt; object-fit: cover;">
450
+ ```
451
+
452
+ #### Remote URL Source (Download Before Saving)
453
+ ```html
454
+ <img src="https://images.example.com/hero.png" alt="Hero image" style="width: 220pt; height: 140pt; object-fit: cover;">
455
+ ```
456
+
457
+ If the image source starts on the web, download it into `<slides-dir>/assets/` and change the saved slide HTML to `./assets/<file>`.
458
+
459
+ #### Placeholder (Image Stand-In)
460
+ ```html
461
+ <div data-image-placeholder style="width: 220pt; height: 140pt; border: 1px dashed #c7c7c7; background: #f3f4f6; display: flex; align-items: center; justify-content: center;">
462
+ <p style="font-size: 10pt; color: #6b7280; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;">Image Placeholder</p>
463
+ </div>
464
+ ```
465
+
466
+ Rules:
467
+ - Always include `alt` on `img` tags.
468
+ - Use `./assets/<file>` as the default image contract for slide HTML.
469
+ - Keep slide assets in `<slides-dir>/assets/`.
470
+ - `data:` URLs are allowed for fully self-contained slides.
471
+ - Do not leave remote `http(s)://` image URLs in saved slide HTML; download source images into `<slides-dir>/assets/` and reference them as `./assets/<file>`.
472
+ - Do not use absolute filesystem paths in slide HTML.
473
+ - Do not use non-body `background-image` for content imagery; use `<img>` instead.
474
+ - Use `data-image-placeholder` to reserve space when no image is available yet.
475
+ - Use high-resolution originals and fit with `object-fit`.
476
+
477
+ ---
478
+
479
+ ## Text Usage Rules
480
+
481
+ ### Required Tags
482
+ ```html
483
+ <!-- All text MUST be inside these tags -->
484
+ <p>, <h1>-<h6>, <ul>, <ol>, <li>
485
+
486
+ <!-- Forbidden - ignored in PowerPoint conversion -->
487
+ <div>text here</div>
488
+ <span>text here</span>
489
+ ```
490
+
491
+ ### Recommended Usage
492
+ ```html
493
+ <!-- Good -->
494
+ <h1 style="...">Title</h1>
495
+ <p style="...">Body text</p>
496
+
497
+ <!-- Bad -->
498
+ <div style="...">Text directly in div</div>
499
+ ```
500
+
501
+ ---
502
+
503
+ ## Output and File Structure
504
+
505
+ ### File Save Rules
506
+ ```
507
+ <slides-dir>/ (default: slides/)
508
+ ├── slide-01.html (Cover)
509
+ ├── slide-02.html (Contents)
510
+ ├── slide-03.html (Section Divider)
511
+ ├── slide-04.html (Content)
512
+ ├── ...
513
+ └── slide-XX.html (Closing)
514
+ ```
515
+
516
+ ### File Naming Rules
517
+ - Use 2-digit numbers: `slide-01.html`, `slide-02.html`
518
+ - Name sequentially
519
+ - No special characters or spaces
520
+
521
+ ---
522
+
523
+ ## Workflow (Stage 2: Design + Human Review)
524
+
525
+ This skill is **Stage 2**. It works from the `slide-outline.md` approved by the user in Stage 1 (plan-skill).
526
+
527
+ ### Prerequisites
528
+ - `slide-outline.md` must exist and be approved by the user.
529
+
530
+ ### Steps
531
+
532
+ 1. **Analyze + Design**: Read `slide-outline.md`, decide theme/layout, generate HTML slides
533
+ 2. **Diagram choice**: If a slide needs a complex diagram (architecture, workflows, relationship maps, multi-node concepts), prefer `tldraw`. Export the diagram with `slides-grab tldraw` and reference the generated local asset from the slide HTML.
534
+ 3. **Validate slides**: After slide generation or edits, automatically run:
535
+ ```bash
536
+ slides-grab validate --slides-dir <path>
537
+ ```
538
+ 4. **Auto-fix validation issues**: If validation fails, fix the source HTML/CSS and re-run validation until it passes
539
+ 5. **Auto-build viewer**: After validation passes, automatically run:
540
+ ```bash
541
+ slides-grab build-viewer --slides-dir <path>
542
+ ```
543
+ 6. **Guide user to review**: Tell the user to check slides in the browser:
544
+ ```
545
+ open <slides-dir>/viewer.html
546
+ ```
547
+ 7. **Revision loop**: When the user requests changes to specific slides:
548
+ - Edit only the relevant HTML file
549
+ - Re-run `slides-grab validate --slides-dir <path>` and fix any failures
550
+ - Re-run `slides-grab build-viewer --slides-dir <path>` to rebuild the viewer
551
+ - Guide user to review again
552
+ 8. **Completion**: Repeat the revision loop until the user signals approval for PPTX conversion
553
+
554
+ ### Absolute Rules
555
+ - **Never start PPTX conversion without approval** — PPTX conversion is the responsibility of `pptx-skill` and requires explicit user approval.
556
+ - **Prefer tldraw for complex diagrams** — Use `slides-grab tldraw` when the slide needs a non-trivial diagram instead of forcing dense diagram geometry into HTML/CSS.
557
+ - **Never skip validation** — Run `slides-grab validate --slides-dir <path>` after generation or edits and fix failures before review.
558
+ - **Never forget to build the viewer** — Run `slides-grab build-viewer --slides-dir <path>` every time slides are generated or modified.
559
+
560
+ ---
561
+
562
+ ## Important Notes
563
+
564
+ 1. **CSS gradients**: Not supported in PowerPoint conversion — replace with background images
565
+ 2. **Webfonts**: Always include the Pretendard CDN link
566
+ 3. **Image paths**: Use `./assets/<file>` from each `slide-XX.html`; avoid absolute filesystem paths and do not leave remote `http(s)://` image URLs in saved slide HTML
567
+ 4. **Colors**: Always include `#` prefix in CSS
568
+ 5. **Text rules**: Never place text directly in div/span
@@ -0,0 +1,70 @@
1
+ ## Base Settings
2
+
3
+ ### Slide Size (16:9 default)
4
+ - Keep slide body at 720pt x 405pt.
5
+ - Use Pretendard as the default font stack.
6
+ - Include the Pretendard webfont CDN link when needed.
7
+
8
+ ### 4. Image Usage Rules (Local Asset / Data URL / Remote URL / Placeholder)
9
+ - Always include alt on img tags.
10
+ - Use `./assets/<file>` as the default image and video contract for slide HTML.
11
+ - Keep slide assets in `<slides-dir>/assets/`.
12
+ - Use `tldraw`-generated assets for complex diagrams whenever possible.
13
+ - Use `slides-grab image --prompt "<prompt>" --slides-dir <path>` with the default codex-imagen provider (reuses Codex CLI ChatGPT login; no API key required) when a slide needs bespoke generated imagery.
14
+ - `data:` URLs are allowed for fully self-contained slides.
15
+ - Do not leave remote `http(s)://` image URLs in saved slide HTML; download source images into `<slides-dir>/assets/` and reference them as `./assets/<file>`.
16
+ - Store local videos under `<slides-dir>/assets/`, reference them as `./assets/<file>`, and prefer `poster="./assets/<file>"` for export-friendly thumbnails.
17
+ - If a video starts on YouTube or another supported page, use `slides-grab fetch-video --url <youtube-url> --slides-dir <path>` (or `yt-dlp` directly if needed) before saving the slide HTML.
18
+ - Default provider codex-imagen reuses the local Codex ChatGPT login (`~/.codex/auth.json`) — run `codex login` once; **no API key required**. ⚠️ codex-imagen uses an unsupported private Codex backend that may break without notice. Optional alternatives: `--provider openai` (OpenAI gpt-image-2 via `OPENAI_API_KEY`; maps `--aspect-ratio` to the nearest supported OpenAI image size; `--image-size 2K|4K` is Nano Banana-only) or `--provider nano-banana` (Google `gemini-3-pro-image-preview` via `GOOGLE_API_KEY` or `GEMINI_API_KEY`; supports `--image-size 2K|4K`). If credentials are unavailable, fall back to web search + download into `<slides-dir>/assets/`.
19
+ - Do not use absolute filesystem paths in slide HTML.
20
+ - Do not use non-body `background-image` for content imagery; use `<img>` instead.
21
+ - Use `data-image-placeholder` to reserve space when no image is available yet.
22
+
23
+ ## Text Usage Rules
24
+ - All text must be inside `<p>`, `<h1>`-`<h6>`, `<ul>`, `<ol>`, or `<li>`.
25
+ - Never place text directly in `<div>` or `<span>`.
26
+
27
+ ## Typography Scale Rules
28
+ - Body copy minimum is 14pt on a 720pt × 405pt slide; prefer 16-20pt so copy reads cleanly at presentation distance and on PDF export.
29
+ - Absolute floor for captions, labels, footnotes, and meta text is 10pt. Never render any text below 10pt.
30
+ - Display and title text should scale well above body copy — prefer 36pt or larger so the slide's main takeaway reads in 3-5 seconds.
31
+ - If content does not fit at the minimum scale, cut content. Do not shrink type to accommodate more.
32
+ - Keep at most two typefaces across the deck. One display/headline face plus one body face is enough.
33
+
34
+ ## Color Usage Rules
35
+ - Pull every color from the approved style spec in `src/design-styles-data.js` or the user-provided brand tokens. Do not invent fresh standalone hex colors mid-slide.
36
+ - If the approved palette cannot cover a specific slide, extend it harmonically with `oklch()` — derive the new color from the existing accent, surface, or background — rather than picking a fresh hex from scratch.
37
+ - Keep one accent color per deck. Two background colors max across the entire deck, used to introduce rhythm between section dividers and content slides.
38
+ - Every CSS color must keep the `#` prefix and survive raster export to PPTX/PDF; avoid non-sRGB values that will flatten unexpectedly.
39
+
40
+ ## Icon Usage Rules
41
+ - Prefer Lucide as the default icon library for slide UI elements, callouts, and supporting visuals.
42
+ - Do not default to emoji for iconography; reserve emoji for cases where the brief explicitly wants a playful or native-emoji tone.
43
+ - Keep icon sizing, stroke weight, and color aligned with the deck's approved design tokens.
44
+
45
+ ## Chart Usage Rules
46
+ - Prefer Chart.js for bar, line, pie, doughnut, and mixed quantitative slides.
47
+ - Start from `templates/chart.html` when a chart slide needs a proven structure.
48
+ - Keep the `<canvas>` in a stable wrapper and set Chart.js options to `animation: false`, `responsive: true`, and `maintainAspectRatio: false`.
49
+ - Match chart colors to the approved style tokens; avoid rainbow palettes unless the data categories require distinct hues.
50
+ - Direct-label the key data point or keep legends short. Do not let chart legends compete with the slide headline.
51
+ - `slides-grab validate` treats a visible unpainted canvas as `empty-canvas`; fix script loading, target ids, sizing, or data before review/export.
52
+
53
+ ## Workflow (Stage 2: Design + Human Review)
54
+ - After slide generation or edits, run `slides-grab validate --slides-dir <path>`.
55
+ - After validation passes, run `slides-grab build-viewer --slides-dir <path>`.
56
+ - Edit only the relevant HTML file during revision loops.
57
+ - When the brief explicitly calls for an image, the user requests one, or the slide clearly benefits from it, prefer `slides-grab image` before falling back to remote image sourcing.
58
+ - Prefer `slides-grab tldraw` + local exported assets for architecture, workflow, relationship, and other complex diagrams.
59
+ - For Chart.js decks, open the generated viewer and confirm charts render inside `viewer.html`, not only as standalone slide files.
60
+ - Keep local videos and their poster thumbnails together under `<slides-dir>/assets/`.
61
+ - Never start PPTX conversion without explicit approval.
62
+ - Never forget to build the viewer after slide changes.
63
+ - Do not persist runtime-only editor/viewer injections in saved slide HTML.
64
+
65
+ ## Important Notes
66
+ - CSS gradients may not export cleanly to all formats; prefer solid colors or background images when possible.
67
+ - Always include the Pretendard CDN link.
68
+ - Use `./assets/<file>` from each `slide-XX.html` for local images and videos, and avoid absolute filesystem paths.
69
+ - Always include `#` prefix in CSS colors.
70
+ - Never place text directly in `div`/`span`.
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: slides-grab-export
3
+ description: Stage 3 conversion skill usable in Codex and Claude Code. Convert approved HTML slides to PDF or per-slide PNG reliably, and to experimental / unstable PPTX/Figma outputs on a best-effort basis.
4
+ metadata:
5
+ short-description: Convert slides and run conversion checks
6
+ ---
7
+
8
+ # slides-grab Export Skill
9
+
10
+ Use this only after the user approves design output **and the Stage 2 design gate verdict is `Proceed`** (zero unresolved Critical findings — see `../slides-grab-design/references/design-gate.md`). PDF, PPTX, and Figma exports require a fresh `slides-grab design-gate` Proceed receipt for the current slide files.
11
+
12
+ ## Goal
13
+ Convert reviewed slide HTML into PDF or per-slide PNG reliably, and into experimental / unstable PPTX/Figma outputs on a best-effort basis.
14
+
15
+ ## Inputs
16
+ - Approved `<slides-dir>/slide-*.html`
17
+ - Optional output path settings
18
+
19
+ ## Outputs
20
+ - Presentation artifact (`.pdf`, `.png` per slide, or `.pptx`)
21
+
22
+ ## Workflow
23
+ 1. Confirm user approval for conversion **and that the Stage 2 design gate passed** with verdict `Proceed`. If any **Critical** design-gate finding is still unresolved, refuse to export — return to Stage 2, fix the Critical issue, re-run the gate, record Proceed with `slides-grab design-gate`, and only then convert.
24
+ 2. Pick the right primary target:
25
+ - Card-news / Instagram-style decks → `slides-grab png --slides-dir <path> --slide-mode card-news --resolution 2160p` (see `slides-grab-card-news`).
26
+ - Widescreen slide decks → `slides-grab pdf --slides-dir <path> --output <name>.pdf`.
27
+ 3. When per-slide raster output is needed (card news, social posts, thumbnails):
28
+ - `slides-grab png --slides-dir <path> --output-dir <path>/out-png --resolution 2160p`
29
+ - Add `--slide-mode card-news` for 1:1 cards.
30
+ 4. If the user also wants a PDF deck:
31
+ - `slides-grab pdf --slides-dir <path> --output <name>.pdf`
32
+ - Add `--slide-mode card-news` when the deck is square.
33
+ 5. For decks with Chart.js or other `<canvas>` charts, confirm `slides-grab validate --slides-dir <path>` passes without `empty-canvas`, then build/open `viewer.html` once before export. Chart.js charts should use disabled animation so PDF/PNG capture sees the final painted state.
34
+ 6. If the user wants PPTX (experimental / unstable):
35
+ - Default visual-fidelity export: `slides-grab convert --slides-dir <path> --output <name>.pptx --engine raster`
36
+ - Editable-text export: `slides-grab convert --slides-dir <path> --output <name>-editable.pptx --engine text`
37
+ - `--resolution` can only be used with the raster engine. The text engine requires semantic text tags, rasterizes canvas/SVG visuals, and may reject unsupported HTML/CSS.
38
+ 7. If the user wants Figma-importable PPTX (experimental / unstable):
39
+ - `slides-grab figma --slides-dir <path> --output <name>-figma.pptx`
40
+ 8. Report success/failure with actionable errors.
41
+
42
+ ## Rules
43
+ - Do not export while any **Critical** design-gate finding is unresolved (`../slides-grab-design/references/design-gate.md`). The design gate is a hard precondition for this stage, and `slides-grab pdf`, `slides-grab convert`, and `slides-grab figma` block if the latest receipt is missing or stale.
44
+ - Do not modify slide content during conversion stage unless explicitly requested.
45
+ - If conversion fails, diagnose and fix root causes in source HTML/CSS.
46
+ - For chart-heavy decks, treat a blank exported chart as a source rendering bug first: re-run validation, inspect `empty-canvas`, and verify the same slide in `viewer.html` before retrying PDF/PNG/PPTX export.
47
+ - Always tell the user that PPTX and Figma export are experimental / unstable and may require manual cleanup.
48
+ - Use the packaged CLI and bundled references only; do not depend on unpublished agent-specific files.
49
+
50
+ ## Reference
51
+ For detailed conversion behavior and tools, use:
52
+ - `references/export-rules.md`
53
+ - `references/pptx-skill-reference.md` — archived full PPTX workflow guidance
54
+ - `references/html2pptx.md` — archived converter usage guide
55
+ - `references/ooxml.md` — archived OOXML reference