pptx-cli 1.0.0__tar.gz → 1.2.0__tar.gz

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 (74) hide show
  1. pptx_cli-1.2.0/.github/skills/pptx-deck-builder/SKILL.md +353 -0
  2. pptx_cli-1.2.0/.github/skills/pptx-deck-builder/references/excal-diagrams.md +161 -0
  3. pptx_cli-1.2.0/.github/skills/pptx-deck-builder/references/mckinsey-style.md +226 -0
  4. pptx_cli-1.2.0/.github/skills/pptx-deck-builder/references/pptx-workflow.md +243 -0
  5. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/PKG-INFO +63 -4
  6. pptx_cli-1.2.0/PREVIEW-FUTURE.md +385 -0
  7. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/README.md +62 -3
  8. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/__init__.py +1 -1
  9. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/cli.py +61 -2
  10. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/compose.py +12 -19
  11. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/guide.py +47 -2
  12. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/inspect.py +15 -13
  13. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/composition.py +167 -14
  14. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/manifest_store.py +45 -0
  15. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/template.py +230 -9
  16. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/models/envelope.py +1 -0
  17. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/models/manifest.py +17 -0
  18. pptx_cli-1.2.0/tests/test_cli.py +660 -0
  19. pptx_cli-1.0.0/tests/test_cli.py +0 -301
  20. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.editorconfig +0 -0
  21. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  22. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  23. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  24. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  25. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/copilot-instructions.md +0 -0
  26. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/instructions/backend.instructions.md +0 -0
  27. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/instructions/testing.instructions.md +0 -0
  28. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/skills/pptx/SKILL.md +0 -0
  29. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/skills/pptx/references/deck-spec.md +0 -0
  30. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/workflows/ci.yml +0 -0
  31. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.github/workflows/publish.yml +0 -0
  32. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.gitignore +0 -0
  33. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/.python-version +0 -0
  34. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/AGENTS.md +0 -0
  35. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/ARCHITECTURE.md +0 -0
  36. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/CHANGELOG.md +0 -0
  37. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/CLI-MANIFEST.md +0 -0
  38. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/CONTRIBUTING.md +0 -0
  39. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/DECISIONS/ADR-0001-initial-architecture.md +0 -0
  40. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/LICENSE +0 -0
  41. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/PRD.md +0 -0
  42. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/PROJECT.md +0 -0
  43. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/SCAFFOLD.md +0 -0
  44. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/SECURITY.md +0 -0
  45. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/TESTING.md +0 -0
  46. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/docs/DOMAIN.md +0 -0
  47. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/docs/GLOSSARY.md +0 -0
  48. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/docs/ROADMAP.md +0 -0
  49. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/docs/SCAFFOLDING-NOTES.md +0 -0
  50. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails/.gitignore +0 -0
  51. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails/guardrails.jsonl +0 -0
  52. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails/links.jsonl +0 -0
  53. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails/references.jsonl +0 -0
  54. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails/taxonomy.json +0 -0
  55. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/guardrails-explorer.html +0 -0
  56. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/pyproject.toml +0 -0
  57. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/pyrightconfig.json +0 -0
  58. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/scripts/bump_version.py +0 -0
  59. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/__main__.py +0 -0
  60. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/__init__.py +0 -0
  61. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/init.py +0 -0
  62. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/manifest_ops.py +0 -0
  63. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/validate.py +0 -0
  64. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/commands/wrapper.py +0 -0
  65. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/__init__.py +0 -0
  66. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/ids.py +0 -0
  67. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/io.py +0 -0
  68. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/runtime.py +0 -0
  69. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/validation.py +0 -0
  70. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/core/versioning.py +0 -0
  71. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/src/pptx_cli/models/__init__.py +0 -0
  72. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/tests/conftest.py +0 -0
  73. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/tests/test_versioning.py +0 -0
  74. {pptx_cli-1.0.0 → pptx_cli-1.2.0}/uv.lock +0 -0
@@ -0,0 +1,353 @@
1
+ ---
2
+ name: pptx-deck-builder
3
+ description: >
4
+ Build enterprise PowerPoint decks using the `pptx` and `excal` CLI tools.
5
+ Use this skill whenever the user wants to create a PowerPoint presentation,
6
+ generate slides from a template, build a deck with diagrams, or produce
7
+ consulting-style slide content. Also triggers for requests involving
8
+ .pptx files, slide decks, presentation generation, Excalidraw diagrams
9
+ for slides, or McKinsey/consulting-style deliverables. If the user mentions
10
+ "pptx", "excal", "slides", "deck", "presentation", or "PowerPoint" in the
11
+ context of creating output, use this skill.
12
+ ---
13
+
14
+ # pptx + excal Deck Builder
15
+
16
+ Build template-bound, validated PowerPoint decks with professional diagrams.
17
+ This skill combines two CLI tools (`pptx` for slide generation, `excal` for
18
+ diagrams) with consulting-grade presentation principles.
19
+
20
+ ## When to read the reference files
21
+
22
+ - **`references/pptx-workflow.md`** — Read when you need the full `pptx` CLI
23
+ command reference, manifest structure, placeholder details, deck spec format,
24
+ error codes, or image-handling workarounds.
25
+ - **`references/excal-diagrams.md`** — Read when you need to create Excalidraw
26
+ diagrams, render them to PNG, or understand the scene JSON format.
27
+ - **`references/mckinsey-style.md`** — Read when the user asks for
28
+ consulting-style, executive, strategy, or McKinsey-style presentations. Also
29
+ read when you need guidance on action titles, storyline structure, slide
30
+ archetypes, or the Pyramid Principle.
31
+
32
+ ---
33
+
34
+ ## Core workflow
35
+
36
+ Every deck project follows this sequence. Do not skip steps.
37
+
38
+ ### Step 0 — Think before building
39
+
40
+ Before touching any tool, resolve the presentation's purpose:
41
+
42
+ 1. What decision or outcome is this deck driving?
43
+ 2. What is the single governing thought or recommendation?
44
+ 3. What are the 3-5 supporting arguments?
45
+ 4. What evidence proves each argument?
46
+
47
+ If the user's request is vague, ask clarifying questions. A deck without a
48
+ clear purpose becomes a collection of slides instead of an argument.
49
+
50
+ For consulting-style decks, write a **ghost deck** first — a title-only
51
+ outline where each slide title states the takeaway (not the topic). The titles
52
+ alone should tell a coherent story. See `references/mckinsey-style.md`.
53
+
54
+ ### Step 1 — Initialize the manifest (one-time setup)
55
+
56
+ Check if a manifest package already exists. If not, initialize from the
57
+ template:
58
+
59
+ ```bash
60
+ pptx init Template.pptx --out ./corp-template --format json
61
+ ```
62
+
63
+ Then run the doctor to verify compatibility:
64
+
65
+ ```bash
66
+ pptx doctor --manifest ./corp-template --format json
67
+ ```
68
+
69
+ ### Step 2 — Discover layouts and placeholders
70
+
71
+ List available layouts, then inspect placeholders for the ones you plan to use:
72
+
73
+ ```bash
74
+ pptx layouts list --manifest ./corp-template --format json
75
+ pptx placeholders list <layout-id> --manifest ./corp-template --format json
76
+ ```
77
+
78
+ Read-only commands can run in parallel for speed. Key information per
79
+ placeholder:
80
+
81
+ - `logical_name` — The key to use in your spec (e.g., `title`, `content_1`)
82
+ - `placeholder_type` — `title`, `body`, `object`, or `picture`
83
+ - `supported_content_types` — What it accepts (`text`, `markdown-text`,
84
+ `image`, `table`, `chart`)
85
+ - `required` — Whether it must be filled
86
+ - `estimated_text_capacity` — Preferred normalized guidance for text-capable
87
+ placeholders. Read `max_lines` first, then check `confidence`, `source`,
88
+ and `font_size_pt`.
89
+ - `text_defaults` — Raw extracted placeholder hints such as suggested font
90
+ size or explicit `max_lines` from the template text
91
+ - `left_emu`, `top_emu`, `width_emu`, `height_emu` — The actual geometry.
92
+ Treat `width_emu` and `height_emu` as hard constraints for how much content
93
+ the placeholder can realistically hold.
94
+
95
+ For slide drafting, prefer `estimated_text_capacity.max_lines` over parsing
96
+ `text_defaults.max_lines` directly. Treat it as guidance, not a hard rule:
97
+ stay at or below the line estimate when possible, and be more conservative
98
+ when `confidence` is `low`.
99
+
100
+ Respect placeholder size in every content decision:
101
+
102
+ - Text: do not write beyond the likely line budget for the box. If the message
103
+ does not fit, tighten the wording or choose a layout with a larger text area.
104
+ - Images and diagrams: match the placeholder aspect ratio and expected visual
105
+ density to the available width and height.
106
+ - Tables and charts: reduce rows, columns, labels, or series when the
107
+ placeholder is small. Prefer a larger layout over forcing dense content into
108
+ a small box.
109
+
110
+ Also inspect theme colors and assets if you need to match the visual identity:
111
+
112
+ ```bash
113
+ pptx theme show --manifest ./corp-template --format json
114
+ pptx assets list --manifest ./corp-template --format json
115
+ ```
116
+
117
+ ### Step 3 — Create diagrams with excal (if needed)
118
+
119
+ When the deck needs diagrams, flowcharts, or visual explanations, create them
120
+ as Excalidraw scenes and render to PNG.
121
+
122
+ **Critical: match the placeholder aspect ratio.** Before designing a diagram,
123
+ check the target placeholder's dimensions in EMUs (from the placeholders
124
+ command). Calculate the aspect ratio and design the diagram to match.
125
+
126
+ For a picture placeholder that is 6642100 x 5514313 EMU (~1.2:1), design a
127
+ diagram roughly 540px wide x 450px tall. A mismatch causes cropping or
128
+ letterboxing.
129
+
130
+ ```bash
131
+ # Create the .excalidraw file, then:
132
+ excal validate diagrams/my-diagram.excalidraw
133
+ excal render diagrams/my-diagram.excalidraw --outDir ./out/diagrams --png --scale 4 --no-background
134
+ ```
135
+
136
+ Use `--no-background` for transparent backgrounds that blend with slide
137
+ backgrounds. Use `--scale 4` for crisp output — scale 2 looks blurry on
138
+ large slide placeholders because the pixel density is too low for the
139
+ physical size. Scale 4 ensures diagrams stay sharp even on high-DPI
140
+ displays and when projected.
141
+
142
+ **Match the template's visual identity.** Diagrams should feel like they belong
143
+ on the slide, not like foreign objects pasted in. Two things matter most:
144
+
145
+ 1. **Use `fontFamily: 1`** (Excalidraw's hand-drawn style) for diagram text.
146
+ This gives a clean whiteboard aesthetic that contrasts well with formal slide
147
+ typography and looks intentional rather than mismatched.
148
+
149
+ 2. **Pull colors from the template theme.** Run `pptx theme show --manifest
150
+ ./corp-template --format json` and use the accent colors for fills and
151
+ strokes. Common mapping:
152
+ - Primary elements → accent1 (e.g., `#003778`)
153
+ - Secondary elements → accent2 (e.g., `#4673C3`)
154
+ - Tertiary/subtle → accent3 (e.g., `#87AAE1`)
155
+ - Success/positive → `#087f5b` (green)
156
+ - Labels/muted → `#868e96` (gray)
157
+
158
+ Avoid arbitrary colors — diagrams that use theme colors integrate seamlessly
159
+ with the slide's color palette.
160
+
161
+ See `references/excal-diagrams.md` for the full Excalidraw scene format and
162
+ element types.
163
+
164
+ ### Step 4 — Write the deck spec
165
+
166
+ Create a YAML file mapping layouts to content:
167
+
168
+ ```yaml
169
+ manifest: ./corp-template
170
+ metadata:
171
+ title: "Presentation Title"
172
+ author: "Author Name"
173
+ slides:
174
+ - layout: layout-id
175
+ content:
176
+ title: "Action title stating the takeaway"
177
+ subtitle: "Optional context"
178
+ content_1: |
179
+ - Bullet point one
180
+ - Bullet point two
181
+ source: "Source: Data attribution"
182
+
183
+ - layout: picture-layout-id
184
+ content:
185
+ title: "Slide title"
186
+ picture:
187
+ kind: image
188
+ path: out/diagrams/my-diagram.png
189
+ content_1: |
190
+ Supporting text alongside the image
191
+ ```
192
+
193
+ **Content value formats:**
194
+ - Plain string → treated as `text`
195
+ - Multi-line YAML block scalar → treated as `text` with line breaks
196
+ - `{ kind: "image", path: "path/to/file.png" }` → image insertion
197
+ - `{ kind: "table", columns: [...], rows: [[...], ...] }` → table
198
+ - `{ kind: "chart", chart_type: "column_clustered", categories: [...], series: [{name: "...", values: [...]}] }` → chart
199
+
200
+ ### Step 5 — Build and validate
201
+
202
+ ```bash
203
+ pptx deck build --manifest ./corp-template --spec deck.yaml --out ./out/deck.pptx --format json
204
+ pptx validate --manifest ./corp-template --deck ./out/deck.pptx --strict --format json
205
+ ```
206
+
207
+ Always validate with `--strict`. Fix any issues and rebuild. If the output
208
+ file is locked (open in PowerPoint), write to a new filename.
209
+
210
+ Use `--dry-run` on build to preview without writing files.
211
+
212
+ ---
213
+
214
+ ## Image handling
215
+
216
+ ### Image scaling — fit vs crop
217
+
218
+ Picture placeholders should already advertise `image` in
219
+ `supported_content_types`. Do not patch `manifest.yaml` unless inspection
220
+ output proves the template contract is actually wrong.
221
+
222
+ The current build behavior defaults to `image_fit: fit`, which preserves the
223
+ full image inside the placeholder. Use `image_fit: cover` when you explicitly
224
+ want crop-to-fill behavior.
225
+
226
+ ```yaml
227
+ slides:
228
+ - layout: picture-layout-id
229
+ content:
230
+ title: Workflow
231
+ picture:
232
+ kind: image
233
+ path: out/diagrams/workflow.png
234
+ image_fit: fit
235
+ ```
236
+
237
+ ---
238
+
239
+ ## Slide writing principles
240
+
241
+ These apply to every deck, not just consulting-style ones.
242
+
243
+ ### Action titles, not topic labels
244
+
245
+ Every slide title should state the takeaway — what the audience should
246
+ conclude — not just name the topic.
247
+
248
+ - Bad: "Market Overview"
249
+ - Good: "Nordic retail margins will remain under pressure through 2027"
250
+
251
+ ### One slide, one message
252
+
253
+ If a slide has two insights, split it into two slides. The body must prove
254
+ the headline.
255
+
256
+ ### Respect placeholder geometry
257
+
258
+ Never treat placeholder size as flexible. The template geometry is part of the
259
+ contract.
260
+
261
+ - If text exceeds the placeholder's likely capacity, shorten it or split it.
262
+ - If a table or chart needs more room, switch to a layout with a larger object
263
+ placeholder.
264
+ - If a diagram becomes unreadable at the placeholder's size, simplify the
265
+ diagram rather than shrinking text and shapes until they are illegible.
266
+
267
+ ### Source attribution
268
+
269
+ Data-driven slides need source lines. Use the `source` placeholder when
270
+ available.
271
+
272
+ ### Storyline coherence
273
+
274
+ A reader should be able to read only the slide titles, in order, and
275
+ understand the full argument.
276
+
277
+ For full consulting-style guidance including the Pyramid Principle, MECE
278
+ structuring, ghost decks, slide archetypes, and executive summary
279
+ construction, read `references/mckinsey-style.md`.
280
+
281
+ ---
282
+
283
+ ## Layout selection guide
284
+
285
+ Match content to the right layout:
286
+
287
+ | Content type | Suggested layout patterns |
288
+ |---|---|
289
+ | Opening / title | front-page layouts (with pattern or picture) |
290
+ | Agenda / TOC | agenda layouts (use plain text items without numbered prefixes — the layout often auto-numbers) |
291
+ | Section divider | breaker layouts |
292
+ | Single topic with bullets | title-and-content |
293
+ | Side-by-side comparison | two-contents |
294
+ | Topic with description header | title-description-and-content |
295
+ | Image with explanation | picture-right-text-and-box (or similar) |
296
+ | Minimal / custom | title-only or blank-with-logo |
297
+ | Closing | end-slide layouts |
298
+
299
+ When a template has numbered variants (e.g., `1-title-and-content`,
300
+ `2-title-description-and-content`), inspect the placeholders of each to
301
+ understand the differences. Numbered variants often differ in placeholder
302
+ arrangement, background color, or description fields.
303
+
304
+ ---
305
+
306
+ ## Quick reference — common commands
307
+
308
+ ```bash
309
+ # One-time setup
310
+ pptx init Template.pptx --out ./manifest-dir --format json
311
+ pptx doctor --manifest ./manifest-dir --format json
312
+
313
+ # Inspection (safe to parallelize)
314
+ pptx layouts list --manifest ./manifest-dir --format json
315
+ pptx placeholders list <layout-id> --manifest ./manifest-dir --format json
316
+ pptx theme show --manifest ./manifest-dir --format json
317
+ pptx assets list --manifest ./manifest-dir --format json
318
+
319
+ # Single slide (quick test)
320
+ pptx slide create --manifest ./manifest-dir --layout <id> --set title="Hello" --out slide.pptx
321
+
322
+ # Full deck
323
+ pptx deck build --manifest ./manifest-dir --spec deck.yaml --out deck.pptx --format json
324
+ pptx validate --manifest ./manifest-dir --deck deck.pptx --strict --format json
325
+
326
+ # Diagrams
327
+ excal validate diagram.excalidraw
328
+ excal render diagram.excalidraw --outDir ./out --png --scale 4 --no-background
329
+
330
+ # Template versioning
331
+ pptx manifest diff ./v1-manifest ./v2-manifest --format json
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Error handling
337
+
338
+ All `pptx` commands return JSON envelopes with `ok`, `errors`, and exit codes:
339
+
340
+ | Exit code | Meaning |
341
+ |---|---|
342
+ | 0 | Success |
343
+ | 10 | Validation error (bad layout, missing placeholder, wrong content type) |
344
+ | 20 | Policy error |
345
+ | 40 | Conflict (output file exists / locked) |
346
+ | 50 | I/O error (file not found) |
347
+ | 90 | Internal error |
348
+
349
+ If output file is locked (exit code 40 or PermissionError), write to a
350
+ different filename — do not retry.
351
+
352
+ All `excal` errors also return JSON envelopes. Key codes: exit 10 for
353
+ invalid scene JSON, exit 20 for render failures, exit 50 for I/O errors.
@@ -0,0 +1,161 @@
1
+ # excal CLI — Diagram Reference
2
+
3
+ ## Commands
4
+
5
+ ### excal inspect <file|->
6
+ Inspect scene structure: element counts, bounds, metadata.
7
+ ```bash
8
+ excal inspect diagram.excalidraw
9
+ ```
10
+
11
+ ### excal validate <file|->
12
+ Validate scene: frame refs, bound text, arrow bindings, assets.
13
+ ```bash
14
+ excal validate diagram.excalidraw
15
+ excal validate diagram.excalidraw --check-assets
16
+ ```
17
+
18
+ ### excal render <file|->
19
+ Render to SVG, PNG, or PDF. PNG/PDF require Playwright.
20
+ ```bash
21
+ excal render diagram.excalidraw --outDir ./out --png --scale 4 --no-background
22
+ excal render diagram.excalidraw --outDir ./out --svg
23
+ excal render diagram.excalidraw --outDir ./out --png --dark-mode
24
+ excal render diagram.excalidraw --outDir ./out --png --frame "Frame Name"
25
+ ```
26
+
27
+ Flags:
28
+ - `--outDir <dir>` — Output directory (default: .)
29
+ - `--svg` — Export SVG (default format)
30
+ - `--png` — Export PNG (requires Playwright)
31
+ - `--pdf` — Export PDF (requires Playwright)
32
+ - `--dark-mode` — Dark theme
33
+ - `--no-background` — Transparent background
34
+ - `--scale <n>` — Scale factor for PNG (default: 2, use 4 for slide-quality output)
35
+ - `--padding <n>` — Padding in pixels (default: 20)
36
+ - `--frame <id|name>` — Export specific frame only
37
+ - `--element <id>` — Export specific element only
38
+ - `--dry-run` — Validate pipeline without writing
39
+
40
+ ### excal guide
41
+ Output CLI guide as Markdown.
42
+
43
+ ### excal skill
44
+ Return Excalidraw domain knowledge.
45
+
46
+ ---
47
+
48
+ ## Excalidraw scene format
49
+
50
+ ```json
51
+ {
52
+ "type": "excalidraw",
53
+ "version": 2,
54
+ "source": "manual",
55
+ "elements": [ ... ],
56
+ "appState": { "viewBackgroundColor": "#ffffff" },
57
+ "files": {}
58
+ }
59
+ ```
60
+
61
+ ## Element types
62
+
63
+ | Type | Description |
64
+ |---|---|
65
+ | rectangle | Box shape |
66
+ | diamond | Diamond/rhombus |
67
+ | ellipse | Circle/ellipse |
68
+ | arrow | Arrow connector |
69
+ | line | Line/polyline |
70
+ | text | Text label |
71
+ | image | Embedded image |
72
+ | frame | Grouping frame |
73
+
74
+ ## Key element properties
75
+
76
+ Every element has: `id`, `type`, `x`, `y`, `width`, `height`, `isDeleted`,
77
+ `opacity`, `groupIds`, `frameId`, `angle`, `seed`.
78
+
79
+ Shape-specific:
80
+ - `strokeColor` — Border color (hex)
81
+ - `backgroundColor` — Fill color (hex)
82
+ - `fillStyle` — "solid", "hachure", "cross-hatch"
83
+ - `strokeWidth` — Border width (1-4 typical)
84
+ - `roundness` — `{ "type": 3 }` for rounded corners
85
+ - `boundElements` — Array of `{ id, type }` for bound text/arrows
86
+
87
+ Text-specific:
88
+ - `text` — The text content (use \n for line breaks)
89
+ - `fontSize` — Font size in px
90
+ - `fontFamily` — 1 (hand-drawn), 2 (normal), 3 (monospace)
91
+ - `textAlign` — "left", "center", "right"
92
+ - `verticalAlign` — "top", "middle", "bottom"
93
+ - `containerId` — ID of container shape (for bound text)
94
+
95
+ Arrow-specific:
96
+ - `points` — Array of [x, y] relative to element position
97
+ - `startBinding` — `{ elementId, focus, gap }`
98
+ - `endBinding` — `{ elementId, focus, gap }`
99
+
100
+ ## Bound text pattern
101
+
102
+ Text bound to a container:
103
+ 1. Container has `boundElements: [{ id: "text-id", type: "text" }]`
104
+ 2. Text has `containerId: "container-id"`
105
+ 3. Text position is relative but overridden by container
106
+
107
+ ## Styling for professional presentations
108
+
109
+ When creating diagrams for slide decks, use `fontFamily: 1` (the hand-drawn
110
+ Excalidraw style) for a distinctive, approachable look. This gives diagrams
111
+ a clean whiteboard aesthetic that contrasts well with formal slide typography.
112
+
113
+ Use the template's theme colors for visual consistency. Extract colors from
114
+ `pptx theme show`:
115
+
116
+ ```bash
117
+ pptx theme show --manifest ./corp-template --format json
118
+ ```
119
+
120
+ Use the theme's accent colors for fills and strokes. Common pattern:
121
+ - Primary elements: accent1 (e.g., `#003778`)
122
+ - Secondary elements: accent2 (e.g., `#4673C3`)
123
+ - Tertiary/subtle: accent3 (e.g., `#87AAE1`)
124
+ - Contrast/alternative: accent5/accent6 for a different hue
125
+ - Success/positive: `#087f5b` (green)
126
+ - Labels/muted: `#868e96` (gray)
127
+
128
+ ### Aspect ratio matching
129
+
130
+ **This is critical.** Before designing a diagram, check the target
131
+ placeholder's EMU dimensions and calculate its aspect ratio:
132
+
133
+ ```
134
+ aspect = width_emu / height_emu
135
+ ```
136
+
137
+ Design the diagram's bounding box to match. For a 1.2:1 placeholder, aim for
138
+ ~540x450 px. For a 2:1 placeholder, aim for ~600x300 px.
139
+
140
+ Vertical/stacked layouts (top-to-bottom flow) work well for nearly-square
141
+ placeholders. Horizontal layouts work for wide placeholders.
142
+
143
+ ---
144
+
145
+ ## Error codes
146
+
147
+ | Code | Exit | Description |
148
+ |---|---|---|
149
+ | ERR_VALIDATION_INVALID_JSON | 10 | Input is not valid JSON |
150
+ | ERR_VALIDATION_INVALID_SCENE | 10 | Scene structure validation failed |
151
+ | ERR_RENDER_BROWSER_UNAVAILABLE | 20 | Playwright not installed |
152
+ | ERR_RENDER_EXPORT_FAILED | 20 | Export failed in browser |
153
+ | ERR_IO_READ_FAILED | 50 | Failed to read input |
154
+ | ERR_IO_WRITE_FAILED | 50 | Failed to write output |
155
+
156
+ ---
157
+
158
+ ## Concurrency
159
+
160
+ Reads (inspect, validate) and renders are all safe to run concurrently.
161
+ Each render launches its own browser instance.